<!--
//
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_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_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_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; }
}

    
// hide layer
function showMenu(current) {
	hideAll() ;
	if(navigator.appName == 'Netscape') {
	obj = "submenu" + current ;
	document.layers[obj].visibility = "show" ;
	} else {
	document.all["submenu"+current].style.visibility = "inherit" ;
	}
}
// show layer
function hideAll(current) {
	for( i=1; i <=6 ; i++ ) {
		if(navigator.appName == 'Netscape') {
			obj = "submenu" + i ;
			document.layers[obj].visibility = "hide" ;
		} else {
			document.all["submenu"+i].style.visibility = "hidden" ;
		}
	}
}
function isempty (data) {
      for (var i = 0; i < data.length; i++)
         if (data.substring(i, i+1) != " ") return false;
      return true;
}

function h_stringlength(string) {  
       
      char_cnt = 0;  
   

      for(var i = 0; i < string.length; i++) {  

       
         var chr = string.substr(i,1);  
         chr = escape(chr);  
         key_eg = chr.charAt(1);  
          
         switch (key_eg) {  
            case "u":  
               key_num = chr.substr(2,(chr.length-1));  
                  if((key_num < "AC00") || (key_num > "D7A3")) {  
                     //return false;  
                      char_cnt = char_cnt + 2; 
                  } else {  
                     char_cnt = char_cnt + 2;  
                  }  
               break;  
            case "B":  
               char_cnt = char_cnt + 2;  
               break;  
            default:  
               char_cnt = char_cnt + 1;  
         }  
      }  
       
      return char_cnt;  
}  
// form check
function onpresssubmit(form) {

      var first = 0;

      for (i = 0; i < form.length; i++)
      {
         var what = form.elements[i];
         var length = (what.length ? what.length : what.LENGTH);
         var text = (what.text ? what.text : what.TEXT);
         var notnull = (what.notnull=="" ? what.notnull : what.NOTNULL);

         if ((what.type == "text" || what.type == "password" || what.type == "textarea") && length)
         {
            var prt = text ? text : what.name;
         
            if ((notnull == "") && isempty(what.value)) 
            {
               alert (prt + ": please Insert data!!");
               first = (first ? first : i+1);
      			form.elements[first-1].focus();
      			return false;			   
            }
            else if (length < h_stringlength(what.value))
            {
               alert (prt + ": Data length is Over");
               first = (first ? first : i+1);
            }
         }
      }
      
//      form.elements[first-1].focus();
      return (first == 0);
}

// send
function SendMail(mail_address) {
 	if(!mail_address ){
		return;
	}
	var url = "/module/default/sendmail.php?mail_address=" + mail_address;  
 	popUpWin = window.open('','formmail','TOP=0,LEFT=0,width=0,height=0,resizable=yes,scrollbars=no,status=no,menubar=no');
 	popUpWin.resizeTo(400,380);
 	popUpWin.document.location.href = url;
}


// Numeric key
function chkNumeric() {
	var keyCode = event.keyCode
	if ((keyCode < 48 || keyCode > 57) && (keyCode<96 || keyCode >105)){
		alert("Numeric key only :"+"["+keyCode+"]")
		event.returnValue=false
	}
}

// start/end Date
function change_month1(arg_num)
{
	if(arg_num == 1) {
		target_year = document.form1.s_year.value
		target_month = document.form1.s_month.selectedIndex+1
		target_date = new Date(target_year + "/" + (target_month+1) + "/0")
		target_day = target_date.getDate()
	
		for(i=document.form1.s_day.length; i >= 0 ; i--)
		{
			document.form1.s_day.options[i] = null
		}
		
		for(i=0; i < target_day; i++)
		{
			var target_option = new Option(i+1, i+1)
			document.form1.s_day.options[i] = target_option
		}
	}
	else if (arg_num==2) {
		target_year = document.form1.e_year.value
		target_month = document.form1.e_month.selectedIndex+1
		target_date = new Date(target_year + "/" + (target_month+1) + "/0")
		target_day = target_date.getDate()
		
		for(i=document.form1.e_day.length; i >= 0 ; i--)
		{
			document.form1.e_day.options[i] = null
		}
		
		for(i=0; i < target_day; i++)
		{
			var target_option = new Option(i+1, i+1)
			document.form1.e_day.options[i] = target_option
		}		
	}
	else {
		alert("error!");
	}
}
// 
//  arg_num: (1/2), form: this.form
function change_month_new(arg_num,form){
	if(arg_num == 1) {
		target_year = form.t_year.value
		target_month = form.t_month.selectedIndex+1
		target_date = new Date(target_year + "/" + (target_month+1) + "/0")
		target_day = target_date.getDate()
		for(i=form.t_day.length; i >= 0 ; i--)
		{
			form.t_day.options[i] = null
		}
		
		for(i=0; i < target_day; i++)
		{
			var target_option = new Option(i+1, i+1)
			form.t_day.options[i] = target_option
		}
	}
}
// photo open
	function ListGallery(pid) {
		var goUrl = "CMSView.php?pid=44&tPid="+pid+"&mode=viewModule";
		VMwin = window.open(goUrl,'photo','TOP=0,LEFT=0,WIDTH=100,HEIGHT=100,scrollbars=auto');
		VMwin.focus();
	}
	function ViewGallery(imgFile,rSeq) {
		if(rSeq ==0) {
			alert('Invalid Data.');
			return;
		}			
		var goUrl = "CMSView.php?pid=783&rSeq="+rSeq+"&mode=viewModule";
		VMwin = window.open(goUrl,'photo','TOP=0,LEFT=0,WIDTH=100,HEIGHT=100,scrollbars=auto'); 
		VMwin.focus();
	}
// PVR open
	function ViewPVR(imgFile,rSeq) {
//		var goUrl = "CMSView.php?pid=43&rSeq="+rSeq+"&mode=viewModule"; // 
		var goUrl = "/kor/PVR/pvrEng.php?pid=43&rSeq="+rSeq+"&mode=viewModule";
		VMwin = window.open(goUrl,'pvr','TOP=10,LEFT=40,WIDTH=599,HEIGHT=422,scrollbars=auto'); 
		VMwin.focus();
	}
	function ViewVOD(imgFile,rSeq) {
		var goUrl = "CMSView.php?pid=45&rSeq="+rSeq+"&mode=viewModule"; // 
//		var goUrl = "PVR/pvr.php?pid=43&rSeq="+rSeq+"&mode=viewModule";
		VMwin = window.open(goUrl,'vod','TOP=10,LEFT=40,WIDTH=380,HEIGHT=370,scrollbars=auto'); 
		VMwin.focus();
	}
// 3DVR 
	function VR3DPop() {
//		var goUrl = "CMSView.php?pid=45&rSeq="+rSeq+"&mode=viewModule"; //
		var goUrl = "/kor/3DVR/yw3dvr.htm";
		VMwin = window.open(goUrl,'vod','TOP=10,LEFT=40,WIDTH=620,HEIGHT=470,scrollbars=no,resizeble=yes');
		VMwin.focus();
	}
	function GetFile(rSeq) {
		var goUrl = "CMSView.php?pid=44&rSeq="+rSeq+"&mode=getModule";
		VMwin = window.open(goUrl,'photo','TOP=0,LEFT=0,WIDTH=300,HEIGHT=250,scrollbars=auto'); 
		VMwin.focus();
	}			
// 
	function ViewMAP(imgFile,rSeq) {
		ViewGallery(imgFile,rSeq);
	}
// 
	function CheckSearch(form) {
		if(form.search.value =="") {
			alert("please Insert keyword");
			form.search.focus();
			return false;
		}
		return true;
	}
// 
	function PrintView(pid) {
		var goUrl = "CMSView.php?pid="+pid+"&print=print"; // 
		VMwin = window.open(goUrl,'print','TOP=10,LEFT=40,WIDTH=700,HEIGHT=500,scrollbars=yes'); 
		VMwin.focus();
	}	
// Gallery list rollover
var oriSrc = "";
function chGallery(imgFile) {
var path = "/media/GLI/";
oriSrc = document.all.GLI.src;
document.all.GLI.src = path+imgFile;
}

var bWidth = 620;
var bHeight = 200;
var bHeight1 = 190;
var bBgcolor = "#FFFFFF";
function beetleMap1(str) {
	if(str =="") {
		return;
	}	
	eval("beetleMap("+str+");");
}
function beetleMap(x,y) {
	if(x ==0 || y ==0) {
		return;
	}
	cTop = y;
	cRight = x + bWidth;
	cBottom = y + bHeight;
	cLeft = x;
	var spanStr = "";
//	spanStr +='<span id="Ubox" style="line-height:130%;position:relative;width:'+bWidth+';height:'+bHeight+';overflow:hidden;background-color:'+bBgcolor+';" >';
	spanStr +='<div style="line-height:130%;position:absolute;width:'+bWidth+';height:'+bHeight1+';clip:rect('+cTop+' '+cRight+' '+cBottom+' '+cLeft+');left:-'+x+';top:-'+y+';" >';
	spanStr +='<div id="Utxt1" style="line-height:130%;position:absolute;width:'+bWidth+';left:0;top:0; height:'+bHeight+';" >';
	spanStr += '<img src="/kor/img/beetleMap.jpg" border="1">';
	spanStr +='</div>';
	spanStr += '</div>';
//	spanStr += '</span>';
	document.all.beetle.innerHTML = spanStr;
//	alert(spanStr);
}
//-->
