//-----------------------------------------------------------------------------
// onfocus
//-----------------------------------------------------------------------------

function allblur() {
         for (i = 0; i < document.links.length; i++)
              document.links[i].onfocus = document.links[i].blur;
    }

function bluring(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
} 
document.onfocusin=bluring;


//-----------------------------------------------------------------------------
// MM_showHideLayers
//-----------------------------------------------------------------------------

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}

//-----------------------------------------------------------------------------
// after
//-----------------------------------------------------------------------------

function bt(id,after) 
{ 
eval(id+'.filters.blendTrans.stop();'); 
eval(id+'.filters.blendTrans.Apply();'); 
eval(id+'.src="'+after+'";'); 
eval(id+'.filters.blendTrans.Play();'); 
} 


//-----------------------------------------------------------------------------
// restore_img_src
//-----------------------------------------------------------------------------

function restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function preload_img()
{ 
  var img_list = preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length-1; i++) {
    document.preloadlist[top+i] = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}



//-----------------------------------------------------------------------------
// open_window
//-----------------------------------------------------------------------------

function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';

  menubar_str = menubar ? 'yes' : 'no';

  statusbar_str = statusbar ? 'yes' : 'no';

  scrollbar_str = scrollbar ? 'yes' : 'no';

  resizable_str = resizable ? 'yes' : 'no';



  cookie_str = document.cookie;
  cookie_str.toString();


  pos_start  = cookie_str.indexOf(name);

  pos_start  = cookie_str.indexOf('=', pos_start);

  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;

  cookie_val = cookie_str.substring(pos_start + 1, pos_end);



  if (cookie_val  == "done")

    return;



  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);

}

	function movesite(tmp){
		if(tmp.value.length > 7){
			window.open(tmp.value,'_site');
		}
	}


//-----------------------------------------------------------------------------
// ÇÏ´Ü ¼¿·ºÆ® ¸Þ´º ¹× ¸¶¿ì½º ¿À¸¥ÂÊ Å¬¸¯ Á¦¾î
//-----------------------------------------------------------------------------

var workWin;
var TempTranCode = '';
//var secuCtlCheck = false;
var secuCtlCheck = true;

function nomenu(){
	return false;
}
function hidestatus()
{
	window.status='';
	return true;
}
//document.oncontextmenu = nomenu;  //¿À¸¥ÂÊ¸¶¿ì½ºÅ¬¸¯
document.onmouseover=hidestatus;  //»óÅÂ¹ÙÁ¦¾î
document.onmouseout=hidestatus;   //»óÅÂ¹ÙÁ¦¾î

if(top.cibtop){
	if(top.cibtop.loginfo){
		if(top.cibtop.loginfo.length > 0){
			alert(top.cibtop.loginfo);
			top.cibtop.loginfo = "";
		}
	}
}

//ÀüÃ¼ÆäÀÌÁö Å¾ÀÇ select(combo)
function showcombo(what){
	if (what.style.display=='')
		what.style.display='none';

	else if (what.style.display=='none')
		what.style.display='';
}



//-----------------------------------------------------------------------------
// Å¾À¸·Î&½ºÅ©·Ñ´Ù¶ó ¿òÁ÷ÀÌ´Â ¹è³Ê
//-----------------------------------------------------------------------------

var stmnLEFT = 887			// ½ºÅ©·Ñ¸Þ´ºÀÇ ÁÂÃø À§Ä¡
var stmnGAP1 = 50;			// ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é
var stmnGAP2 = 50;			// ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 0À¸·Î ¼¼ÆÃ
var stmnBASE = 0;			// ½ºÅ©·Ñ¸Þ´º ÃÊ±â ½ÃÀÛÀ§Ä¡ (¾Æ¹«·¸°Ô³ª ÇØµµ »ó°üÀº ¾øÁö¸¸ stmnGAP1°ú ¾à°£ Â÷ÀÌ¸¦ ÁÖ´Â°Ô º¸±â ÁÁÀ½)
var stmnActivateSpeed = 1;	// ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´Ê°Ô ¾Ë¾ÆÂ÷¸²)
var stmnScrollSpeed = 1;	// ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´Ê°Ô ¿òÁ÷ÀÓ)

var stmnTimer;
function ReadCookie(name) {
	var label = name + "=";
	var labelLen = label.length;
	var cLen = document.cookie.length;
	var i = 0;
	while (i < cLen) {
		var j = i + labelLen;
		if (document.cookie.substring(i, j) == label) {
		var cEnd = document.cookie.indexOf(";", j);
		if (cEnd == -1) cEnd = document.cookie.length;
			return unescape(document.cookie.substring(j, cEnd));
		}
		i++;
	}
	return "";
}

function SaveCookie(name, value, expire) {
	var eDate = new Date();
	eDate.setDate(eDate.getDate() + expire);
	document.cookie = name + "=" + value + "; expires=" + eDate.toGMTString()+ "; path=/";
}
function RefreshStaticMenu() {
	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
	stmnStartPoint = parseInt(STATICMENU.style.top, 10);
	stmnEndPoint = document.body.scrollTop + stmnGAP2;
	if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;
	stmnRefreshTimer = stmnActivateSpeed;
	if ( stmnStartPoint != stmnEndPoint ) {
		stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
		STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
		stmnRefreshTimer = stmnScrollSpeed;
	}
	stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}
function InitializeStaticMenu() {
	STATICMENU.style.left = stmnLEFT;
	STATICMENU.style.top = document.body.scrollTop + stmnBASE;
	RefreshStaticMenu();
}



function gotop() {
	window.scrollTo(0,0);
}

function gotop_Call() {
	document.body.ondblclick = Top;
}

var Xpos = 0;
var Ypos = 0;
var Ygravity = 0.85;
var scrollPos = 0;
var oldScrollPos = 0;


function FloatMenu(){
	docWidth = document.body.clientWidth; // Update document width
	docHeight = document.body.clientHeight; // Update document height
	oldScrollPos = scrollPos;
	scrollPos = document.body.scrollTop; // Update scrollbar position

	Xpos = 817;
	//Xpos = (docWidth - floater.offsetWidth) - 10; //¿À¸¥ÂÊ ¿©¹é ¹è³Ê°¡ ¿À¸¥ÂÊ¿¡ ºÙÀ»°æ¿ì
	//Xpos = (docWidth / 2) + 410; // Áß¾ÓÁ¤·ÄÀÏ°æ¿ì. " + 410 Àº Å×ÀÌºí Å©±â / 2 "
	Yboundary = ((scrollPos + docHeight) - floater.offsetHeight) - 60; //ÇÏ´Ü¿©¹é

	if(floater.offsetTop < Yboundary - 1){ // Object is behind boundary
		Ypos += 2;
	}

	if(floater.offsetTop > Yboundary + 1){ // Object is past boundary
		Ypos -= 1;
	}

	Ypos *= Ygravity; // Slow object down

	floater.style.pixelLeft = Xpos;
	floater.style.pixelTop += Ypos; // Make object bounce
}


/* Ãß°¡(2000. 00. 00) */

//-----------------------------------------------------------------------------
// ÇÏ´Ü ¼¿·ºÆ® ¸Þ´º ¹× ¸¶¿ì½º ¿À¸¥ÂÊ Å¬¸¯ Á¦¾î
//-----------------------------------------------------------------------------

//ÀüÃ¼ÆäÀÌÁö Å¾ÀÇ select(combo)
function showcombo(what){
	if (what.style.display=='')
		what.style.display='none';

	else if (what.style.display=='none')
		what.style.display='';
}

//½ºÅ©·¦
function scrap_it(){
		var df = document.scrapForm;
		window.open('/board/include/scrap.php?url='+df.url.value+'&subject='+df.subject.value,'bookmark','width=1,height=1,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=2000,left=2000');
	}

function printCenterArea(title){


    pDoc = document.body.innerHTML;
    if(pDoc) {
        
        pDoc_start = pDoc.indexOf("CMS CONTENT START");
        pDoc_end = pDoc.lastIndexOf("CMS CONTENT END");

        if(pDoc_start>0 && pDoc_end>0) pDoc_after = "<!--// " + pDoc.substring(pDoc_start, pDoc_end) + " CMS CONTENT END //-->";
        else pDoc_after = pDoc;

        var printWinId = window.open('','','width=690,height=700,top=50,left=370,scrollbars=yes');
        var strTmp = "";
        strTmp += "<html><head>";
        strTmp += "<title>¹Ì¸®º¸±â</title>\n";
        strTmp += "<link rel='stylesheet' href='/css/css.css' type='text/css'>\n";
        strTmp += "<script language='javascript'>";
        strTmp += "function prints(){document.title='ÀÎ¼âÁß...'; print_tr.style.display='none';";
        strTmp += "factory.printing.header='';factory.printing.footer='';factory.printing.portrait=true;";
        strTmp += "factory.printing.leftMargin=20.0;factory.printing.topMargin=25.0;factory.printing.rightMargin=20.0;factory.printing.bottomMargin=20.0;";
        strTmp += "factory.printing.Print(false, window); print_tr.style.display=''; document.title='¹Ì¸®º¸±â'; }";
        strTmp += "</script>\n";
        strTmp += "</head><body>\n";
		if (title)
		{   strTmp += "<table width='90%' border='0' cellpadding='0' cellspacing='0'>\n";
		    strTmp += "<tr><td align='center'>\n";
			strTmp += "<br><font size = '2'><b>"+title+" Çà»çÀÏÁ¤Ç¥</b></font>\n";
			strTmp += "</td></tr></table>";
		}
        strTmp += "<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td align=center>\n\n";
        strTmp +=  pDoc_after;
        strTmp += "\n\n</td></tr><tr id='print_tr'><td align='center'>\n";
        strTmp += "<table width='90%' border='0' cellpadding='0' cellspacing='0'>\n";
        strTmp += "<tr><td align='left'>\n";
        strTmp += "<br><a href='javascript:prints();' onFocus='this.blur()'><img src='/images/common/print_btn.gif' border='0'></a>\n";
        strTmp += "<a href='javascript:self.close();' onFocus='this.blur()'><img src='/images/common/print_close.gif' border='0' hspane='5'></a>\n";
        strTmp += "</td></tr></table>";
        strTmp += "</td></tr></table>";
        strTmp += "<object id='factory' style='display:none' classid='clsid:1663ed61-23eb-11d2-b92f-008048fdd814' codebase='http://www.meadroid.com/scriptx/smsx.cab'></object>\n";
        strTmp += "</body></html>";

        printWinId.document.open();
        printWinId.document.write(strTmp);
        printWinId.document.focus();
        printWinId.document.close();
		printWinId.print();
 // window.print();
    } else alert("ÆäÀÌÁö ³»¿ëÀ» ºÒ·¯¿À´Âµ¥ ¹®Á¦°¡ ¹ß»ýÇß½À´Ï´Ù.");
} 


/* Ãß°¡(2000. 00. 00) */

/****** ¸ÞÀÎ ¸Þ´º ¸µÅ© *****************/
function menu1() { location.href = "/english/festival/festival1.php"; }
function menu2() { location.href = "/english/information/information1.php"; }
function menu3() { location.href = "/english/past/past2.php"; }
function menu4() { location.href = "/english/enjoy/enjoy1.php"; }
//function menu5() { location.href = "/english/tour/tour1.php"; }
function menu5() { window.open('http://ubtour.go.kr/index.jsp', '_blank'); }
function menu6() { location.href = "/english/favorite/favorite1.php"; }


/******* 1 *****************/
function menu1sub1() { location.href = "/english/festival/festival1.php"; }
function menu1sub2() { location.href = "/english/festival/festival2.php"; }
function menu1sub3() { location.href = "/english/festival/festival3.php"; }
function menu1sub4() { location.href = "/english/festival/festival4.php"; }
function menu1sub5() { location.href = "/english/festival/festival5.php"; }
function menu1sub6() { window.open('http://mudfestival.or.kr/mud/', '_blank'); }

/******* 2 *****************/
function menu2sub1() { location.href = "/english/information/information1.php"; }
function menu2sub2() { location.href = "/english/information/information2.php"; }
function menu2sub3() { location.href = "/english/information/information3.php"; }
function menu2sub4() { location.href = "/english/information/information4.php"; }
function menu2sub5() { location.href = "/english/information/information5.php"; }

/******* 3 *****************/
function menu3sub1() { location.href = "/english/past/past1.php"; }
function menu3sub2() { location.href = "/english/past/past2.php"; }
function menu3sub3() { location.href = "/english/past/past3.php"; }
function menu3sub4() { location.href = "/english/past/past4.php"; }
function menu3sub5() { location.href = "/english/past/past5.php"; }
function menu3sub6() { location.href = "/english/past/sitemap.php"; }

/******* 4 *****************/
function menu4sub1() { location.href = "/english/enjoy/enjoy1.php"; }
function menu4sub2() { location.href = "/english/enjoy/enjoy2.php"; }
function menu4sub3() { location.href = "/english/enjoy/enjoy8.php"; }
function menu4sub4() { location.href = "/english/enjoy/enjoy3.php"; }
function menu4sub5() { location.href = "/english/enjoy/enjoy4.php"; }
function menu4sub6() { location.href = "/english/enjoy/enjoy5.php"; }
function menu4sub7() { location.href = "/english/enjoy/enjoy6.php"; }
function menu4sub8() { location.href = "/english/enjoy/enjoy7.php"; }

/******* 5 *****************/
function menu5sub1() { location.href = "/english/tour/tour1.php"; }

/******* 6 *****************/
function menu6sub1() { location.href = "/english/favorite/favorite1.php"; }






function tick() {
var month,date,hours, minutes, seconds, ap;
var intYear,intDate,intMon,intHours, intMinutes, intSeconds;
var today;

today = new Date();

intYear = today.getFullYear();		// IE / FF / OPERA ¿¡¼­ ´Ù ¾µ¼ö ÀÖ°Ô..
intDate = today.getDate();
intMon = today.getMonth()+1;
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();

if (intMon < 10) {
month = "0"+intMon;
} else {
month = intMon;
}
if (intDate < 10) {
date = "0"+intDate;
} else {
date = intDate;
}
if (intHours == 0) {
hours = "12:";
ap = "¿ÀÀü";
} else if (intHours < 12) { 
hours = intHours + ":";
ap = "¿ÀÀü"; 
} else if (intHours == 12) {
hours = "12:";
ap = "¿ÀÈÄ";
} else {
intHours = intHours - 12
hours = intHours + ":";
ap = "¿ÀÈÄ";
}

if (intMinutes < 10) {
minutes = "0"+intMinutes+":"; 
} else {
minutes = intMinutes+":";
}

if (intSeconds < 10) {
seconds = "0"+intSeconds; 
} else {
seconds = intSeconds; 
} 

timeString = intYear + "-" + month +"-"+ date +" "+hours+minutes+seconds;

Clock.innerHTML = timeString;

window.setTimeout("tick();", 100);
}

//window.onload = tick;
function FlashMainbody(Ftrans,wid,hei,m) {
	mainbody = "<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='"+ wid +"' height='"+ hei +"'>";
	mainbody += "<param name='movie' value='../english/swf/"+ Ftrans +"'>";
	mainbody += "<param name='quality' value='high'>";
	mainbody += "<param name='wmode' value='transparent'>";
	mainbody += "<param name='menu' value='false'>";
	//mainbody += "<param name='FlashVars' value='m="+m+"'>"; 
	mainbody += "<embed src='../english/swf/"+ Ftrans +"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ wid +"' height='"+ hei +"' wmode='transparent'></embed>"
	mainbody += "</object>";

	//document.body.innerHTML = mainbody;
	document.write(mainbody);
	return;
}
function FlashMainbody1(Ftrans,wid,hei,m) {
	mainbody = "<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='"+ wid +"' height='"+ hei +"'>";
	mainbody += "<param name='movie' value='../../english/swf/"+ Ftrans +"'>";
	mainbody += "<param name='quality' value='high'>";
	mainbody += "<param name='wmode' value='transparent'>";
	mainbody += "<param name='menu' value='false'>";
	//mainbody += "<param name='FlashVars' value='m="+m+"'>"; 
	mainbody += "<embed src='../../english/swf/"+ Ftrans +"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ wid +"' height='"+ hei +"' wmode='transparent'></embed>"
	mainbody += "</object>";

	//document.body.innerHTML = mainbody;
	document.write(mainbody);
	return;
}