window.onerror=function(msg,file,line) {
	//alert("¿À·ù¸Þ¼¼Áö\t"+msg+"\n"+"ÆÄÀÏÀ§Ä¡\t"+file+"\n"+"¶óÀÎ¹øÈ£\t"+line);
    return true;  //true¸¦ returnÇÏ¸é ¿À·ù¸Þ¼¼Áö¸¦ ¹ß»ý½ÃÅ°Áö ¾ÊÀ½
} 
// png ÆÄÀÏ Åõ¸í Ã³¸® 
function setPng24(obj) {
    obj.width=obj.height=1;
    obj.className=obj.className.replace(/\bpng24\b/i,'');
    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
    obj.src='';
    return '';
}


// hide, show
function showHide(obj, current) {
	if(current == 0) {
		document.getElementById(obj).style.display = "none";
	} else {
		document.getElementById(obj).style.display = "block";
	}
}

function createRequest(){
	try {
		request = new XMLHttpRequest();
	} catch (trymicrosoft) {
		try {
			request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (othermicrosoft) {
			try {
				request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (failed) {
				request = false;
			}
		}
	}
	return request;
}

/**
* ÄíÅ°°ª ÃßÃâ
* @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 + "=" + encodeURI( 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=/";
}

var win = null;
// ÆË¾÷ À©µµ¿ì
function openWin(sizeX, sizeY, url, frm){
	if(screen.width == sizeX){
		var T = 0; var L = 0;
	}else{
		var L = ((screen.width) -sizeX)/2;
		var T = ((screen.height) -sizeY)/2;
	}
	if(!win || win.closed){
		win = window.open(url, frm ,'width='+sizeX +',height='+sizeY +',left='+L +',top='+T +', resizable=no, scrollbars=no, toolbar=no, menubar=no');
	}else{
		win.close();
		win = window.open(url, frm ,'width='+sizeX +',height='+sizeY +',left='+L +',top='+T +', resizable=no, scrollbars=no, toolbar=no, menubar=no');
	}
}

// »óÀ§·Î ½ºÅ©·Ñ ÀÌµ¿
function goTop(){
	var top = document.documentElement.scrollTop;
	while(true){
		if(top > 0){
			top = top - (Math.round(top / 10) + 1);
			document.documentElement.scrollTop = top;
		}else{
			document.documentElement.scrollTop = 0;
			break;
		}	
	}
}

// µð¹ÙÀÌ½º ¸ñ·Ï ·¹ÀÌ¾î
function showDeviceLayer(){
	var layer = document.getElementById("device_layer");
	layer.style.display = (layer.style.display == "none") ? "" : "none";
	if(layer.style.display == ""){
		layer.focus();
	}
}