function chkForm(f)
{ 
    var i,currEl;

    for(i = 0; i < f.elements.length; i++){ 
        currEl = f.elements[i]; 
        //ÇÊ¼ö Ç×¸ñÀ» Ã¼Å©ÇÑ´Ù.  
        if (currEl.getAttribute("required") != null) { 
            if(currEl.type == "TEXT" || currEl.type == "text" || 
               currEl.tagName == "SELECT" || currEl.tagName == "select" || 
               currEl.tagName == "TEXTAREA" || currEl.tagName == "textarea"){ 
                if(!chkText(currEl,currEl.hname)) return false; 

            } else if(currEl.type == "PASSWORD" || currEl.type == "password"){ 
                if(!chkText(currEl,currEl.hname)) return false; 

            } else if(currEl.type == "CHECKBOX" || currEl.type == "checkbox"){ 
                if(!chkCheckbox(f, currEl,currEl.hname)) return false; 

            } else if(currEl.type == "RADIO" || currEl.type == "radio"){ 
                if(!chkRadio(f, currEl,currEl.hname)) return false; 

            }
        }
        // ÀÔ·Â ÆäÅÏÀ» Ã¼Å©ÇÑ´Ù.
        if(currEl.getAttribute("option") != null && currEl.value.length > 0){ 
            if(!chkPatten(currEl,currEl.option,currEl.oname)) return false; 
        }


		if(currEl.getAttribute("ssame") != null && currEl.value != "") { 
            ssameEI = eval("form1." + currEl.ssame + ".value"); 
            if(currEl.value != ssameEI) { 
                //return Do_Error(currEl, "ssame"); 
				alert("ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.");
				currEl.value = "";
				form1.admin_pwd_re.value = "";
				currEl.focus();
				return false;
            } 
        } 
        if(currEl.getAttribute("smsize") != null && currEl.value != "") { 
            if(currEl.smsize > currEl.value.length) { 
                return Do_Error(currEl, "smsize"); 
            } 
        } 
        if(currEl.getAttribute("mxsize") != null && currEl.value != "") { 
            if(currEl.mxsize < currEl.value.length) { 
                return Do_Error(currEl, "mxsize"); 
            } 
        } 
    }
	
	
}

function chkPatten(field,patten,name)
{ 
    var regNum =/^[0-9]+$/; 
    var regPhone =/^[0-9]{2,3}-[0-9]{3,4}-[0-9]{4}$/;                     // Çü½Ä : 033-1234-5678
    var regMail =/^[_a-zA-Z0-9-]+@[._a-zA-Z0-9-]+\.[a-zA-Z]+$/; 
    var regDomain =/^[.a-zA-Z0-9-]+.[a-zA-Z]+$/; 
    var regAlpha =/^[a-zA-Z]+$/; 
    var regHost =/^[a-zA-Z-]+$/; 
    var regHangul =/[°¡-ÆR]/; 
    var regHangulEng =/[°¡-ÆRa-zA-Z]/; 
    var regHangulOnly =/^[°¡-ÆR]*$/; 
    var regId = /^[a-zA-Z]{1}[a-zA-Z0-9_-]{3,20}$/; 
    var regDate =/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;                         // Çü½Ä : 2002-08-15

    patten = eval(patten); 
    if(!patten.test(field.value)){ 
        alert(name); 
        field.focus(); 
        return false; 
    } 
    return true; 
} 


function chkText(field, name)
{
    fieldvalue = field.value;
    fieldvalue = fieldvalue.split(" ");
    
    if(field.value.length + 1 == fieldvalue.length){ 
        alert(name); 
        field.value = "";
        field.focus(); 
        return false; 
    } 
    return true; 
}

function chkCheckbox(form, field, name)
{
    fieldname = eval(form.name+'.'+field.name);
    if (!fieldname.checked){
        alert(name); 
        field.focus(); 
        return false; 
    }
    return true; 
}

function chkRadio(form, field, name)
{
    fieldname = eval(form.name+'.'+field.name);
    for (i=0;i<fieldname.length;i++) {
        if (fieldname[i].checked)
            return true; 
    }
    alert(name); 
    field.focus(); 
    return false; 
} 


function Do_Error(el,type) { 
    name = (el.hname) ? el.hname : el.name; 
    switch(type) { 
        case "ssame": 
            alert(name + " Ç×¸ñÀº " + el.ssame + " Ç×¸ñ°ú °°¾Æ¾ß ÇÕ´Ï´Ù."); 
            break; 
        case "smsize": 
            alert(el.smsize + "ÀÚ ÀÌ»óÀ¸·Î " + name); 
            break; 
        case "mxsize": 
            alert(el.mxsize + "ÀÚ ÀÌÇÏ·Î " + name); 
            break; 
        } 
	el.focus(); 
    return false; 
} 

   function ZipWindow(ref,what) {
      var window_left = (screen.width-640)/2;
      var window_top = (screen.height-480)/2;
      ref = ref + "?what=" + what;      
      window.open(ref,"zipWin",'width=550,height=200,status=no,top=' + window_top + ',left=' + window_left + '');
   }


function checkresi(){
	str1 = document.form1.jumin1.value ;
	str2 = document.form1.jumin2.value ;
	li_value = new Array(13);
     var li_lastid,li_mod,li_minus,li_last;
	li_lastid    = parseFloat(str2.substring(6,7));
	li_value[0]  = parseFloat(str1.substring(0,1))  * 2;
	li_value[1]  = parseFloat(str1.substring(1,2))  * 3;
	li_value[2]  = parseFloat(str1.substring(2,3))  * 4;
	li_value[3]  = parseFloat(str1.substring(3,4))  * 5;
	li_value[4]  = parseFloat(str1.substring(4,5))  * 6;
	li_value[5]  = parseFloat(str1.substring(5,6))  * 7;
	li_value[6]  = parseFloat(str2.substring(0,1))  * 8;
	li_value[7]  = parseFloat(str2.substring(1,2))  * 9;
	li_value[8]  = parseFloat(str2.substring(2,3))  * 2;
	li_value[9]  = parseFloat(str2.substring(3,4))  * 3;
	li_value[10] = parseFloat(str2.substring(4,5))  * 4;
	li_value[11] = parseFloat(str2.substring(5,6))  * 5;
	li_value[12] = 0;
	for (var i = 0; i<12;i++)
	{
		li_value[12] = li_value[12] + li_value[i];
	}   
	li_mod = li_value[12] %11;
	li_minus = 11 - li_mod;
	li_last = li_minus % 10;
	if (li_last != li_lastid)
	{
		alert ("\nÁÖ¹Îµî·Ï¹øÈ£°¡ ¸ÂÁö ¾Ê½À´Ï´Ù. ´Ù½Ã È®ÀÎÇØ ÁÖ½Ê½Ã¿À");
		document.form1.jumin1.value="";
		document.form1.jumin2.value="";
		document.form1.jumin1.focus();
		}
    }

function VodList(urlpath) {
       if (document.form1.timesView.checked== true)
      {
	  var window_left = (screen.width-640)/2;
      var window_top = (screen.height-480)/2;
      CategoryID = document.form1.CategoryID.value ;
	  if(CategoryID == ""){
		
		alert("ÀúÀåÀ§Ä¡¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.");
		document.form1.timesView.checked= false;
		
	  }else{
	  //alert(CategoryID);
	  URL=urlpath + "?CategoryID=" + CategoryID + "&mCtype=add";      
	   window.open(URL,"VodListWin",'width=600,height=600,status=no,resizable=yes,top=' + window_top + ',left=' + window_left + ',scrollbars=no');
	    document.all.VodPosition.style.display="block";
	  }
	 
	  }else{
		document.all.VodPosition.style.display="none";
	  }	 
   }

   function modVodList(urlpath) {
      if (document.form1.timesView.checked== true)
      {
     
		  var window_left = (screen.width-640)/2;
		  var window_top = (screen.height-480)/2;
		  CategoryID = document.form1.mCategoryID.value ;
		  if(CategoryID == ""){
			
			alert("ÀúÀåÀ§Ä¡¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.");
		  }else{
		  //alert(CategoryID);
		  URL=urlpath + "?CategoryID=" + CategoryID + "&mCtype=edit";    
		   window.open(URL,"VodListWin",'width=600,height=600,status=no,resizable=yes,top=' + window_top + ',left=' + window_left + ',scrollbars=no');
		   document.all.VodPosition.style.display="block";
		  }
		 document.all.VodPosition.style.display="block";
	  }else{
		document.all.VodPosition.style.display="none";
	  }	 
   }

  