
var staticpLeft;

function callPopup()
{
	var now = new Date();
	var Year = now.getYear();
	var Month = now.getMonth()+1;
	var Day = now.getDate();
	var Hour = now.getHours();
	
//	div_popup1("mainpop1", "/mainpopup/mainpopup_20111230.asp", "400", "390"); // (ÆË¾÷Ã¢¾ÆÀÌµð, ¶ç¿ï ÆÄÀÏ, °¡·Î, ¼¼·Î)
//	div_popup2("mainpop2", "/mainpopup/mainpopup_20110621.asp", "400", "357"); // (ÆË¾÷Ã¢¾ÆÀÌµð, ¶ç¿ï ÆÄÀÏ, °¡·Î, ¼¼·Î)
}

function callPopupSub()
{
	var now = new Date();
	var Year = now.getYear();
	var Month = now.getMonth()+1;
	var Day = now.getDate();
	var Hour = now.getHours();
	
//	div_popup2("mainpop1", "/mainpopup/mainpopup_20111230.asp", "400", "390"); // (ÆË¾÷Ã¢¾ÆÀÌµð, ¶ç¿ï ÆÄÀÏ, °¡·Î, ¼¼·Î)
}

function div_popup1(pID, pPopSrc, pWidth, pHeight)
{
	if(cookieVal(pID) != "1")
	{
		var pTop = 100; // ÆË¾÷ À§Ä¡
		var pLeft = (screen.availWidth - pWidth)/2;
		staticpLeft = pLeft;

		strPopupScript = "<div id='" + pID + "' onclick='javascript:alert(\"d\")' style='border-width:0px;POSITION: absolute;TOP: " + pTop + "px; LEFT: " + pLeft + "px;z-index:199'>\
				<IFRAME src='" + pPopSrc + "' frameBorder=2 scrolling=no width=" + pWidth + " height=" + pHeight + "></IFRAME>\
		</div>";
		if ( getCookie( pID ) != "done" )
			document.writeln(strPopupScript); 
	}
}

function div_popup2(pID, pPopSrc, pWidth, pHeight)
	{
		if(cookieVal(pID) != "1")
		{
			var pTop = 100; // ÆË¾÷ À§Ä¡
			var pLeft = (screen.availWidth - pWidth) / 1.3; 

			strPopupScript = "<div id='" + pID + "' onclick='javascript:alert(\"d\")' style='border-width:0px;POSITION: absolute;TOP: " + pTop + "px; LEFT: " + pLeft + "px;z-index:199'>\
					<IFRAME src='" + pPopSrc + "' frameBorder=2 scrolling=no width=" + pWidth + " height=" + pHeight + "></IFRAME>\
			</div>";
			if ( getCookie( pID ) != "done" ) 
				document.writeln(strPopupScript); 
		}
	}
	
	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 cookieVal(cookieName){
		thisCookie = document.cookie.split("; ");
		for(i=0; i<thisCookie.length; i++){
				if(cookieName == thisCookie[i].split("=")[0]){
						return thisCookie[i].split("=")[1];
				}
		}
		return "x";
	}
	
	function window_close(iDiv) {	
		document.all[iDiv].style.display="none";
	}
