/*********************************************************************
*	MAIN JS BY Heris
*	last updated : 2003/11/19
*
*	Çì¸®½º
*	http://www.heris.net
*	(c)copyright 2002 by Heris. All rights reserved.
*********************************************************************/

/*********************************************************************
*	SETCOOKIE
*********************************************************************/
function setCookie(name,value,expiredays) {
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() + expiredays);
	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


/*********************************************************************
*	GETCOOKIE
*********************************************************************/
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 openWindow(theURL,theName,theWidth,theHeight,theScroll) { 
	window.open(theURL, theName,'width='+theWidth+',height='+theHeight+',marginwidth=0,marginheight=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+theScroll+',resizable=no');
}


/*********************************************************************
*	ÀÌ¹ÌÁö »çÀÌÁî¿¡ ¸Â°Ô »õÃ¢ ¿­±â
*********************************************************************/
function AutoResize(img){ 
  foto1= new Image(); 
  foto1.src=(img); 
  Controlla(img); 
} 

function Controlla(img){ 
  if((foto1.width!=0)&&(foto1.height!=0)){ 
    viewFoto(img); 
  } else{ 
    funzione="Controlla('"+img+"')"; 
    intervallo=setTimeout(funzione,20); 
  } 
} 

function viewFoto(img){ 
  largh=foto1.width; 
  altez=foto1.height; 
  stringa="width="+largh+",height="+altez; 
  WinOpen(img, stringa);
//  finestra=window.open(img,"",stringa); 
} 

function WinOpen(img, stringa) {
var WinOpen1;
  WinOpen1 = window.open("","",stringa);
  WinOpen1.document.open();
  WinOpen1.document.write("<HTML><HEAD><TITLE>:: ²Þ°ú Çàº¹ÀÇ ³ª¶ó ±ÝÈ£ÆÐ¹Ð¸®·£µå ::</TITLE></HEAD>");
  WinOpen1.document.write("<BODY topmargin=0 leftmargin=0>");
  WinOpen1.document.write("<a href='javascript:window.close()'><IMG SRC='"+escape(img)+"' border=0 alt='Ã¢´Ý±â' onfocus='this.blur()' GALLERYIMG='no'></a>");
  WinOpen1.document.write("</BODY></HTML>");
  WinOpen1.document.close();
}  


if (document.getElementById){
document.write('<style tyfpe="text/css">')
document.write('.submenu{display: none;}')
document.write('</style>')
}



/* »ç¸ñ¿î¿µ°øµ¿Ã¼ ÆîÄ§¸Þ´º ½ÃÀÛ 06.03.20 Çö¹Î Ãß°¡*/
function SwitchMenu(obj){
        if(document.getElementById){
        var el = document.getElementById(obj);
        var ar = document.getElementById("maindiv").getElementsByTagName("span"); 
                if(el.style.display != "block"){
                        for (var i=0; i<ar.length; i++){
                                if (ar[i].className=="submenu") 
                                ar[i].style.display = "none";
                                if (ar[i].className=="submenu_s") 
                                ar[i].style.display = "none";                                
                        }
                        el.style.display = "block";
                }else{
                        el.style.display = "none";
                }
        }
}

// ¾Æ·¡´Â 3Â÷°¡ ÀÖÀ»°æ¿ì
function SwitchMenu_s(obj){
        if(document.getElementById){
        var el = document.getElementById(obj);
        var ar = document.getElementById("maindiv").getElementsByTagName("span"); 
                if(el.style.display != "block"){
                        for (var i=0; i<ar.length; i++){
                                if (ar[i].className=="submenu_s") 
                                ar[i].style.display = "none";
                        }
                        el.style.display = "block";
                }else{
                        el.style.display = "none";
                }
        }
}


/* Çö¹Î 06.03.20 Ãß°¡ */
function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}
