
/* ¸¶¿ì½º ¿Â/¿ÀÇÁ */
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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.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; }
}

/* ½ºÅ©¸³Æ® ÆË¾÷ */
function MM_findObj(n, d) 
{ 
   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() 
{ 
   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; 
      }
   }
}


//ÆË¾÷ ÇÏ·çµ¿¾È ¾È ¿­±â ½ºÅ©¸³Æ®
function getCookie(name) { 
  var Found = false; 
  var start, end 
  var i = 0;

  while(i <= document.cookie.length) { 
    start = i; 
    end = start + name.length; 
    if(document.cookie.substring(start, end) == name) { 
       Found = true;
       break;
    } 
    i++;
  } 

  if(Found == true) { 
    start = end + 1; 
    end = document.cookie.indexOf(";", start);

    if(end < start) 
      end = document.cookie.length;
    return document.cookie.substring(start, end); 
  }
  return "";
} 





/* ¹®¼­ ÀüÃ¼ ¸µÅ© Á¡¼± ¾ø¾Ö±â */
function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 




/* ¼¿·ºÆ®¹Ú½º »õÃ¢¶ß±â */
function selectPopup(obj){
    if(obj.selectedIndex > 0)
	  window.open(this.value);
  }
  

function win_open(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';
	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 movie_pop(strUrl)
{
	var strUrl;
	win_open('pop_movie',strUrl,0,0,1024,627,0,0,0,1,0);
}

  function sizeCtl(obj){
    if(obj.width>=obj.height && obj.height*75/obj.width<110) obj.width = 100;
    else obj.height = 75;
    obj.style.marginBottom = "3px";
  }

function movieSearch(url){

  if("<%=gUserID%>"==""){
    window.open("<%=re%>", "·Î±×ÀÎ", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=450, height=400,left=400,top=100")
  }else{  
   window.open(url, "¿µÈ­°Ë»ö", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=640, height=580,left=400,top=100")
  } 

}

function scrapDel(url){

  if("<%=gUserID%>"==""){
    window.open("<%=re%>", "·Î±×ÀÎ", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=450, height=400,left=400,top=100")
  }else{  
   window.open(url, "Ä«Å×°í¸®»èÁ¦", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=640, height=285,left=400,top=100")
  } 

}



function scrappage(param){
  if("<%=gUserID%>"==""){
    window.open("<%=re%>", "·Î±×ÀÎ", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=450, height=400,left=400,top=100")
  }else{ 
    window.open("", "scrap", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=450, height=400,left=400,top=100")  
    form1.target = "scrap"
    form1.action = "../include/scrap_form.asp?stype="+param;
    form1.submit();
  }  
} 

function twentyText(param1,param2){
 // alert('<%=gUserID%>');
    window.open("twenty_form.asp", "twenty", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=450, height=400,left=400,top=100")  
    form1.target = "twenty";
    form1.sMode.value = param1;
    form1.tNo.value = param2;
    form1.action = "twenty_form.asp";
    form1.submit();
}

function twentyDelete(param1) {
    window.open("twenty_form.asp", "twenty", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=450, height=400,left=400,top=100")  
    form1.target = "twenty";
   // form1.sMode.value = param1;
    form1.tNo.value = param1;
    form1.action = "twenty_delete.asp";
    form1.submit();
}


  //°Ë»ö½Ã Æ¯¼ö¹®ÀÚ ÀÔ·Â¹æÁö yonglly
  function search(param,param2){
    var string=param.value;
    var len=string.length;
    var check = true;
    
    if (param2.field.value=="")
    {
      alert("°Ë»öÁ¶°ÇÀ» ¼±ÅÃÇÏ¼¼¿ä.");
      check = false;
    }

    if(len > 0){
      // ±ÝÁö ¹®ÀÚ Ã¼Å©
      for(i = 0; i < param.value.length; i++){
        ch = param.value.charAt(i);
        if(ch == "%" || ch == "&" || ch == "?" || ch == "\"" || ch == "'" || ch=='"'){
          alert("°Ë»ö¾î¿¡¿¡ '" + ch + "'´Â ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
          param.value = "";
          param.focus();
          check = false;
        }else{
           
        }
      }
    }
    if (check)
    {
       param2.submit(); 
    }
   
  }

  function search2(param,param2){
    var string=param.value;
    var len=string.length;
    var check = true;

    if(len > 0){
      // ±ÝÁö ¹®ÀÚ Ã¼Å©
      for(i = 0; i < param.value.length; i++){
        ch = param.value.charAt(i);
        if(ch == "%" || ch == "&" || ch == "?" || ch == "\"" || ch == "'" || ch=='"'){
          alert("°Ë»ö¾î¿¡¿¡ '" + ch + "'´Â ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
          param.value = "";
          param.focus();
          check = false;
        }else{
           
        }
      }
    }
    if (check)
    {
       param2.submit(); 
    }
   
  }



function mainMiddleUpdate(param)
{
	if (param==1)
	{
		document.getElementById("media1").style.display = "inline";
		document.getElementById("media2").style.display = "none";
	//	document.getElementById("media3").style.display = "none";
		tab001.src ="files/images/main/tab_0201_on.gif"; 
		tab002.src ="files/images/main/tab_0202.gif";   //2
	//	tab003.src ="files/images/main/tab_0203.gif";   //2
    document.getElementById("tabHref2").style.display = "none"; 
		position = "1";
	}else if (param==2)
	{
        tab002.onMouseOut = "";
		document.getElementById("media1").style.display = "none";
		document.getElementById("media2").style.display = "inline";
	//	document.getElementById("media3").style.display = "none";
		tab001.src ="files/images/main/tab_0201.gif"; 
		tab002.src ="files/images/main/tab_0202_on.gif";   //2
	//	tab003.src ="files/images/main/tab_0203.gif";   //2
    document.getElementById("tabHref2").style.display = "inline"; 
		position = "2";
	}else if (param==3)
	{
		document.getElementById("media1").style.display = "none";
		document.getElementById("media2").style.display = "none";
	//	document.getElementById("media3").style.display = "inline";
		tab001.src ="files/images/main/tab_0201.gif"; 
		tab002.src ="files/images/main/tab_0202.gif";   //2
	//	tab003.src ="files/images/main/tab_0203_on.gif";   //2
    document.getElementById("tabHref2").style.display = "none"; 
		position = "3";
	}
}

function mainSchedule(param)
{
	if (param==1)
	{
		document.getElementById("screen1").style.display = "inline";
		document.getElementById("screen2").style.display = "none";
		tab_01.src ="files/images/main/tab_0101_on.gif"; 
		tab_02.src ="files/images/main/tab_0102.gif";   //2
    document.getElementById("scheduleTab1").style.display = "inline"; 
    document.getElementById("scheduleTab2").style.display = "none"; 
	}else if (param==2)
	{
		document.getElementById("screen1").style.display = "none";
		document.getElementById("screen2").style.display = "inline";
		tab_01.src ="files/images/main/tab_0101.gif"; 
		tab_02.src ="files/images/main/tab_0102_on.gif";   //2
    document.getElementById("scheduleTab1").style.display = "none"; 
    document.getElementById("scheduleTab2").style.display = "inline"; 
	}
}

function vodRanking(param)
{
	if (param==1)
	{
		document.getElementById("media1").style.display = "inline";
		document.getElementById("media2").style.display = "none";
		document.getElementById("media3").style.display = "none";
		position = "1";
	}else if (param==2)
	{
		document.getElementById("media1").style.display = "none";
		document.getElementById("media2").style.display = "inline";
		document.getElementById("media3").style.display = "none";
		position = "2";
	}else if (param==3)
	{
		document.getElementById("media1").style.display = "none";
		document.getElementById("media2").style.display = "none";
		document.getElementById("media3").style.display = "inline";
		position = "3";
	}
}

function textLengthLimit(theField, theLimit, message)
{
	if (theField.value.length > theLimit)
	{
		alert(message + " " + theLimit + "ÀÚ±îÁö¸¸ ¾µ ¼ö ÀÖ½À´Ï´Ù.");
		theField.value = theField.value.substring(0, theLimit);
		return;			
	}
}//¿¬µµ°Ë»ö
function year() {
		if (document.getElementById("all").style.display=="none"){
			document.getElementById("all").style.display="block"
		} else {
			document.getElementById("all").style.display="none";
		}
	}








<!--
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 changemov01()
  {
    document.getElementById('mov1').style.display = "block";
    document.getElementById('mov2').style.display = "none";
    document.getElementById('mov3').style.display = "none";

}
  function changemov02()
  {
    document.getElementById('mov1').style.display = "none";
    document.getElementById('mov2').style.display = "block";
    document.getElementById('mov3').style.display = "none";

  }
    function changemov03()
  {
    document.getElementById('mov1').style.display = "none";
    document.getElementById('mov2').style.display = "none";
    document.getElementById('mov3').style.display = "block";

  }

//¿µÈ­¼øÀ§

  function changeran01()
  {
    document.getElementById('ran1').style.display = "block";
    document.getElementById('ran2').style.display = "none";
    document.getElementById('ran3').style.display = "none";
    document.getElementById('ran4').style.display = "none";

}
  function changeran02()
  {
    document.getElementById('ran1').style.display = "none";
    document.getElementById('ran2').style.display = "block";
    document.getElementById('ran3').style.display = "none";
    document.getElementById('ran4').style.display = "none";

  }
    function changeran03()
  {
    document.getElementById('ran1').style.display = "none";
    document.getElementById('ran2').style.display = "none";
    document.getElementById('ran3').style.display = "block";
    document.getElementById('ran4').style.display = "none";

  }

    function changeran04()
  {
    document.getElementById('ran1').style.display = "none";
    document.getElementById('ran2').style.display = "none";
    document.getElementById('ran3').style.display = "none";
    document.getElementById('ran4').style.display = "block";

  }


//¿µÈ­ÆòÁ¡

  function changeview01()
  {
    document.getElementById('view1').style.display = "block";
    document.getElementById('view2').style.display = "none";

}
  function changeview02()
  {
    document.getElementById('view1').style.display = "none";
    document.getElementById('view2').style.display = "block";

  }
 


//¿µÈ­pop
// ÇØ´ç ÅÇµéÀÇ ¿À¹ö ÀÌ¹ÌÁö¿Í ¾Æ¿ô ÀÌ¹ÌÁö¸¦ ¼ÂÆÃ (ÇÖÀÌ½´)
pop1on = new Image();
pop1on.src = "../images/main/btn_p1ov.gif";
pop2on = new Image();
pop2on.src = "../images/main/btn_p2ov.gif";
pop3on = new Image();
pop3on.src = "../images/main/btn_p3ov.gif";
pop4on = new Image();
pop4on.src = "../images/main/btn_p4ov.gif";
pop5on = new Image();
pop5on.src = "../images/main/btn_p5ov.gif";
pop6on = new Image();
pop6on.src = "../images/main/btn_p6ov.gif";
pop7on = new Image();
pop7on.src = "../images/main/btn_p7ov.gif";
pop8on = new Image();
pop8on.src = "../images/main/btn_p8ov.gif";

pop1off = new Image();
pop1off.src = "../images/main/btn_p1.gif";
pop2off = new Image();
pop2off.src = "../images/main/btn_p2.gif";
pop3off = new Image();
pop3off.src = "../images/main/btn_p3.gif";
pop4off = new Image();
pop4off.src = "../images/main/btn_p4.gif";
pop5off = new Image();
pop5off.src = "../images/main/btn_p5.gif";
pop6off = new Image();
pop6off.src = "../images/main/btn_p6.gif";
pop7off = new Image();
pop7off.src = "../images/main/btn_p7.gif";
pop8off = new Image();
pop8off.src = "../images/main/btn_p8.gif";



function imgChange( imgName, imgPos, imgCnt) { // ÇØ´ç ÀÌ¹ÌÁöÀÇ name°ª, ÇØ´ç ÀÌ¹ÌÁöÀÇ ¿À¹ö °æ·Î, ÀÌ¹ÌÁö ÅÇÀÇ ¼ö
	for(i=1;i<=imgCnt;i++) {
		if(i == imgPos ) {
			document.getElementById(imgName + i).src = eval(imgName + i + "on.src");
		} else {
			document.getElementById(imgName + i).src = eval(imgName + i + "off.src");
		}
	}
}
function layerChange( layerName, layerPos, layerCnt ) { // ÇØ´ç ·¹ÀÌ¾îÀÇ id °ª, ÇØ´ç ·¹ÀÌ¾îÀÇ À§Ä¡, ·¹ÀÌ¾îÀÇ ¼ö
	for(i=1;i<=layerCnt;i++) {
		if(i == layerPos) {
			document.getElementById(layerName + i).style.display = "";
		} else {
			document.getElementById(layerName + i).style.display = "none";
		}
	}
}





//ÀüÃ¼¸Þ´ºº¸±â

	function view() {
		if (document.getElementById("map").style.display=="none"){
			document.getElementById("map").style.display="block"
		} else {
			document.getElementById("map").style.display="none";
		}
	}
	/*function layer_close() {
		document.getElementById("map").style.display="none";
	}*/



function helpPage(param) {
//alert(param);
var url
if (param == 1) {
	url = "vodHelp.html";
}else if (param == 2) {
	url = "vodFaq.asp";
}else if (param == 3) {
	url = "vodQna.asp";
}else if (param == 4)
{
	url ="vodLicence.asp";
}
 window.open(url, "KMDb", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=640, height=580,left=400,top=100");
}



