//-----------------------------------------------------------------------------
// 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_findObj
//-----------------------------------------------------------------------------

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 = 250;			// ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é
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
}


//-----------------------------------------------------------------------------
// ÀÍ½ºÇÃ·Î ÆÐÄ¡°ü·Ã ÇÃ·¡½Ã ¼öÁ¤¾øÀÌ º¸ÀÌ±â
//-----------------------------------------------------------------------------

var Embed_Patch = {
	count : 0,
	_textarea : null,
	set : function(obj,id){
		obj.insertAdjacentHTML('beforeBegin',document.getElementById(id).value);
	},
	run : function(obj){
		Embed_Patch._textarea.value = obj.outerHTML;
		Embed_Patch._textarea.id = '_dummy_' + Embed_Patch.count;
		Embed_Patch.set(obj,Embed_Patch._textarea.id);
		obj.parentNode.removeChild(obj);
		Embed_Patch.count++;
	},
	load :function(){
		//ÀÍ½º °ü·Ã ºê¶ó¿ìÁ®ÀÎÁö È®ÀÎ
		if(navigator.userAgent.toLowerCase().indexOf('msie')!=-1){
			try{
			/**
			* object ÅÂ±×·Î ÀÛ¼ºµÈ°æ¿ì
			*/
			var objs = document.getElementsByTagName('OBJECT');
			Embed_Patch._textarea = document.createElement('textarea');
			document.body.appendChild(Embed_Patch._textarea);
			for(total = objs.length,i=0; i<total; i++){
				Embed_Patch.run(objs[i]);
			}
			/**
			* embed ÅÂ±×·Î¸¸ ÀÛ¼ºµÈ °æ¿ì
			*/
			var objs = document.getElementsByTagName('EMBED');
			for(total = objs.length,i=0; i<total; i++){
				if(objs[i].parentNode.tagName!='OBJECT'){
					Embed_Patch.run(objs[i]);
				}
			}
			/**
			* applet ÅÂ±×·Î¸¸ ÀÛ¼ºµÈ °æ¿ì
			*/
			var objs = document.getElementsByTagName('APPLET');
			for(total = objs.length,i=0; i<total; i++){
				if(objs[i].parentNode.tagName!='OBJECT'){
					Embed_Patch.run(objs[i]);
				}
			}
			Embed_Patch._textarea.parentNode.removeChild(Embed_Patch._textarea);
			}catch(e){}
		}
	}
}
if(window.attachEvent){
	window.attachEvent('onload', Embed_Patch.load);
}

/* Ãß°¡(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');
	}

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

/****** ¸ÞÀÎ ¸Þ´º ¸µÅ© *****************/
function menu1() { location.href = "../festival/festival1.php"; }
function menu2() { location.href = "../information/information1.php"; }
function menu3() { location.href = "../past/past2.php"; }
/**function menu3() { window.open('http://mudfestival.or.kr/fest_past/fest_view.do?m1_fstvl_year=2007&m1_fstvl_gb=FSVL0010&m1_lang_gb=ko&pageNum=4&subNum=1&activeMenu', '_blank'); }*/
function menu4() { location.href = "../favorite/favorite1.php"; }


/******* 1 *****************/
function menu1sub1() { location.href = "../festival/festival1.php"; }
function menu1sub2() { location.href = "../festival/festival2.php"; }
function menu1sub3() { location.href = "../festival/festival3.php"; }
function menu1sub4() { location.href = "../festival/festival4.php"; }
function menu1sub5() { location.href = "../festival/festival5.php"; }
function menu1sub6() { location.href = "../festival/festival6.php"; }

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

/******* 3 *****************/
/**function menu3sub1() { window.open('http://mudfestival.or.kr/fest_past/fest_view.do?m1_fstvl_year=2007&m1_fstvl_gb=FSVL0010&m1_lang_gb=ko&pageNum=4&subNum=1&activeMenu', '_blank'); }*/
function menu3sub1() { location.href = "../past/past2y.php"; }

/******* 4 *****************/
function menu4sub1() { location.href = "../favorite/favorite1.php"; }



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='../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='../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;
}