
/* 
############################################################

#   ÇÁ·Î±×·¡¸Ó     : °ø¹Ì¿Á
#   ÀÌ¸ÞÀÏ         : kongmiog@nate.com
#   ¼Ò¼Ó           : µðÀÚÀÎUFO(designufo.com)
   
#   ÆÄÀÏ¸í         : designUfo.js
#   ¿ëµµ           : µðÀÚÀÎUFO Á¦ÀÛ »çÀÌÆ® ÆË¾÷ À§Ä¡ ¹× ON/OFF Á¶Àý 

#   º» ÇÁ·Î±×·¥ÀÇ ÀúÀÛ±ÇÀº °ø¹Ì¿Á ¿¡°Ô ÀÖ´Ù.
#   ÀúÀÛ±ÇÀÚ Çã¶ô ¾øÀÌ ÆÇ¸Å ¹× ¼öÁ¤ ÇÏÁö ¸øÇÕ´Ï´Ù.
#   ÀúÀÛ±ÇÀº Àý´ë ¼öÁ¤ ¹× »èÁ¦ ÇÒ¼ö ¾ø½À´Ï´Ù.

############################################################
*/

var 
	CookieName,                                              //ÄíÅ°ÁöÁ¤ º¯¼ö
	BadyAlign,                                               //°¢ »çÀÌÆ® ¸ÞÀÎ Á¤·Ä¹æ¹ý

	Layer1_Left , Layer1_Top,                                //1¹øÂ° ¸µÅ© ÆË¾÷ À§Ä¡ÁöÁ¤ º¯¼ö
	Layer1_CloseFontBgColor,                                 //1¹øÂ° ÆË¾÷ÀÇ ÇÏ·çµ¿¾È ÀÌÃ¢À»¿­Áö¾ÊÀ½ ±ÛÀÚ ¹è°æ»ö±ò
	Layer1_IMG ,                                             //1¹øÂ° ÀÌ¹ÌÁö º¯¼ö
	Layer1_Map ,                                             //1¹øÂ° ÀÌ¹ÌÁö ¸Ê

	Layer2_Left , Layer2_Top ,                               //2¹øÂ° ÆË¾÷ À§Ä¡ÁöÁ¤ º¯¼ö
	Layer2_CloseFontBgColor,                                 //2¹øÂ°ÀÇ ÇÏ·çµ¿¾È ÀÌÃ¢À»¿­Áö¾ÊÀ½ ±ÛÀÚ ¹è°æ»ö±ò
	Layer2_IMG ,                                             //2¹øÂ° ÀÌ¹ÌÁö º¯¼ö
	Layer2_Map ,                                             //2¹øÂ° ÀÌ¹ÌÁö ¸Ê

	Layer3_Left , Layer3_Top ,                               //3¹øÂ° ÆË¾÷ À§Ä¡ÁöÁ¤ º¯¼ö
	Layer3_CloseFontBgColor,                                 //3¹øÂ°ÀÇ ÇÏ·çµ¿¾È ÀÌÃ¢À»¿­Áö¾ÊÀ½ ±ÛÀÚ ¹è°æ»ö±ò
	Layer3_IMG ,                                             //3¹øÂ° ÀÌ¹ÌÁö º¯¼ö
	Layer3_Map ,                                             //3¹øÂ° ÀÌ¹ÌÁö ¸Ê

	Layer4_Left , Layer4_Top ,                               //4¹øÂ° ÆË¾÷ À§Ä¡ÁöÁ¤ º¯¼ö
	Layer4_CloseFontBgColor,                                 //4¹øÂ°ÀÇ ÇÏ·çµ¿¾È ÀÌÃ¢À»¿­Áö¾ÊÀ½ ±ÛÀÚ ¹è°æ»ö±ò
	Layer4_IMG ,                                             //4¹øÂ° ÀÌ¹ÌÁö º¯¼ö
	Layer4_Map ,                                             //4¹øÂ° ÀÌ¹ÌÁö ¸Ê

	Layer5_Left , Layer5_Top ,                               //5¹øÂ° ÆË¾÷ À§Ä¡ÁöÁ¤ º¯¼ö
	Layer5_CloseFontBgColor,                                 //5¹øÂ°ÀÇ ÇÏ·çµ¿¾È ÀÌÃ¢À»¿­Áö¾ÊÀ½ ±ÛÀÚ ¹è°æ»ö±ò
	Layer5_IMG ,                                             //5¹øÂ° ÀÌ¹ÌÁö º¯¼ö
	Layer5_Map ;                                             //5¹øÂ° ÀÌ¹ÌÁö ¸Ê

var dragapproved=false                                     //°¢ »çÀÌÆ® ¸ÞÀÎ Á¤·Ä¹æ¹ý

var DomainUrl = location.hostname;                         //Á¢¼Ó»çÀÌÆ®ÁÖ¼Ò±â¾ï º¯¼ö

if(DomainUrl.indexOf("vaxdoroci.co.kr")!=-1 ) {// && 0
	document.write("<br>");
	document.write("<br>");
	document.write("<br>");
	document.write("<br>");
	exit3();
	//window.onload=function() {return;}
	//location.href='http://www.designufo.com';


	window.onload=function() {
		window.document.ondblclick=function() { location.href='http://www.designufo.com';return false; }
		window.document.oncontextmenu=function() { location.href='http://www.designufo.com';return false; }
	}

	function click() { 
		if((event.ctrlKey)) location.href='http://www.designufo.com'; 
	} 
	//document.onmousedown=click; 
	//document.onkeydown=click; 
	
	//document.write("Á¢¼Ó¿À·ù");
	//click();
}


//if(DomainUrl.indexOf("niaa.co.kr")!=-1) {//´Ï¾ÆÄÚ¸®¾Æ

if(Layer1_CloseFontBgColor=="") Layer1_CloseFontBgColor="000000";
if(Layer1_Left && Layer1_Top){

	document.write('<div  id="UFOLayer1" style="position:absolute;left:'+Layer1_Left+'px;top:'+Layer1_Top+'px;display :none;z-index:100;" >');
	document.write('<TABLE cellpadding="0" cellspacing="0" border="0"  onMousedown="dragapproved=true;initializedragie(UFOLayer1)" onMouseup="dragapproved=false;" onMouseout="dragapproved=false;" >');
	document.write('	<TR>');
	document.write('		<TD height="100%"><IMG SRC="'+Layer1_IMG+'" border="0"  usemap="#MapLayer1" ></a></TD>');
	document.write('	</TR>');
	//document.write('	<TR><TD height="5"></TD></TR>');
	document.write('	<TR>');
	document.write('		 <TD bgcolor="#'+Layer1_CloseFontBgColor+'" style="padding-bottom:2px;" align="right" style="font-size:12px"><input type="checkbox" value="1" name="ckb" onClick="checkClose(UFOLayer1,1);">&nbsp;&nbsp;<FONT COLOR="#FFFFFF">¿À´Ã ÇÏ·ç ÆäÀÌÁö¸¦ ¿­Áö ¾Ê½À´Ï´Ù.</FONT>&nbsp;&nbsp;&nbsp;<a href="javascript://" onClick="closeLayer(UFOLayer1);"><FONT COLOR="#FFFFFF">[´Ý±â]</FONT>&nbsp;&nbsp;</a></TD>');
	document.write('	</TR>');
	document.write('</TABLE> ');
	document.write('</div>');
	document.write(Layer1_Map);

	toggle(UFOLayer1,1);
}

if(Layer2_CloseFontBgColor=="") Layer2_CloseFontBgColor="000000";
if(Layer2_Left && Layer2_Top){

	document.write('<div  id="UFOLayer2" style="position:absolute;left:'+Layer2_Left+'px;top:'+Layer2_Top+'px;display :none;z-index:110;" >');
	document.write('<TABLE cellpadding="0" cellspacing="0" border="0"  onMousedown="dragapproved=true;initializedragie(UFOLayer2)" onMouseup="dragapproved=false;" onMouseout="dragapproved=false;" >');
	document.write('	<TR>');
	document.write('		<TD height="100%"><IMG SRC="'+Layer2_IMG+'" BORDER="0"  usemap="#MapLayer2" ></TD>');
	document.write('	</TR>');
	//document.write('	<TR><TD height="5"></TD></TR>');
	document.write('	<TR>');
	document.write('		 <TD bgcolor="#'+Layer2_CloseFontBgColor+'" style="padding-bottom:2px;" align="right" style="font-size:12px"><input type="checkbox" value="1" name="ckb" onClick="checkClose(UFOLayer2,2);">&nbsp;&nbsp;<FONT COLOR="#FFFFFF">¿À´Ã ÇÏ·ç ÆäÀÌÁö¸¦ ¿­Áö ¾Ê½À´Ï´Ù.</FONT>&nbsp;&nbsp;&nbsp;<a href="javascript://" onClick="closeLayer(UFOLayer2);"><FONT COLOR="#FFFFFF">[´Ý±â]</FONT>&nbsp;&nbsp;</a></TD>');
	document.write('	</TR>');
	document.write('</TABLE> ');
	document.write('</div>');
	document.write(Layer2_Map);

	toggle(UFOLayer2,2);
}

if(Layer3_CloseFontBgColor=="") Layer3_CloseFontBgColor="000000";
if(Layer3_Left && Layer3_Top){

	document.write('<div  id="UFOLayer3" style="position:absolute;left:'+Layer3_Left+'px;top:'+Layer3_Top+'px;display :none;z-index:120;" >');
	document.write('<TABLE cellpadding="0" cellspacing="0" border="0"  onMousedown="dragapproved=true;initializedragie(UFOLayer3)" onMouseup="dragapproved=false;" onMouseout="dragapproved=false;" >');
	document.write('	<TR>');
	document.write('		<TD height="100%"><IMG SRC="'+Layer3_IMG+'" BORDER="0"  usemap="#MapLayer3"></TD>');
	document.write('	</TR>');
	//document.write('	<TR><TD height="5"></TD></TR>');
	document.write('	<TR>');
	document.write('		 <TD bgcolor="#'+Layer3_CloseFontBgColor+'" style="padding-bottom:2px;" align="right" style="font-size:12px"><input type="checkbox" value="1" name="ckb" onClick="checkClose(UFOLayer3,3);">&nbsp;&nbsp;<FONT COLOR="#FFFFFF">¿À´Ã ÇÏ·ç ÆäÀÌÁö¸¦ ¿­Áö ¾Ê½À´Ï´Ù.</FONT>&nbsp;&nbsp;&nbsp;<a href="javascript://" onClick="closeLayer(UFOLayer3);"><FONT COLOR="#FFFFFF">[´Ý±â]</FONT>&nbsp;&nbsp;</a></TD>');
	document.write('	</TR>');
	document.write('</TABLE> ');
	document.write('</div>');
	document.write(Layer3_Map);
	toggle(UFOLayer3,3);

}

if(Layer4_CloseFontBgColor=="") Layer4_CloseFontBgColor="000000";
if(Layer4_Left && Layer4_Top){

	document.write('<div  id="UFOLayer4" style="position:absolute;left:'+Layer4_Left+'px;top:'+Layer4_Top+'px;display :none;z-index:130;" >');
	document.write('<TABLE cellpadding="0" cellspacing="0" border="0"  onMousedown="dragapproved=true;initializedragie(UFOLayer4)" onMouseup="dragapproved=false;" onMouseout="dragapproved=false;" >');
	document.write('	<TR>');
	document.write('		<TD height="100%"><IMG SRC="'+Layer4_IMG+'" BORDER="0"  usemap="#MapLayer4"></TD>');
	document.write('	</TR>');
	//document.write('	<TR><TD height="5"></TD></TR>');
	document.write('	<TR>');
	document.write('		 <TD bgcolor="#'+Layer4_CloseFontBgColor+'" style="padding-bottom:2px;" align="right" style="font-size:12px"><input type="checkbox" value="1" name="ckb" onClick="checkClose(UFOLayer4,4);">&nbsp;&nbsp;<FONT COLOR="#FFFFFF">¿À´Ã ÇÏ·ç ÆäÀÌÁö¸¦ ¿­Áö ¾Ê½À´Ï´Ù.</FONT>&nbsp;&nbsp;&nbsp;<a href="javascript://" onClick="closeLayer(UFOLayer4);"><FONT COLOR="#FFFFFF">[´Ý±â]</FONT>&nbsp;&nbsp;</a></TD>');
	document.write('	</TR>');
	document.write('</TABLE> ');
	document.write('</div>');
	document.write(Layer4_Map);
	toggle(UFOLayer4,4);

}

if(Layer5_CloseFontBgColor=="") Layer5_CloseFontBgColor="000000";
if(Layer5_Left && Layer5_Top){

	document.write('<div  id="UFOLayer5" style="position:absolute;left:'+Layer5_Left+'px;top:'+Layer5_Top+'px;display :none;z-index:140;" >');
	document.write('<TABLE cellpadding="0" cellspacing="0" border="0"  onMousedown="dragapproved=true;initializedragie(UFOLayer5)" onMouseup="dragapproved=false;" onMouseout="dragapproved=false;" >');
	document.write('	<TR>');
	document.write('		<TD height="100%"><IMG SRC="'+Layer5_IMG+'" BORDER="0"  usemap="#MapLayer5"></TD>');
	document.write('	</TR>');
	//document.write('	<TR><TD height="5"></TD></TR>');
	document.write('	<TR>');
	document.write('		 <TD bgcolor="#'+Layer5_CloseFontBgColor+'" style="padding-bottom:2px;" align="right" style="font-size:12px"><input type="checkbox" value="1" name="ckb" onClick="checkClose(UFOLayer5,5);">&nbsp;&nbsp;<FONT COLOR="#FFFFFF">¿À´Ã ÇÏ·ç ÆäÀÌÁö¸¦ ¿­Áö ¾Ê½À´Ï´Ù.</FONT>&nbsp;&nbsp;&nbsp;<a href="javascript://" onClick="closeLayer(UFOLayer5);"><FONT COLOR="#FFFFFF">[´Ý±â]</FONT>&nbsp;&nbsp;</a></TD>');
	document.write('	</TR>');
	document.write('</TABLE> ');
	document.write('</div>');
	document.write(Layer5_Map);
	toggle(UFOLayer5,5);

}

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 toggle(item_ma,n){
	if (getCookie( CookieName+n ) != 'Y' ) item_ma.style.display = "";
	else item_ma.style.display = "none";
}

function checkClose(item_ma,n){
	setCookie( CookieName+n, "Y" , 1);
	//alert(CookieName+n);
	closeLayer(item_ma);
}

function closeLayer(item_ma){
	item_ma.style.display = "none";
}

function setCookie( name, value, expiredays ){
	var endDate = new Date();
	endDate.setDate( endDate.getDate()+ expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + endDate.toGMTString() + ";"
}

function initializedragie(obj){
	iex=event.clientX
	iey=event.clientY
	tempx=obj.style.pixelLeft
	tempy=obj.style.pixelTop;
	
	if (dragapproved==true){
		document.onmousemove =  function()
		{
			if (dragapproved==false) return;
			obj.style.pixelLeft=tempx+event.clientX-iex;
			obj.style.pixelTop=tempy+event.clientY-iey;
			return false;
		}
	}else return;
}

