//¸ÞÀÎ
function menu0()
{
	document.location.href="./";
}
//¿øÅÍÄ¡ Ã£¾Æ¶ó (°ÔÀÓ)
function menu1()
{
	document.location.href="./sub4.htm";
}
//½Ã½Ä ÈÄ±â ½ÃÁð2
function menu2()
{
	document.location.href="./sub5.htm";
}
// ¿øÅÍÄ¡ ½ºÅä¸®
function menu3()
{
	//document.location.href="./sub3.htm";
	makePage("story.swf", 840, 460);
}
//¿øÅÍÄ¡ Å¸ÀÓ
function menu4()
{
	document.location.href="./sub1.htm";
}
//°í°´¹®ÀÇ
function menu5()
{
	makePage("qna.swf", 840, 460);
	makeIFRAME("./board_qna/list.html", 686, 350);
}
//ÀÌ¿ë¾È³»
function menu6()
{
	makePage("guide.swf", 840, 443);
}

//=== ¿øÅÍÄ¡ ¿ä¸®±³½Ç.
function menu10()
{
	//makePage("board_afternote.swf", 975, 645);
	//makeIFRAME2("./board_afternote/list.html", 915, 500);
	document.location.href="./sub2.htm";
}

function gamego0()
{
	window.open('pop5.htm', 'sp', 'width=540,height=600');
}
function gamego1()
{
	document.location.href="/sub5.htm";
}
function gamego2()
{
	document.location.href="/sub2.htm";
}
function gamego3()
{
	document.location.href="/sub1.htm";
}

//°³ÀÎÁ¤º¸Á¤Ã¥
function policy()
{
	makePage("policy.swf", 840, 443);
}
//ÀÌ¿ë¾à°ü
function stipulation()
{
	makePage("stipulation.swf", 840, 447);
}
//¸ðµç,,
function sub(swf,width,height)
{
	makePage(swf, width, height);
}

function moveMystart(SID)
{
	var left_pos = (document.body.clientWidth-900) / 2;
	var top_pos = (document.body.clientHeight-610) / 2 + 50;
	window.open('http://www.one-touch.co.kr/star/face.htm?SId='+SID,'','height=610,width=900,left='+left_pos+', top='+top_pos+', scrollbars=no,resizable=no,status=0');
}
//=== À¥ ºê¶ó¿ìÁ® ¹öÀü.
function getBrowser()
{
	var browserName = null;
	var userAgent = self.navigator.userAgent.split(";");
	var re = /MSIE\s([\d\.]+)/gi;
	var result = re.exec(userAgent[1]);
	if( (result != null) && (result.length == 2) )
	{
		browserName = "MSIE";
	}else
	{
		re = /rv\:([\d\.\w]+)\)\sGecko/gi;
		result = re.exec(userAgent[4]);
		if( (result != null) && (result.length == 2) )
		{
			browserName = "Mozilla";
		}
	}
	return browserName;
}

//=== ·¹ÀÌ¾î Ãß°¡
function makePage(swfLink, w, h)
{
	makeforeGround(makeBackGround(), swfLink, w, h);
}

//=== ·¹ÀÌ¾î »èÁ¦
function deletePage()
{
	delEvent();
	document.body.removeChild(document.getElementById('foreDIVid'));
	document.body.removeChild(document.getElementById('backDIVid'));
}

//=== ¹é±×¶ó¿îµå ·¹ÀÌ¾î »ý¼º
function makeBackGround()
{
	if(getBrowser() == "Mozilla")
	{
		var opa = "opacity:0.4;";
	}else
	{
		var opa = "filter:alpha(opacity=65);";
	}
	var backDIV = document.createElement('DIV');
	backDIV.id = "backDIVid";
	backDIV.style.cssText = "position:absolute; top:0px; left:0px; width:"+document.body.scrollWidth+"; height:"+document.body.scrollHeight+" ; background:#000000; "+ opa +" z-index:5000;";
	document.body.appendChild(backDIV);

	if(getBrowser() == "MSIE")
	{
		attachEvent("onresize",divResize);
	}

	return backDIV;
}

//=== ¹é±×¶ó¿îµå À§¿¡ ·¹ÀÌ¾î »ý¼º. ÇÃ·¡½Ã Ãß°¡
function makeforeGround(objBack, swfLink, w, h)
{
	foreBack = document.createElement('DIV');
	foreBack.id = "foreDIVid";
	var ibtop = ( document.body.scrollTop + (document.body.clientHeight / 2) ) - ( h / 2 ) + "px";
	var ibleft = ( document.body.scrollLeft + (document.body.clientWidth / 2) ) - ( w / 2 ) + "px";

	foreBack.style.cssText = "position:absolute; z-index:5001;  top:"+ibtop+"; left:"+ibleft+"; width:"+w+"; height:"+h+";";

	var inHTML = "";
	inHTML += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+w+"' height='"+h+"' align='middle'>";
	inHTML += "<param name='allowScriptAccess' value='sameDomain' />";
	inHTML += "<param name='allowFullScreen' value='false' />";
	inHTML += "<param name='movie' value='./flash/"+swfLink+"' />";
	inHTML += "<param name='quality' value='high' />";
	inHTML += "<param name='menu' value='false' />";
	inHTML += "<param name='wmode' value='transparent' />";
	inHTML += "<embed src='./flash/"+swfLink+"' quality='high' wmode='transparent' width='"+w+"' height='"+h+"' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	inHTML += "</object>";

	foreBack.innerHTML = inHTML;
	document.body.appendChild(foreBack);

	if(getBrowser() == "MSIE")
	{
		attachEvent("onscroll",divMove);
	}
}

//=== ÇÃ·¡½ÃÀ§¿¡ IFRAMEÃß°¡, ÆäÀÌÁö ¸µÅ©
function makeIFRAME(fLink, w, h)
{
	iframeDIV = document.createElement('DIV');
	iframeDIV.style.cssText = "position:absolute; top:58px; left:77px; width:"+w+"px; height:"+h+"px;";
	try
	{
		inIFRAME = document.createElement("<IFRAME frameborder=0 scrolling=no>");
	}catch(E)
	{
		inIFRAME = document.createElement("IFRAME");
		inIFRAME.setAttribute("frameborder","0");
		inIFRAME.setAttribute("scrolling","no");
	}
	inIFRAME.style.width = w + "px";
	inIFRAME.style.height = h + "px";
	inIFRAME.src = fLink;
	document.getElementById('foreDIVid').appendChild(iframeDIV);
	iframeDIV.appendChild(inIFRAME);
}
//=== ÇÃ·¡½ÃÀ§¿¡ IFRAMEÃß°¡, ÆäÀÌÁö ¸µÅ©
function makeIFRAME2(fLink, w, h)
{
	iframeDIV = document.createElement('DIV');
	iframeDIV.style.cssText = "position:absolute; top:120px; left:33px; width:"+w+"px; height:"+h+"px;";
	try
	{
		inIFRAME = document.createElement("<IFRAME frameborder=0 scrolling=yes>");
	}catch(E)
	{
		inIFRAME = document.createElement("IFRAME");
		inIFRAME.setAttribute("frameborder","0");
		inIFRAME.setAttribute("scrolling","yes");
	}
	inIFRAME.style.width = w + "px";
	inIFRAME.style.height = h + "px";
	inIFRAME.src = fLink;
	document.getElementById('foreDIVid').appendChild(iframeDIV);
	iframeDIV.appendChild(inIFRAME);
}

//=== ÇÃ·¡½ÃÀ§¿¡ IFRAMEÃß°¡, ÆäÀÌÁö ¸µÅ©
function makeIFRAME3(fLink, w, h)
{
	iframeDIV = document.createElement('DIV');
	iframeDIV.style.cssText = "position:absolute; top:120px; left:33px; width:"+w+"px; height:"+h+"px;";
	try
	{
		inIFRAME = document.createElement("<IFRAME frameborder=0 scrolling=yes>");
	}catch(E)
	{
		inIFRAME = document.createElement("IFRAME");
		inIFRAME.setAttribute("frameborder","0");
		inIFRAME.setAttribute("scrolling","yes");
	}
	inIFRAME.style.width = w + "px";
	inIFRAME.style.height = h + "px";
	inIFRAME.src = fLink;
	document.getElementById('foreDIVid').appendChild(iframeDIV);
	iframeDIV.appendChild(inIFRAME);
}

function delEvent(handler)
{
	if(getBrowser() == "MSIE")
	{
		detachEvent("onresize",divResize);
		detachEvent("onscroll",divMove);
	}
}
function divResize(){
	document.getElementById("backDIVid").style.width=document.body.scrollWidth;
	document.getElementById("backDIVid").style.height=document.body.scrollHeight;
	divMove();
}
function divMove(){
	document.getElementById("foreDIVid").style.top = ( document.body.scrollTop + (document.body.clientHeight / 2) ) - ( document.getElementById("foreDIVid").offsetHeight / 2 ) + "px";
	document.getElementById("foreDIVid").style.left = ( document.body.scrollLeft + (document.body.clientWidth / 2) ) - ( document.getElementById("foreDIVid").offsetWidth / 2 ) + "px";
}