/*********************************************************************
*	MAIN JS BY Heris
*	last updated : 2003/11/19
*
*	Çì¸®½º
*	http://www.heris.net
*	(c)copyright 2002 by Heris. All rights reserved.
*********************************************************************/

/*********************************************************************
*	onfocus="this.blur();" È¿°ú ÁÖ±â
*********************************************************************/  

function autoBlur(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
	document.body.focus(); 
} 
document.onfocusin=autoBlur; 

/*********************************************************************
*	ÆÊ¾÷ Á¦¾îÃ¢ : ÆÊ¾÷¿¡¼­ Å¬¸¯ÇÏ¸é ºÎ¸ðÆäÀÌÁö·Î ÇØ´ç ¸µÅ©¸¦ ¿¬°áÇØÁØ´Ù. 
*********************************************************************/
function tmt_opener(url) {
    opener.location.href = url;    
}

/*********************************************************************
*	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();
}  

/*********************************************************************
*	±ÔÁ¤ ¸Þ´º º¸¿©ÁÖ±â
*********************************************************************/

var old_menu = '';
var old_cell = '';

function menuclick( submenu ,cellbar){

 if( old_menu != submenu ) {
  if( old_menu !='' ) {
   old_menu.style.display = 'none';
  }
 submenu.style.display = 'block';
 old_menu = submenu;
 old_cell = cellbar;
 } else {
 submenu.style.display = 'none';
 old_menu = '';
 old_cell = '';
 }
}


/* ÆîÄ§¸Þ´º ½ºÅ©¸³Æ® ½ÃÀÛ */
if (document.getElementById){
document.write('<style tyfpe="text/css">')
document.write('.submenu{display: none;}')
document.write('</style>')
}

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";
                }
        }
}

/* ÆÞÄ§¸Þ´º ½ºÅ©¸³Æ® ³¡ */
