// ¼¼·Î Áß¾ÓÁ¤·Ä
function verticalAlign(obj){
    result=(obj.offsetParent.offsetHeight - obj.offsetHeight)/2+"px";
    if(obj.readyState == "complete"){
        obj.style.marginTop="0";
        obj.style.marginTop=result;
    }else{
        return result;
    }
}

//max-width, max-height
function maxSize(obj,w,h){
    if(obj.readyState != "complete") return "auto";
    real_w=obj.offsetWidth;
    real_h=obj.offsetHeight;
    virt_w=obj.offsetWidth;
    virt_h=obj.offsetHeight;
    if(w>0 && virt_w>w){
        virt_w = w;
        virt_h = real_h * (virt_w/real_w);
    }
    if(h>0 && virt_h>h){
        virt_h = h;
        virt_w = real_w * (virt_h/real_h);
    }

    obj.style.width="0";
    obj.style.height="0";
    obj.style.width=virt_w+"px";
    obj.style.height=virt_h+"px";

}

//min-height
function min_height(obj,h){
    if(obj.readyState != "complete") return "auto";
    if(obj.offsetHeight<h){
        obj.style.height="0";
        obj.style.height=h+"px";
    }

}

//¶óµð¿À,Ã¼Å©¹öÆ° border ¾ø¾Ö±â
function input_nb(obj){
    obj.style.zIndex="1";
    if(obj.type.toLowerCase()=="radio" || obj.type.toLowerCase()=="image"

|| obj.type.toLowerCase()=="checkbox"){

        obj.style.border="0";

    }
}

function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;


function getCookie( name )
{
        var nameOfCookie = name + "=";
        var x = 0;
        while ( x <= document.cookie.length )
        {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                                endOfCookie = document.cookie.length;
                        return unescape( document.cookie.substring( y, endOfCookie ) );
                }
                x = document.cookie.indexOf( " ", x ) + 1;
                if ( x == 0 )
                        break;
        }
        return "";
}



 function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



var isClick = false;
function searchClick() {
    if (isClick == false) {
        document.quickSearch.searchQuery.value = "";
        isClick = true;
    }
}


// check Numeric number
function isNumeric(checkStr) {
	var checkOK = "0123456789";
	
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) {break;}
		}
		
		if (j == checkOK.length) {return false;	break;}
	}
	
	return true;
}

// ÁÖ¹Î¹øÈ£ Ã¼Å©
function JuminCheck(jumin1, jumin2){
 check = false;
 total = 0;
 temp = new Array(13);

 for(i=1; i<=6; i++)
  temp[i] = jumin1.charAt(i-1);
 for(i=7; i<=13; i++)
  temp[i] = jumin2.charAt(i-7);
 
 for(i=1; i<=12; i++){
  k = i + 1;
  if(k >= 10)
   k = k % 10 + 2;
  total = total + temp[i] * k;
 }
 mm = temp[3] + temp[4];
 dd = temp[5] + temp[6];

 totalmod = total % 11;
 chd = 11 - totalmod;
 if(chd == temp[13] && mm < 13 && dd < 32 && (temp[7]==1 || temp[7]==2))
  check=true;
 return check;
}

// °³¹ÌÁ¡¼±¾ø¾Ö±â

function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;


// °¢ ¼­ºêÆäÀÌÁö ÁÂÃø ¸Þ´º ·Ñ¿À¹ö »óÅÂ¸¦ °íÁ¤½ÃÅ°´Â ÇÔ¼ö 
var basic_img = ""; 
function lock_menu(Menu, cate) { 
if (Menu) { 
var target_menu = eval("document.all."+Menu); 
target_menu.src = (cate) ? "" + cate + "./images/"+Menu+"_on.gif" :
"./images/"+Menu+"_on.gif"; 
basic_img = Menu; 
}
} 

// ¸Þ´º º¸ÀÌ±â, ¾Èº¸ÀÌ±â
function HideView() {
    if(document.getElementById("view_img").style.display=="none") {
      document.getElementById("view_img").style.display = "block";
      document.getElementById("view_text").innerText = "¾È³»±Û¼û±â±â";
    }
    else {
      document.getElementById("view_img").style.display = "none";
      document.getElementById("view_text").innerText = "¾È³»±Ûº¸ÀÌ±â";
    }
  }


//ÇÃ·¡½¬ Insert
/* setFlash (ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, º¯¼ö, ¹è°æ»ö, À©µµ¿ì¸ðµå) */
function setFlash(url, w, h, vars, bg, win, id){
	var id = url.split("/")[url.split("/").length-1].split(".")[0]; // id´Â ÆÄÀÏ¸íÀ¸·Î ¼³Á¤
	if (vars == null) vars = '';
	if (bg == null) bg = '#fff';
	if (win == null) win = 'transparent';

	var flashStr= "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'";
		 flashStr+="		width='" + w + "' height='" + h + "' id='" + id + "' align='middle'>";
		 flashStr+="		<param name='allowScriptAccess' value='always'>";
		 flashStr+="		<param name='movie' value='" + url + "'>";
		 flashStr+="		<param name='FlashVars' value='" + vars + "'>";
		 flashStr+="		<param name='wmode' value='" + win + "'>";
		 flashStr+="		<param name='menu' value='false'>";
		 flashStr+="		<param name='quality' value='high'>";
		 flashStr+="		<param name='bgcolor' value='" + bg + "'>";
		 flashStr+="		<param name='wmode' value='opaque'>";

		 flashStr+="		<embed src='" + url + "'";
		 flashStr+="		flashVars='" + vars + "'";
		 flashStr+="		wmode='" + win + "'";
		 flashStr+="		menu='false'";
		 flashStr+="		quality='high'";
		 flashStr+="		bgcolor='" + bg + "'";
		 flashStr+="		width='" + w + "'";
		 flashStr+="		height='" + h + "'";
		 flashStr+="		name='" + id + "'";
		 flashStr+="		align='middle'";
		 flashStr+="		allowScriptAccess='always'";
		 flashStr+="		type='application/x-shockwave-flash'";
		 flashStr+="		pluginspage='http://www.macromedia.com/go/getflashplayer'>";
		 flashStr+="</object>";

	document.write(flashStr);
}
//ÇÃ·¡½¬ Insert

function showObject(object) { 
    document.getElementById(object).style.display ='block'; 
	
} 
/* Hide an object */ 
function hideObject(object,object2,object3,object4,object5,object6) { 
  if (object)
			document.getElementById(object).style.display ='none'; 
		if (object2)
			document.getElementById(object2).style.display ='none'; 
		if (object3)
			document.getElementById(object3).style.display ='none'; 
		if (object4)
			document.getElementById(object4).style.display ='none'; 
		if (object5)
			document.getElementById(object5).style.display ='none'; 
		if (object6)
			document.getElementById(object6).style.display ='none'; 
}
