﻿function __exform_toggle(dont_open){
	if(dont_open.src.indexOf('false.gif')>0){
		dont_open.src = '/__exform_popup/images/dont_open_true.gif';
	}else{
		dont_open.src = '/__exform_popup/images/dont_open_false.gif';
	}
}

function setCookie( name, value, expiredays ) {
    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + expiredays );
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function closeWinWithoutCookie(_layer) {
    __exform_hidden(_layer);
}

function closeWinWithCookie_01(_layer) {
    setCookie("duvent_layer_popup_01", "not_today_01" , 1);
    __exform_hidden(_layer);
}

function closeWinWithCookie_05(_layer) {
    setCookie("duvent_layer_popup_05", "not_today_05" , 1);
    __exform_hidden(_layer);
}

function closeWinWithCookie_06(_layer) {
    setCookie("duvent_layer_popup_06", "not_today_06" , 1);
    __exform_hidden(_layer);
}

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 "" 
} 


function __exform_hidden(_layer){
	 _layer.style.visibility = "hidden";
}

function openMsgBox_01() { ////// IE window의 창을 흉내냄. 타이틀 바를 클릭하여 레이어 창을 드래그 할 수 있음.
	var eventCookie_01 = getCookie("duvent_layer_popup_01"); 

	if (eventCookie_01 != "not_today_01") {
		top.document.writeln("<div id='__exform_popup_layer_01' style='position:absolute; left=400px; top=150px; width=361px; height=374px; visibility:visible; z-index:9999; overflow:visible; border:0px solid red; background-color:#FFFFFF;'>"); // div의 크기 = 실제 팝업창 html의 width값 + 11 * html의 height값 + 74

		top.document.writeln("<table style=\"table-layout:fixed\" cellpadding=0px cellspacing=0px width=\"361px\" height=\"374px\" style=\"overflow-x:hidden; border:0px solid red\" scrollbars=\"no\"><col width=\"5px\"/><col width=\"*\"/><col width=\"6px\"/><tr><td colspan=3>"); // table의 크기 = 위 div의 크기와 같음.

		//top.document.write("<table style=\"table-layout:fixed; overflow-x:hidden; border;0px solid red;\" width=\"100%\" cellpadding=0 cellspacing=0><col width=\"5\"/><col width=\"*\"/><col width=\"22\"/><tr><td><img src=\"/__exform_popup/IE_win_images/popup_top_left.gif\"></td><td background=\"/__exform_popup/IE_win_images/popup_top_bg.gif\"><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed; overflow-x:hidden; border:0px solid red\"><tr onMouseDown=\"MM_dragLayer('__exform_popup_layer_01','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,0,'',false,'')\"><td><nobr>&nbsp;<font color=\"#ffffff\">Chez Duvent</font></nobr></td></tr></table></td><td><img src=\"/__exform_popup/IE_win_images/popup_close.gif\" border=0 onClick='closeWinWithoutCookie(__exform_popup_layer_01)'></td></tr></table></td></tr><tr><td background=\"/__exform_popup/IE_win_images/popup_center_left.gif\" width=5></td><td width=\"350\" height=\"300\">"); // 요기의 마지막 width값 = 실제 팝업창 html의 width, height 값= html의 height값.
		top.document.write("<table style=\"table-layout:fixed; overflow-x:hidden; border;0px solid red;\" width=\"100%\" cellpadding=0 cellspacing=0><col width=\"5\"/><col width=\"*\"/><col width=\"22\"/><tr><td><img src=\"/__exform_popup/IE_win_images/popup_top_left.gif\"></td><td background=\"/__exform_popup/IE_win_images/popup_top_bg.gif\"><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed; overflow-x:hidden; border:0px solid red\"><tr><td><nobr>&nbsp;<font color=\"#ffffff\">Chez Duvent</font></nobr></td></tr></table></td><td><img src=\"/__exform_popup/IE_win_images/popup_close.gif\" border=0 onClick='closeWinWithoutCookie(__exform_popup_layer_01)'></td></tr></table></td></tr><tr><td background=\"/__exform_popup/IE_win_images/popup_center_left.gif\" width=5></td><td width=\"350\" height=\"300\">"); // 요기의 마지막 width값 = 실제 팝업창 html의 width, height 값= html의 height값.  //// 드래깅을 못하게 만듬(2009.12.22)

		//////// 내부에 들어갈 팝업 html을 부르는 부분 -- start //////////////////////////////////
		top.document.writeln("<iframe src='/__exform_popup/IE_popup_01.html' frameborder=no framepadding=0 framespacing=0 scrolling=no width=350 height=300 leftmargin=0 topmargin=0></iframe>"); // iframe의 width와 height값 = width값 = 실제 팝업창 html의 width, height 값= html의 height값.
		//////// 내부에 들어갈 팝업 html을 부르는 부분 -- end //////////////////////////////////

		top.document.writeln("</td><td background=\"/__exform_popup/IE_win_images/popup_center_right.gif\" width=6></td></tr><tr><td background=\"/__exform_popup/IE_win_images/popup_center_left.gif\" width=5></td><td height=\"25\" bgcolor=\"#7C7C7C\" align=\"right\">");

		top.document.writeln("<input type=\"checkbox\" onclick=\"javascript:closeWinWithCookie_01(__exform_popup_layer_01)\" style=\"margin-bottom:-1\"><a onclick=\"javascript:closeWinWithCookie_01(__exform_popup_layer_01)\" style=\"cursor:hand;\"><font color=\"#FFFFFF\" style=\"font-size:8pt\"> 오늘 이창을 다시 열지 않음</font></a>&nbsp;&nbsp;&nbsp;&nbsp;");

		top.document.writeln("</td><td background=\"/__exform_popup/IE_win_images/popup_center_right.gif\" width=6></td></tr><tr><td colspan=3><table border=0 cellpadding=0 cellspacing=0><tr><td><img src=\"/__exform_popup/IE_win_images/popup_down_left.gif\"></td><td background=\"/__exform_popup/IE_win_images/popup_down_bg.gif\" width=\"100%\"></td><td><img src=\"/__exform_popup/IE_win_images/popup_down_right.gif\"></td></tr></table></td></tr></table>");

		top.document.writeln("</div>");
	}
}

function openMsgBox_05() { //// 테두리가 없는 팝업창. .
	var eventCookie_05 = getCookie("duvent_layer_popup_05"); 

	if (eventCookie_05 != "not_today_05") {
		top.document.writeln("<div id='__exform_popup_layer_05' style='position:absolute; left:100px; top:100px; width:429px; height:616px; visibility:visible; z-index:9999; overflow:visible; border:0px solid red;'>"); //// 레이어의 width 값 : 내부에 들어갈 페이지의 width 값, 
		//// 레이어의 height 값 : 내부에 들어갈 페이지의 height 값 + 25px

		top.document.writeln("<div id=\"inner_top\" style=\"border:0px solid blue;\">");

		///////////////////////// 내부에 들어갈 페이지 부르는 부분 -- 시작 /////////////////////////////
		top.document.writeln("<iframe src='/__exform_popup/popup_05.html' frameborder=no framepadding=0 framespacing=0 scrolling=no width=429 height=616 leftmargin=0 topmargin=0></iframe>");
		///////////////////////// 내부에 들어갈 페이지 부르는 부분 -- 끝   /////////////////////////////
		
		top.document.writeln("</div>"); // end of inner_top

		top.document.writeln("<div id=\"inner_bottom\" style=\"border:0px solid red;  background-color:#7c7c7c; width:100%\">");
			top.document.writeln("<div id\"bottom_1\" style=\"float:left; border:0px solid green;\">");
				top.document.writeln("<input type=\"checkbox\" onclick=\"javascript:closeWinWithCookie_05(__exform_popup_layer_05)\" style=\"margin-bottom:-1\"><a onclick=\"javascript:closeWinWithCookie_05(__exform_popup_layer_05)\" style=\"cursor:hand;\"><font color=\"#FFFFFF\" style=\"font-size:8pt\"> 오늘 이창을 다시 열지 않음</font></a>");
			top.document.writeln("</div>"); // end of bottom_1
			top.document.writeln("<div id=\"bottom_2\" style=\"float:right; border:0px solid blue;\">");
				top.document.writeln("<img src=\"/__exform_popup/IE_win_images/bt_close2.gif\" border=0 onClick='closeWinWithoutCookie(__exform_popup_layer_05)' style=\"margin:4 4 0 0; cursor:hand;\">");
			top.document.writeln("</div>");  // end of bottom_2
		top.document.writeln("</div>"); // end of inner_bottom

		top.document.writeln("</div>"); // end of popup layer
	}
	
}


function openMsgBox_06() { //// 테두리가 없는 팝업창. .
	var eventCookie_06 = getCookie("duvent_layer_popup_06"); 

	if (eventCookie_06 != "not_today_06") {
		top.document.writeln("<div id='__exform_popup_layer_06' style='position:absolute; left:530px; top:100px; width:500px; height:420px; visibility:visible; z-index:9999; overflow:visible; border:0px solid red;'>"); //// 레이어의 width 값 : 내부에 들어갈 페이지의 width 값, 
		//// 레이어의 height 값 : 내부에 들어갈 페이지의 height 값 + 25px

		top.document.writeln("<div id=\"inner_top\" style=\"border:0px solid blue;\">");

		///////////////////////// 내부에 들어갈 페이지 부르는 부분 -- 시작 /////////////////////////////
		top.document.writeln("<iframe src='/__exform_popup/popup_06.html' frameborder=no framepadding=0 framespacing=0 scrolling=no width=500 height=420 leftmargin=0 topmargin=0></iframe>");
		///////////////////////// 내부에 들어갈 페이지 부르는 부분 -- 끝   /////////////////////////////
		
		top.document.writeln("</div>"); // end of inner_top

		top.document.writeln("<div id=\"inner_bottom\" style=\"border:0px solid red;  background-color:#649216; width:100%\">");
			top.document.writeln("<div id\"bottom_1\" style=\"float:left; border:0px solid green;\">");
				top.document.writeln("<input type=\"checkbox\" onclick=\"javascript:closeWinWithCookie_06(__exform_popup_layer_06)\" style=\"margin-bottom:-1\"><a onclick=\"javascript:closeWinWithCookie_06(__exform_popup_layer_06)\" style=\"cursor:hand;\"><font color=\"#FFFFFF\" style=\"font-size:8pt\"> 오늘 이창을 다시 열지 않음</font></a>");
			top.document.writeln("</div>"); // end of bottom_1
			top.document.writeln("<div id=\"bottom_2\" style=\"float:right; border:0px solid blue;\">");
				top.document.writeln("<img src=\"/__exform_popup/IE_win_images/bt_close2.gif\" border=0 onClick='closeWinWithoutCookie(__exform_popup_layer_06)' style=\"margin:4 4 0 0; cursor:hand;\">");
			top.document.writeln("</div>");  // end of bottom_2
		top.document.writeln("</div>"); // end of inner_bottom

		top.document.writeln("</div>"); // end of popup layer
	}
	
}

openMsgBox_01();		// 드래그 기능 있는 Internet Explorer 창 흉내내기
//openMsgBox_05();		// 드래그 기능 없고 테두리 없는 레이어 팝업
//openMsgBox_06();
