// using for ÇÑ ¹ø¸¸ ¶ç¿ì´Â ÆË¾÷Ã¢
function setCookie(name,value, expiredays ) // Ã¢ ´Ù½Ã ¿­Áö ¾Ê±â À§ÇÑ ÄíÅ°¼³Á¤ ÇÔ¼ö
{
	 var todayDate = new Date();
	 todayDate.setDate( todayDate.getDate() + expiredays );
	 document.cookie = name + "=" + escape( value ) + "; path=/;expires=" + todayDate.toGMTString() + ";"
}

function pop_evt(pop, wd, he, name, value, left, top)
{
	var url = pop;
	var wd = wd;
	var he = he;
	var x = left;
	var y = top;

	var eventCookie=getCookie(name);
	if (eventCookie != value){
		window.open(url,'',"toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ",left=" + x + ",top=" + y + ";")
	}

	//ÆË¾÷Ã¢ÀÇ ÁÖ¼Ò, °°Àº µµ¸ÞÀÎ¿¡ ÀÖ¾î¾ß ÇÑ´Ù.
}

function getCookie(name)
{
		 var Found = false
		 var start, end
		 var i = 0

		 // cookie ¹®ÀÚ¿­ ÀüÃ¼¸¦ °Ë»ö
		 while(i <= document.cookie.length)
		 {
			start = i
				end = start + name.length
				// name°ú µ¿ÀÏÇÑ ¹®ÀÚ°¡ ÀÖ´Ù¸é
				if (document.cookie.substring(start, end) == name)
				{
					Found = true
						break
				}
				i++
		 }

		 // name ¹®ÀÚ¿­À» cookie¿¡¼­ Ã£¾Ò´Ù¸é
	 if(Found == true)
	 {
				start = end + 1
				end = document.cookie.indexOf(";", start)
				// ¸¶Áö¸· ºÎºÐÀÌ¶ó´Â °ÍÀ» ÀÇ¹Ì(¸¶Áö¸·¿¡´Â ";"°¡ ¾ø´Ù)
				if (end < start) end = document.cookie.length

				// name¿¡ ÇØ´çÇÏ´Â value°ªÀ» ÃßÃâÇÏ¿© ¸®ÅÏÇÑ´Ù.
				return document.cookie.substring(start, end)
		  }

		  // Ã£Áö ¸øÇß´Ù¸é
		  return ""
}

/* ÆË¾÷Ã¢ ÇÑ¹ø¸¸ ¿­±â ½ºÅ©¸³Æ® */
// using for ÇÑ ¹ø¸¸ ¶ç¿ì´Â ÆË¾÷Ã¢
function setCookie( name, value, expiredays ) // Ã¢ ´Ù½Ã ¿­Áö ¾Ê±â À§ÇÑ ÄíÅ°¼³Á¤ ÇÔ¼ö
{
	 var todayDate = new Date();
	 todayDate.setDate( todayDate.getDate() + expiredays );
	 document.cookie = name + "=" + escape( value ) + "; path=/;expires=" + todayDate.toGMTString() + ";"
}

function winclose() // Ã¢ ´ÝÀ¸¸ç ÄíÅ°Àû¿ë
{
	 if ( document.pop.Notice.checked ) {
			setCookie( "acePop", "done" , 1);//1Àº ÇÏ·çµ¿¾È »õÃ¢À» ¿­Áö ¾Ê°Ô ÇÕ´Ï´Ù.
			self.close();
	}
	var layer_name = document.getElementById("acePop");
	layer_name.style.display = "none";
}



// ·¹ÀÌ¾î ÆË¾÷ ¶ç¿ì±â : ÄíÅ°Ã¼Å©
function layerPop(){
	//alert(eventCookie);
	if (!getCookie("acePop") &&!document.getElementById("acePop")){
	var popCnt="";
	popCnt=popCnt+'<div style="position:absolute; left:747px; top:166px;" id="aceMorning">';
	popCnt=popCnt+'<img src="/Event/popup/090317/ace_Morning.jpg" usemap="#ace_Morning" alt="" />';
	popCnt=popCnt+'<map id="ace_Morning">';
	popCnt=popCnt+'<area shape="rect" href="http://blog.naver.com/acebed4you" target="_blank" coords="0,0,140,65" alt="¿¡ÀÌ½ºÄ§´ë °ø½Ä ºí·Î±× ¹Ù·Î°¡±â" onfocus="this.blur();"/>';
	popCnt=popCnt+'<area shape="rect" href="#" onclick="layerClose(\'aceMorning\')" coords="145,6,159,19"alt="´Ý±â" /></map> ';
	popCnt=popCnt+'</div> ';

	popCnt=popCnt+'<div style="position:absolute; left:915px; top:166px;" id="acePop">';
	popCnt=popCnt+'<img src="/Event/popup/090317/ace_Avenue.jpg" usemap="#ace_Avenue" />';
	popCnt=popCnt+'<map id="ace_Avenue">';
		popCnt=popCnt+'<area shape="rect" href="/Shop/shop_avenue.asp" coords="0,0,140,65" alt="¿¡ÀÌ½º ¿¡ºñ´º ÀÚ¼¼È÷ º¸±â" onfocus="this.blur();"/>';
	popCnt=popCnt+'<area shape="rect" href="#" onclick="layerClose(\'acePop\')" coords="145,6,159,19"alt="´Ý±â" /></map>';
	popCnt=popCnt+'</div>'
	document.write(popCnt);
	}
}

// ·¹ÀÌ¾î ÆË¾÷ ´Ý±â : ÄíÅ°Ã¼Å©
function layerClose(pId){
	//if(document.layerChk.todayCh.checked){
	//	setCookie(pId, "1" , 1);
	//}
	document.getElementById("wrapper").removeChild(document.getElementById(pId));
}

/*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 '';
}*/
