/*--------------  ÀÌ¹ÌÁö ÇÁ¸®·Îµå --------------*/
/* <body onLoad="MM_preloadImages('icon1.gif', 'icon2.gif', 'icon3.gif')"> */
function MM_preloadImages()
{ 
	//v3.0
	var d=document; 
	
	if(d.images)
	{ 
		if(!d.MM_p)
		d.MM_p=new Array();
		
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
		{
			if (a[i].indexOf("#")!=0)
			{
				d.MM_p[j]=new Image; 
				d.MM_p[j++].src=a[i];
			}
		}
	}
}
/*-------------- »ó´Ü Dropdown ¹Ú½º ÄÁÆ®·² ½ºÅ©¸³Æ® ½ÃÀÛ --------------*/
var posX;
function MouseOver(bool){
	if (bool){
		document.all.combo.style.borderRight = "1 solid black";
		document.all.combo.style.borderTop = "1 solid black";
		document.all.combo.style.borderBottom = "1 solid black";
		document.all.txtSelect.style.border = "1 solid black";

	}else{
		document.all.combo.style.borderRight = "1 solid #E3E3E3";
		document.all.combo.style.borderTop = "1 solid #E3E3E3";
		document.all.combo.style.borderBottom = "1 solid #E3E3E3";
		document.all.txtSelect.style.border = "1 solid #E3E3E3";
	}
}

function MouseDown(){
	if (document.all.LinkList.style.display == "none"){
		document.all.LinkList.style.display = "";
	}else{
		document.all.LinkList.style.display = "none";
	}
}

function showLinkList(bool){
	if (bool){
		document.all.LinkList.style.display = "";
	}else{
		document.all.LinkList.style.display = "none";	
	}
}

function MouseOnLink(obj, bool){
	if (bool){
		obj.style.border = "1 solid black";
	}else{
		obj.style.border = "1 solid white";

	}	
}

function ClickLinkList(obj)
{
	document.all.LinkList.style.display = "none";
}
/*-------------- »ó´Ü Dropdown ¹Ú½º ÄÁÆ®·² ½ºÅ©¸³Æ® ³¡ --------------*/

function clearImage(thefield)
{
	if (thefield.defaultValue == thefield.value) thefield.style.backgroundImage = '';
}
function setUsbVer(str)
{
//	alert(str.value);
}
function chk_infrover(str)
{
//	alert(str.value);
}

/*-------------- »çÀÌÆ® ÇÑ¿µ º¯È¯ ÄíÅ° ¼³Á¤ --------------*/
/**
* ÄíÅ°°ª ÃßÃâ
* @param cookieName ÄíÅ°¸í
*/
function getCookie( cookieName )
{
	var search = cookieName + "=";
	var cookie = document.cookie;
	
	// ÇöÀç ÄíÅ°°¡ Á¸ÀçÇÒ °æ¿ì
	if( cookie.length > 0 )
	{
		// ÇØ´ç ÄíÅ°¸íÀÌ Á¸ÀçÇÏ´ÂÁö °Ë»öÇÑ ÈÄ Á¸ÀçÇÏ¸é À§Ä¡¸¦ ¸®ÅÏ.
		startIndex = cookie.indexOf( cookieName );
		
		// ¸¸¾à Á¸ÀçÇÑ´Ù¸é
		if( startIndex != -1 )
		{
			// °ªÀ» ¾ò¾î³»±â À§ÇØ ½ÃÀÛ ÀÎµ¦½º Á¶Àý
			startIndex += cookieName.length;
			
			// °ªÀ» ¾ò¾î³»±â À§ÇØ Á¾·á ÀÎµ¦½º ÃßÃâ
			endIndex = cookie.indexOf( ";", startIndex );
			
			// ¸¸¾à Á¾·á ÀÎµ¦½º¸¦ ¸øÃ£°Ô µÇ¸é ÄíÅ° ÀüÃ¼±æÀÌ·Î ¼³Á¤
			if( endIndex == -1) endIndex = cookie.length;
			
			// ÄíÅ°°ªÀ» ÃßÃâÇÏ¿© ¸®ÅÏ
			return unescape( cookie.substring( startIndex + 1, endIndex ) );
		}
		else
		{
		// ÄíÅ° ³»¿¡ ÇØ´ç ÄíÅ°°¡ Á¸ÀçÇÏÁö ¾ÊÀ» °æ¿ì
		return false;
		}
	}
	else
	{
	// ÄíÅ° ÀÚÃ¼°¡ ¾øÀ» °æ¿ì
	return false;
	}
}

/**
* ÄíÅ° ¼³Á¤
* @param cookieName ÄíÅ°¸í
* @param cookieValue ÄíÅ°°ª
* @param expireDay ÄíÅ° À¯È¿³¯Â¥
*/
function setCookie( cookieName, cookieValue, expireDate )
{
	var today = new Date();
	today.setDate( today.getDate() + parseInt( expireDate ) );
	document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/; expires=" + today.toGMTString() + ";"
}

/**
* ÄíÅ° »èÁ¦
* @param cookieName »èÁ¦ÇÒ ÄíÅ°¸í
*/
function deleteCookie( cookieName )
{
	var expireDate = new Date();
	
	//¾îÁ¦ ³¯Â¥¸¦ ÄíÅ° ¼Ò¸ê ³¯Â¥·Î ¼³Á¤ÇÑ´Ù.
	expireDate.setDate( expireDate.getDate() - 1 );
	document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString() + "; path=/";
}

function Change_Lang(Lang)
{
	// source from : http://mwultong.blogspot.com/2006/05/htmlcss-gecko.html
	/* 3/11/2008 tested
	if (navigator.userAgent.toLowerCase().indexOf('gecko') == -1)
	{
		var version = navigator.appVersion;
		var ver = version.split(';');
		var msver = new String(ver[1]);
		if (msver.toString() == " MSIE 7.0" || msver.toString() == "MSIE 7.0")
		{
			alert("Sorry, IE7 has some problem, so chaging language doesn't work.\n\nsetCookie function of javascript has some problem on IE7.\nI'm trying to fix now\nyou tried to change : "+Lang);
		}
	}
	*/
	setCookie("CK_LANG",Lang,30);
	location.reload();
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function view_photo(src) {
	window.open('/photo_view.php?src='+src,'_blank','left=0, top=0, width=10,height=10,resizable=yes,toolbars=no,scrollbars=yes');
}
