/*
	¿ëµµ : ÄíÅ°È®ÀÎÈÄ ÇÏ·çµ¿¾È ¾È¿­¸®±â ÇÑ»ç¶÷ Á¦¿ÜÇÏ°í ÆË¾÷Ã¢ ¿­±â
	ÀÛ¼ºÀÚ : agassi
*/

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 popup_win(name,url,opt){
	if ( getCookie(name) != "done" ){
       window.open(url,name,opt);	// ÆË¾÷À©µµ¿ìÀÇ °æ·Î¿Í Å©±â¸¦ ¼³Á¤ ÇÏ¼¼¿ä
	}
}

function setCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


function closeWin(name, expire_day){	// expire_day : º¸¿©ÁÖÁö ¾ÊÀ» ³¯¼ö ³Ö±â : 1 => ÇÏ·ç
		setCookie( name, "done" , expire_day); 
		self.close(); 
}

/*
	¿ëµµ : Ã¢Å©±â º¯°æ(³»ºÎÃ¢±âÁØÀ¸·Î »çÀÌÁî º¯°æÇÔ)
	ÀÛ¼ºÀÚ : agassi 2008.07.14
*/

topW = 0;
topH = 0;

function setWH(){
   if (document.all){
	   cW=document.body.offsetWidth;
	   cH=document.body.offsetHeight;
	   window.resizeTo(500,500);
	   barsW=500-document.body.offsetWidth;
	   barsH=500-document.body.offsetHeight;
	   wW=barsW+cW;
	   wH=barsH+cH;
	   window.resizeTo(wW,wH);
   }
   else{
	   wW=window.outerWidth;
	   wH=window.outerHeight;
   }
   topW = wW;
   topH = wH;
}

function buildWH() {
    setWH();
    topW = topW - document.body.clientWidth;
    topH = topH - document.body.clientHeight;
}

function resizeWH(width,height) {
   reW = width + topW;
   reH = height + topH;
   window.resizeTo(reW,reH);
}
