
/* ¸¶¿ì½º ¿Â/¿ÀÇÁ */
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";
		}
	}
