// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå)
function flashWrite(url,w,h,id,bg,vars,win){
	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' wmode='transparent'></embed>"+
	"</object>";
	
	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}



// »õ·Î°íÄ§
document.onkeydown = function() { 
	if (event.keyCode == 116) { 
	event.keyCode = 505; 
	} 
	if (event.keyCode == 505) { 
		location.reload(); 
	return false; 
	} 
} 



/***********************************************
* IFrame SSI script II- ¨Ï Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

//¸Þ´º div ¸®»çÀÌÁî
function mnavResize(type){
	if(type==1) document.getElementById("MenuBox").style.height = 280;
	//else if(type==2) document.getElementById("menu").className = "mnavView2";
	//else if(type==3) document.getElementById("menu").className = "mnavView3";
	else document.getElementById("MenuBox").style.height = 250;
}

var Presee, Presee_popWidth, Presee_popHeight, Presee_popTop, Presee_popLeft, pageClientWidth, pageClientHeight
function eco()
{
    pageClientWidth  = document.body.clientWidth;
    pageClientHeight = document.body.clientHeight;

    Presee_popWidth  = 980;
    Presee_popHeight = 520;
    Presee_popTop    = (pageClientHeight-Presee_popHeight)/2;
    Presee_popLeft   = (pageClientWidth-Presee_popWidth)/2;

    if (Presee_popTop  < 0){Presee_popTop =0}
    if (Presee_popLeft < 0){Presee_popLeft=0}

    Presee = document.getElementById("Presee");
    Presee.style.top     = Presee_popTop + document.body.scrollTop;
    Presee.style.left    = Presee_popLeft;
  
	
	SLB_film.style.width = document.body.clientWidth; 
	SLB_film.style.height = document.body.clientHeight ;
	SLB_film.style.display = "block";
    Presee.style.display = "block";
	//document.getElementById("top_menu").style.display='none';
	//alert(document.body.clientWidth);
}

function clo()
{
    document.getElementById("Presee").style.display = "none";
	document.getElementById("SLB_film").style.display = "none";
	//document.getElementById("top_menu").style.display='';

    //var fnMedia = document.getElementById("MediaPlayer")
    //if (!!fnMedia)
        //fnMedia.style.display="block";
	
}

function setCookie(cookieName, cookieValue, expireDate)
{
	var today = new Date();
	today.setDate( today.getDate() + parseInt( expireDate ) );
	document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/; expires=" + today.toGMTString() + ";";
}

function deleteCookie( cookieName )
{
	var expireDate = new Date();
	expireDate.setDate( expireDate.getDate() - 1 );
	document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString() + "; path=/";
}

function getCookie(cookieName)
{
	var search = cookieName + "=";
	var cookie = document.cookie;
	if( cookie.length > 0 )
	{
		startIndex = cookie.indexOf( cookieName );
		if( startIndex != -1 )
		{
			startIndex += cookieName.length;
			endIndex = cookie.indexOf( ";", startIndex );
			if( endIndex == -1) endIndex = cookie.length;
				return unescape( cookie.substring( startIndex + 1, endIndex ) );
			}
			else
			{
				return false;
			}
		}
	else
	{
		return false;
	}
}

// ¹ÂÁ÷°ü·Ã ½ºÅ©¸³Æ®
if (getCookie("musicNum") == 1)
{
	parent.topFrame.document.getElementById("Music").Pause();
	//setCookie("musicNum", 0, 1);
	//musicNum = 0;
}
else
{
	parent.topFrame.document.getElementById("Music").Play();
	//setCookie("musicNum", 1, 1);
	//musicNum = 1;
}

function musicControl()
{
	if (getCookie("musicNum") == 1)
	{
		parent.topFrame.document.getElementById("Music").Play();
		setCookie("musicNum", 0, 1);
		//musicNum = 0;
	}
	else
	{
		parent.topFrame.document.getElementById("Music").Pause();
		setCookie("musicNum", 1, 1);
		//musicNum = 1;
	}
	
}


