/////////////////////////////////////////////////////// ·¹ÀÌ¾îÆË¾÷ »ý¼º ///////////////////////////////////////////////////
function OnLayPopupClose(oname)
{
	document.getElementById(oname).style.display = 'none';
}

function OnLayPopupSetCookie(cookiename)
{
	var expdate = new Date();
	expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 1); // 1 ÀÏ

	setCookie(cookiename, '1', expdate);

	OnLayPopupClose('Layer'+cookiename);
}

function getCookie(name)
{
	var Found = false
	var start, end
	var i = 0
	while(i <= document.cookie.length) {
	start = i
	end = start + name.length
	if(document.cookie.substring(start,end) == name)
	{
		Found = true
		break
	}
		i++
	}
	if(Found == true)
	{
		start = end + 1
		end = document.cookie.indexOf(';',start)
		if(end<start)
		end = document.cookie.length
		return document.cookie.substring(start,end)
	}
	return ''
}

function setCookie (name, value, expires)
{
	document.cookie = name + "=" + escape (value) + "; path=/; expires=" + expires.toGMTString();
}

function OnLayPopupCreate(imgUrl, path, cookieName, Left, Top, Width, Height, usemap)
{
	var html = "";	

	var bMap = usemap == null?false:true;

	html += "<div id='Layer"+cookieName+"' style='position:absolute; left:" + Left + "px; top:" + Top + "px; width:300px; z-index:100;'>";
	html += "<table border=0 cellpadding=0 cellspacing=0 id='event_new'>";
	html += "<tr>";
	html += "<td width='" + (Width/1 + 10) + "' background='http://image.joinsland.com/index2006/common/pop_bg_top_middle.gif'><table border=0 cellpadding=0 cellspacing=0><tr><td width='" + (Width/1 + 10) + "'>";
	html += "<img src='http://image.joinsland.com/index2006/common/pop_bg_top_left.gif'   border='0'></td><td align='right'><img src='http://image.joinsland.com/index2006/common/pop_bg_top_right.gif'   border='0' usemap='#Map_"+cookieName+"_top'></td></tr></table></td>";
	html += "</tr>";
	html += "<tr>";
	html += "<td height='"+Height+"'><table border=0 cellpadding=0 cellspacing=0><tr><td background='http://image.joinsland.com/index2006/common/pop_bg_middle_left.gif' width=5></td>";
if (bMap){
	html+= "<td><img src='" + imgUrl + "' width='"+Width+"' height='"+Height+"' border='0' usemap='#Map_"+cookieName+"_popcontent'/></td>";
}else{
	html+= "<td><a href='" + path + "'><img src='" + imgUrl + "' width='"+Width+"' height='"+Height+"' border='0' /></a></td>";
}
	html+= "<td background='http://image.joinsland.com/index2006/common/pop_bg_middle_right.gif' width=5></td></tr></table></td>";
	html += "<td align='center' style='background-color:#4aa1bd;'></td>";
	html += "</tr>";
	html += "<tr>";
	html += "<td width='" + (Width/1 + 10) + "' background='http://image.joinsland.com/index2006/common/pop_bg_bottom_middle.gif'><table border=0 cellpadding=0 cellspacing=0><tr><td width='" + (Width/1 + 10) + "'>";
	html += "<a href=\"javascript:OnLayPopupSetCookie('"+cookieName+"');\"><img src='http://image.joinsland.com/index2006/common/pop_bg_bottom_left.gif'   border='0'></a></td><td align='right'><img src='http://image.joinsland.com/index2006/common/pop_bg_bottom_right.gif'   border='0' usemap='#Map_"+cookieName+"_right'></td></tr></table></td>";

	html += "</tr>";
	html += "</table>";

	html += "<map name='Map_"+cookieName+"_top'>";
	html += "<area shape='rect' coords='3,5,21,22' href=\"javascript:OnLayPopupClose('Layer"+cookieName+"');\">";
	html += "</map>";

	html += "<map name='Map_"+cookieName+"'_today' >";
	html += "<area shape='rect' coords='4,6,129,25' href=\"javascript:OnLayPopupSetCookie('"+cookieName+"');\">";
	html += "</map>";

	html += "<map name='Map_"+cookieName+"_right'>";
	html += "<area shape='rect' coords='3,6,50,21' href=\"javascript:OnLayPopupClose('Layer"+cookieName+"');\">";
	html += "</map>";

if (bMap){
	html += "<map name='Map_"+cookieName+"_popcontent'>";
	html += usemap
	html += "</map>";
}
	html += "</div> ";

	if (getCookie(cookieName) == "") document.write (html);
}

function OnUrlPop(url){
	var userwidth = (screen.width);
	var userheight = (screen.height);
	window.open(url,"pop_fullwin",'scrollbars=yes,toolbar=yes,location=yes,status=yes, menubar=yes,resizable=yes,width='+userwidth+',height='+userheight+',left=0,top=0');
} 


function OnPlayFlash(src, width, height){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">')
document.write('<param name="movie" value="'+src+'">')
document.write('<param name="quality" value="high">')
document.write('<embed src="'+src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed></object>')
}