function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

/*ÄÜÅÙÃ÷ ¿µ¿ª Æ÷Áö¼Ç********************************************/
function contentP () {

	var cleft = 321+5;//center¿Í ÄÜÅÙÃ÷ left »çÀÌ °£°Ý
	var ctop = 142;//top¿¡¼­ ÄÜÅÙÃ÷±îÁö ¶³¾îÁø °£°Ý, °íÁ¤
	var cw = screen.width / 2 - cleft;
	var ch = ctop;

	document.getElementById('contents').style.top = ch;
	document.getElementById('contents').style.left = cw;

}

/*ÇÃ·¡½Ã ·¹ÀÌ¾Æ¿ô Ãâ·Â**********************************************/
function swfLayout(url){
	document.write("<div id='flashLayout'><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='100%' height='100%' id='flay' align='middle'>");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
	document.write("<param name='menu' value='false'>");
	document.write("<param name='movie' value='" + url + "' />");
	document.write("<param name='quality' value='high' />");
	document.write("<param name='wmode' value='transparent' />");
	document.write("<embed src='" + url + "' quality='high' menu='false' wmode='transparent' width='100%' height='100%' name='flay' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object></div>");
}

/*ÀÏ¹Ý ÇÃ·¡½Ã ***********************************************/
function swfIntro(url,w,h){

	document.write("<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='rollingPhoto' align='middle' VIEWASTEXT>");
	document.write("<param name='movie' value='"+ url +"'>");
	document.write("<param name='menu' value='false'>");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='bgcolor' value='#ffffff'>");
	document.write("<param name=wmode value=transparent>");
	document.write("<embed src='"+ url +"' menu='false'  quality='high' bgcolor='#ffffff' width='"+ w +"' height='"+ h +"' name='rollingPhoto' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");

}

/*ÀÏ¹Ý ÇÃ·¡½Ã ***********************************************/
function swf(url,w,h){

	document.write("<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='rollingPhoto' align='middle' VIEWASTEXT>");
	document.write("<param name='movie' value='"+ url +"'>");
	document.write("<param name='menu' value='false'>");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='bgcolor' value='#ffffff'>");
	//document.write("<param name=wmode value=transparent>");
	document.write("<embed src='"+ url +"' menu='false'  quality='high' bgcolor='#ffffff' width='"+ w +"' height='"+ h +"' name='rollingPhoto' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");

}

/* VOD ½ÇÇà Ã¢ ***********************************************/
function vod( url, w, h, vodtype ) {

	var vodurl = "../lib/vod/" + url;

	if (vodtype == "wmv")
	{
		var h2 = h + 45;
		var winObject = window.open ( "../lib/vod/popup.html" , "vodpop" , "toolbar=0,directories=0,status=no,menubar=0,scrollbars=no,resizable=no,width=" + w + ",height=" + h2 + ",left=0,top=0" );

		winObject.document.write("<html>\n");
		winObject.document.write("<head>\n");
		winObject.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=euc-kr\">\n");
		winObject.document.write("<title>¸ùÅ°¹ë¸®</title>\n");
		winObject.document.write("</head>\n");
		winObject.document.write("<body style=\"margin:0;padding:0;\">\n");
		winObject.document.write("<div id=\"player\"><embed src=\"" + vodurl +"\" width=\"" + w + "\" height=\"" + h2 + "\" autostart=\"true\" loop=\"true\" showstatusbar=\"false\" showcontrols=\"true\"></div>");
		winObject.document.write("</body>\n");
		winObject.document.write("</html>\n");
	}

	if (vodtype == "mov")
	{
		
		var winObject = window.open ( "../lib/vod/popup.html" , "vodpop" , "toolbar=0,directories=0,status=no,menubar=0,scrollbars=no,resizable=no,width=" + w + ",height=" + h + ",left=0,top=0" );

		winObject.document.write("<html>\n");
		winObject.document.write("<head>\n");
		winObject.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=euc-kr\">\n");
		winObject.document.write("<title>¸ùÅ°¹ë¸®</title>\n");
		winObject.document.write("</head>\n");
		winObject.document.write("<body style=\"margin:0;padding:0;\">\n");
		winObject.document.write("<div id=\"player\"><embed src=\"" + vodurl +"\" width=\"" + w + "\" height=\"" + h + "\" autostart=\"true\" loop=\"false\" showstatusbar=\"true\" showcontrols=\"true\"></div>");
		winObject.document.write("</body>\n");
		winObject.document.write("</html>\n");
	}

	if (vodtype == "wma")
	{
		var h2 = h + 45;
		var winObject = window.open ( "../lib/vod/popup.html" , "vodpop" , "toolbar=0,directories=0,status=no,menubar=0,scrollbars=no,resizable=no,width=" + w + ",height=" + h2 + ",left=0,top=0" );

		winObject.document.write("<html>\n");
		winObject.document.write("<head>\n");
		winObject.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=euc-kr\">\n");
		winObject.document.write("<title>¸ùÅ°¹ë¸®</title>\n");
		winObject.document.write("</head>\n");
		winObject.document.write("<body style=\"margin:0;padding:0;\">\n");
		winObject.document.write("<div id=\"player\"><embed src=\"" + vodurl +"\" width=\"" + w + "\" height=\"" + h2 + "\" autostart=\"true\" loop=\"true\" showstatusbar=\"false\" showcontrols=\"true\"></div>");
		winObject.document.write("</body>\n");
		winObject.document.write("</html>\n");
	}

}


/*ÆäÀÌÁö ¼ÂÆÃ*************************************************/
function setPage(pcode){
	
	var url1 = "../lib/flash/sub.swf?"//ÇÃ·¡½Ã ÆÄÀÏ °æ·Î

	switch (pcode) {

		//M1 ¸ùÅ°¹ë¸® - ¸ùÅ°¹ë¸® ÀÌ¾ß±â 
		case "m1_monstory":
		swfLayout( url1 + "a=1&b=1" );
		break;

		//M1 ¸ùÅ°¹ë¸® - »ý»ýÃ¼Çè ¸ùÅ°¹ë¸®
		case "m1_valleymap":
		swfLayout( url1 + "a=1&b=2" );
		break;

		case "m1_mvalleyexp":
		swfLayout( url1 + "a=1&b=2" );
		break;

		case "m1_chimbubble":
		swfLayout( url1 + "a=1&b=2" );
		pimgid = "simg1"; //±âº» ¼±ÅÃÀÌ¹ÌÁö
		pfname = "ch_img_thumb0";
		pidnum = "1";
		break;

		case "m1_otower":
		swfLayout( url1 + "a=1&b=2" );
		pimgid = "simg1"; //±âº» ¼±ÅÃÀÌ¹ÌÁö
		pfname = "ot_img_thumb0";
		pidnum = "1";
		break;

		case "m1_skywark":
		swfLayout( url1 + "a=1&b=2" );
		pimgid = "simg1"; //±âº» ¼±ÅÃÀÌ¹ÌÁö
		pfname = "sk_img_thumb0";
		pidnum = "1";
		break;

		case "m1_expmonval":
		swfLayout( url1 + "a=1&b=2" );
		pimgid = "simg1"; //±âº» ¼±ÅÃÀÌ¹ÌÁö
		pfname = "ex_img_thumb0";
		pidnum = "1";
		break;

		//M1 ¸ùÅ°¹ë¸® - ¸ùÅ°¹ë¸® ¿À´Â ±æ
		case "m1_monroad":
		swfLayout( url1 + "a=1&b=3" );
		break;

		//M2 »ý»ýÇÑ ¸ùÅ°¹ë¸®Å½Çè - ¸ùÅ°¹ë¸® Ä£±¸µé
		case "m2_monfriend"://¸ÞÀÎ
		swfLayout( url1 + "a=2&b=1" );
		mappnum = 9;
		break;

		case "m2_chimpanzee":
		swfLayout( url1 + "a=2&b=1" );
		break;

		case "m2_goldenmon":
		swfLayout( url1 + "a=2&b=1" );
		break;

		case "m2_orangutan":
		swfLayout( url1 + "a=2&b=1" );
		break;

		case "m2_squirrelmon":
		swfLayout( url1 + "a=2&b=1" );
		break;

		case "m2_japanesemon":
		swfLayout( url1 + "a=2&b=1" );
		break;

		case "m2_ringtailed":
		swfLayout( url1 + "a=2&b=1" );
		break;

		case "m2_baboon":
		swfLayout( url1 + "a=2&b=1" );
		break;

		case "m2_whitehanded":
		swfLayout( url1 + "a=2&b=1" );
		break;

		case "m2_mandrill":
		swfLayout( url1 + "a=2&b=1" );
		break;

		//M2 »ý»ýÇÑ ¸ùÅ°¹ë¸®Å½Çè - ¸ùÅ°¹ë¸® ½ºÅ¸
		case "m2_valleystar"://¸ÞÀÎ
		swfLayout( url1 + "a=2&b=2" );
		break;

		case "m2_rudy":
		swfLayout( url1 + "a=2&b=2" );
		break;

		case "m2_goldimong":
		swfLayout( url1 + "a=2&b=2" );
		break;

		case "m2_wonho":
		swfLayout( url1 + "a=2&b=2" );
		break;

		case "m2_ali":
		swfLayout( url1 + "a=2&b=2" );
		break;


		//M2 »ý»ýÇÑ ¸ùÅ°¹ë¸®Å½Çè - ÇÔ²¾ÇÏ´Â ¸ùÅ°¹ë¸® Å½Çè
		case "m2_monvalleyexp": //¸ÞÀÎ
		swfLayout( url1 + "a=2&b=3" );
		mappnum = 6;
		break;

		case "m2_jennyguide":
		swfLayout( url1 + "a=2&b=3" );
		break;

		case "m2_monkingdom":
		swfLayout( url1 + "a=2&b=3" );
		break;

		case "m2_miniconcert":
		swfLayout( url1 + "a=2&b=3" );
		break;

		case "m2_rudypt":
		swfLayout( url1 + "a=2&b=3" );
		break;

		case "m2_sonokong":
		swfLayout( url1 + "a=2&b=3" );
		break;

		case "m2_police":
		swfLayout( url1 + "a=2&b=3" );
		break;

		case "m2_skywalk":
		swfLayout( url1 + "a=2&b=3" );
		break;

		//M3 Àç¹ÌÀÖ´Â ¸ùÅ°¹ë¸® ±³½Ç - Àç¹ÌÀÖ´Â ¿ø¼þÀÌÀÌ¾ß±â
		case "m3_chimstory":
		swfLayout( url1 + "a=3&b=1" );
		break;

		case "m3_goldenmonstory":
		swfLayout( url1 + "a=3&b=1" );
		break;

		case "m3_orangstory":
		swfLayout( url1 + "a=3&b=1" );
		break;

		case "m3_squirrelmonstory":
		swfLayout( url1 + "a=3&b=1" );
		break;

		case "m3_japanesemonstory":
		swfLayout( url1 + "a=3&b=1" );
		break;

		case "m3_ringtailedstory":
		swfLayout( url1 + "a=3&b=1" );
		break;

		case "m3_whitehanded":
		swfLayout( url1 + "a=3&b=1" );
		break;

		case "m3_mandrill":
		swfLayout( url1 + "a=3&b=1" );
		break;

		case "m3_baboon":
		swfLayout( url1 + "a=3&b=1" );
		break;

		//M3 Àç¹ÌÀÖ´Â ¸ùÅ°¹ë¸® ±³½Ç - ¿ø¼þÀÌ¿¡ ´ëÇÑ ¿ÀÇØ¿Í Áø½Ç
		case "m3_misntrue":
		swfLayout( url1 + "a=3&b=1" );
		break;

		//M3 Àç¹ÌÀÖ´Â ¸ùÅ°¹ë¸® ±³½Ç - ¿ø¼þÀÌ µ¿¿µ»ó ¸ðÀ½
		case "m3_monmovie":
		swfLayout( url1 + "a=3&b=1" );
		break;

		//M3 Àç¹ÌÀÖ´Â ¸ùÅ°¹ë¸® ±³½Ç - Ä§ÆÒÁö¾î ¹è¿ì±â ±³½Ç
		case "m3_learnchim":
		swfLayout( url1 + "a=3&b=2" );
		break;

		//M3 Àç¹ÌÀÖ´Â ¸ùÅ°¹ë¸® ±³½Ç - ÇÔ²² ¹è¿ö¿ä ¸ùÅ°´í½º
		case "m3_mondance":
		swfLayout( url1 + "a=3&b=2" );
		break;

		//M4 ÀÌº¥Æ®
		case "m4_oxquiz":
		swfLayout( url1 + "a=4&b=1" );
		break;

		case "m4_relay":
		swfLayout( url1 + "a=4&b=2" );
		break;

		case "m4_welmonkey":
		swfLayout( url1 + "a=4&b=3" );
		break;
	} 
}

/*M1 »ý»ýÃ¼Çè ¸ùÅ°¹ë¸® - ½æ³×ÀÏ ÀÌ¹ÌÁö ±³Ã¼ ************************/

function swapImg( fname,idnum,fol ){

	var simgurl = "../img/expmonvalley/" + fname + idnum + "_on.jpg"; //¼±ÅÃÇÑ ÀÌ¹ÌÁö °æ·Î
	var limgurl = "../img/expmonvalley/" + fname + idnum + "_l.jpg"; //¼±ÅÃÇÑ ÀÌ¹ÌÁöÀÇ È®´ë »çÁø °æ·Î 
	var nimgid = "simg"+idnum; //¼±ÅÃÇÑ ÀÌ¹ÌÁö ¾ÆÀÌµð
	var pimgurl = "../img/expmonvalley/" + pfname + pidnum + "_off.jpg"; //¼±ÅÃµÇ¾îÀÖ´Â ½æ³×ÀÏ ÀÌ¹ÌÁö ±³Ã¼

	if (pidnum != idnum)
	{
	document.getElementById(nimgid).src = simgurl;
	document.getElementById("limg").src = limgurl;
	document.getElementById(pimgid).src = pimgurl; 
	}

	pimgid = "simg"+idnum; //¼±ÅÃÇÑ ÀÌ¹ÌÁö id ÀúÀå
	pfname = fname;
	pidnum = idnum;
}
/*M2 ÇÔ²²ÇÏ´Â ¸ùÅ°¹ë¸® Å½Çè - ½æ³×ÀÏ ÀÌ¹ÌÁö È®´ë »çÁø ÆË¾÷***************/
function imgLargePop( url , name ){
	var imgurl = "../img/monvalleyexp/" + url;
	var winObject = window.open ( "popup.html" , "imgpop" , "toolbar=0,directories=0,status=no,menubar=0,scrollbars=auto,resizable=no,height=487,width=440,left=0,top=0" );

	winObject.document.write("<html>\n");
	winObject.document.write("<head>\n");
	winObject.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=euc-kr\">\n");
	winObject.document.write("<title>¸ùÅ°¹ë¸®</title>\n");
	winObject.document.write("</head>\n");
	winObject.document.write("<body style=\"margin:0;padding:0;\">\n");
	winObject.document.write("<div style=\"width:440px;\">\n");
	winObject.document.write("<div style=\"margin:10px;\"><img src=\"../img/monvalleyexp/pop_ttl_monvalleyexp.gif\" alt=\"ÇÔ²²ÇÏ´Â ¸ùÅ°¹ë¸® Å½Çè\"></div>\n");
	winObject.document.write("<div style=\"margin-left:20px;\"><img src=\"" + imgurl + "\" alt=\"" + name + "\"></div>\n");
	winObject.document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:400px;margin:8px 0 0 20px;\">\n");
	winObject.document.write("<tr>\n");
	winObject.document.write("<td valign=\"top\" style=\"color:#888888;font-family:µ¸¿ò;font-size:12px;font-weight:bold;\"><img src=\"../img/monvalleyexp/pop_bul_arrow.gif\" align=\"absmiddle\" style=\"margin-right:5px;\">" + name + "</td>\n");
	winObject.document.write("<td align=\"right\" valign=\"middle\"><a href=\"#\" onClick=\"self.close();\"><img src=\"../img/monvalleyexp/pop_btn_close.gif\" alt=\"close\" border=\"0\" style=\"margin-top:2px;\"></a></td>\n");
	winObject.document.write("</tr>\n");
	winObject.document.write("</table>\n");
	winObject.document.write("</div>\n");
	winObject.document.write("</body>\n");
	winObject.document.write("</html>\n");
}


/*M2 ¸ùÅ°¹ë¸® Ä£±¸µé - ½æ³×ÀÏ ÀÌ¹ÌÁö ±³Ã¼ ************************/

function swapImg2( fname,idnum,fol ){

	var limgurl = "../img/" + fol + "/" + fname + idnum + "_l.jpg"; //¼±ÅÃÇÑ ÀÌ¹ÌÁöÀÇ È®´ë »çÁø °æ·Î 
	document.getElementById("limg").src = limgurl;

}

//*M2 °¢ ¸Þ´º ¸ÞÀÎÆäÀÌÁö ÀÓ½Ã °¡ÀÌµå *****************************/

function guideInit() {
	var idname;
	for ( i=1;i<mappnum+1;i++ ) //mappnumÀº Æ÷ÀÎÆ® °¹¼ö, setPage()ÇØ´ç ¸Þ´º¿¡¼­ ÁöÁ¤.
	{

	idname = "guide" + i;
	document.getElementById(idname).style.display = "none";

	}

}

function guideView(idnum,l,t) {

	var gid = "guide";
	/*
	var cleft = 326;//center¿Í ÄÜÅÙÃ÷ left »çÀÌ °£°Ý
	var ctop = 142;//top¿¡¼­ ÄÜÅÙÃ÷±îÁö ¶³¾îÁø °£°Ý, °íÁ¤
	var cw = screen.width / 2 - cleft; //ÄÜÅÙÃ÷ left
	var ch = ctop; //ÄÜÅÙÃ÷ top
	var gw = cw + l ;//Ç³¼±°¡ÀÌµå left 
	var gh = ch + t ; //Ç³¼±°¡ÀÌµå top 
	*/
	var gw = l;
	var gh = t;
	document.getElementById(gid).style.left = gw+"px";
	document.getElementById(gid).style.top = gh+"px";
	document.getElementById(gid+idnum).style.display = "";


	for ( i=1;i<mappnum+1;i++ ) //mappnumÀº Æ÷ÀÎÆ® °¹¼ö, setPage()ÇØ´ç ¸Þ´º¿¡¼­ ÁöÁ¤.
	{
		if ( i != idnum )
		{	
		document.getElementById(gid+i).style.display = "none";

		}
	}
	
}


/*M3 ¿ø¼þÀÌ¿¡ ´ëÇÑ ¿ÀÇØ¿Í Áø½Ç - qna º¸ÀÌ±â **********************/
function answerInit() {
	var idname;
	for ( i=1;i<11;i++ )
	{
	idname = "a_" + i;
	document.getElementById(idname).style.display = "none";

	}

}

function toggleQna(id) {
	
	var cid = document.getElementById(id);
	if ( cid.style.display == "none" )
	{
		cid.style.display = "";
	}
	else 
	{
		cid.style.display = "none";
	}
}

/* ÀÌ¹ÌÁö ·Ñ ¿À¹ö ************/
function imgOver(imgurl,imgid){

	document.getElementById(imgid).src = imgurl;
}

function imgOut(imgurl,imgid){

	document.getElementById(imgid).src = imgurl;
}


/*M3 ¿ø¼þÀÌ µ¿¿µ»ó ¸ðÀ½ ****************************************/

function viewMovie(){
	alert("¼­ºñ½º ÁØºñÁßÀÔ´Ï´Ù.");
}

/*M4 ÀÌº¥Æ® ·Î±×ÀÎ ÆË¾÷  ************************/
function popupLogin(){
	window.open('../login.jsp', 'lgoin', 'scrollbars=no , toolbar=no, location=no, directories=no,status=no,width=380,height=240,resizable=no,menubar=no,top=120,left=200');	
}


/*M4 ÀÌº¥Æ® µ¥ÀÌÅ¸ ÀÔ·Â  ************************/
function InsertData(gubun){
	location.href = "../inputData.jsp?gubun="+gubun+"&cmd=INS";
}

function winOPC(url,popname,w,h) {
	//window.open(url,"","width="+w+",height="+h+",left="+((screen.width/2)-200)+",top="+((screen.height/2)-200) + ")
	window.open( url, popname, "width="+w+",height="+h+",left="+((screen.width - w)/2)+",top="+((screen.height - h)/2) + ",resizable=0, scrollbars=0");
}

