

/************************************************************
¼³¸í : »õÃ¢ ¶ç¿ö¼­ Æ÷Ä¿½º ÁÖ±â
¿¹)winOpen(url,winName,width,height,scrollbars,resizable,left,top)

À§Ä¡ ÁöÁ¤ ¾ÈÇÏ¸é ÇØ»óµµ °¡¿îµ¥·Î
winOpen('ÁÖ¼Ò','À©µµ¿ìÀÌ¸§',500,400,'yes','no')

À§Ä¡ ÁöÁ¤ÇÏ¸é ÇØ´ç À§Ä¡·Î
winOpen('ÁÖ¼Ò','À©µµ¿ìÀÌ¸§',500,400,'yes','no',100,100)
************************************************************/
function winOpen(pUrl,pName,pW,pH,sb,rs,pL,pT){
	if(typeof(pL)=="undefined"){
		var winWidth  = window.screen.width;    //ÇØ»óµµ°¡·Î
		pL = parseInt((winWidth-pW)/2);
	}
	if(typeof(pT)=="undefined"){
		var winHeight  = window.screen.height;     //ÇØ»óµµ¼¼·Î
		pT = parseInt((winHeight-pH)/2);
	}

	var newWin=window.open(pUrl,pName,"width="+pW+",height="+pH+",scrollbars="+sb+",resizable="+rs+",left=" + pL + ",top=" + pT+",directories=no,status=no,menubar=no");
	newWin.focus(); 
}

function windowOpen(pUrl,pName,pW,pH,sb,rs,pL,pT){
	winOpen(pUrl,pName,pW,pH,sb,rs,pL,pT);
}

/*
setCookie( "Notice", "done" , 1);
(ÀÌ¸§,°ª,³¯Â¥)  ÇÏ·çµ¿¾È ÄíÅ° ÀúÀå
*/
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 prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1)
		return "";
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1)
		cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

/*
ÄíÅ° ¼Ò¸ê ÇÔ¼ö
*/
function clearCookie(name) {
	if (getCookie(name)){	
		var today = new Date();
		//¾îÁ¦ ³¯Â¥¸¦ ÄíÅ° ¼Ò¸ê ³¯Â¥·Î ¼³Á¤ÇÑ´Ù.
		var expire_date = new Date(today.getTime() - 60*60*24*1000);
		document.cookie = name + "= " + "; expires=" + expire_date.toGMTString();
	}
}
