	function isCorrectID(formname) {
		var form = eval("document.regform." + formname);

		if(form.value.length < 5 || form.value.length > 10) {
			 return false;
		}
		for(var i = 0; i < form.value.length; i++) {
			 var chr = form.value.substr(i,1);
			 if((chr < '0' || chr > '9') && (chr < 'a' || chr > 'z')) {
					return false;
			 }
		}
		return true;
	}

	function isCorrectPW(formname) {
		 var form = eval("document.regform." + formname);
		  
		 if(form.value.length < 4 || form.value.length > 8) {
			return false;
		 }
		 for(var i = 0; i < form.value.length; i++) {
			var chr = form.value.substr(i,1);
			if((chr < '0' || chr > '9') && (chr < 'a' || chr > 'z') && (chr < 'A' || chr > 'Z')) {
			   return false;
			}
		 }
		 return true;
	}

	function isCorrectNumber(formname) {
			var form = eval("document.regform." + formname);

			for(var i = 0; i < form.value.length; i++) {
				 var chr = form.value.substr(i,1);
				 if(chr < '0' || chr > '9') {
						return false;
				 }
			}
			return true;
	}

	function openIdWindow(ref) {
		var id = eval(document.regform.email);
				
		  if(!id.value) {
			 alert('¾ÆÀÌµð(ID)¸¦ ÀÔ·ÂÇÏ½Å ÈÄ¿¡ È®ÀÎÇÏ¼¼¿ä!');
			 id.focus();
			 return;
		  } else {
			 ref = ref + "?id=" + id.value;
			 var window_left = (screen.width-420)/2;
			 var window_top = (screen.height-230)/2;
			 window.open(ref,"checkIDWin",'width=300,height=200,status=no,top=' + window_top + ',left=' + window_left + '');
		  }
	   }

function openkamsWindow(ref) {
  var window_left = (screen.width-420)/2;
  var window_top = (screen.height-230)/2;
  window.open(ref,"checkkamsWin");
}


	function openSimWindow(ref,country) {
		var id = eval(document.regform.i_no);
				//alert(id.value);
		  if(!id.value) {
			 alert('ÀÏ·Ã¹øÈ£ ÀÔ·ÂÇÏ½Å ÈÄ¿¡ È®ÀÎÇÏ¼¼¿ä!');
			 id.focus();
			 return;
		  } else {
			 ref = ref + "?id=" + id.value+"&country="+country;
			 var window_left = (screen.width-420)/2;
			 var window_top = (screen.height-230)/2;
			 window.open(ref,"checkIDWin",'width=300,height=200,status=no,top=' + window_top + ',left=' + window_left + '');
		  }
	   }

	function isCorrectJuminNumber(ju_id1,ju_id2) {

		var codesum = 0;
		var coderet = 0;
		//ÀÚ¸®¼ö È®ÀÎ
		if( ju_id1.length != 6 || ju_id2.length != 7 ) {
			 return false;
		}
		
		//¼ýÀÚÀÎÁö
		codesum = ( eval( ju_id1.substring( 0, 1 ) ) * 2 )
				+ ( eval( ju_id1.substring( 1, 2 ) ) * 3 )
				+ ( eval( ju_id1.substring( 2, 3 ) ) * 4 )
				+ ( eval( ju_id1.substring( 3, 4 ) ) * 5 )
				+ ( eval( ju_id1.substring( 4, 5 ) ) * 6 )
				+ ( eval( ju_id1.substring( 5, 6 ) ) * 7 )
				+ ( eval( ju_id2.substring( 0, 1 ) ) * 8 )
				+ ( eval( ju_id2.substring( 1, 2 ) ) * 9 )
				+ ( eval( ju_id2.substring( 2, 3 ) ) * 2 )
				+ ( eval( ju_id2.substring( 3, 4 ) ) * 3 )
				+ ( eval( ju_id2.substring( 4, 5 ) ) * 4 )
				+ ( eval( ju_id2.substring( 5, 6 ) ) * 5 );
		coderet = 11 - (eval(codesum % 11));
		if(coderet >= 10)
			 coderet = coderet - 10;
		if(coderet >= 10)
			 coderet = coderet - 10;
		if(eval( ju_id2.substring( 6, 7 ) ) != coderet ) {
			 return false;
		}

		return true;
	}

	function openZipWindow(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=450,height=300,status=no,top=' + window_top + ',left=' + window_left + '');
	}


	function isCorrectEmail(formname) {
		var str = eval("document.regform." + formname + ".value");

    if ((str.indexOf("@") == -1))
    { 
      return false;
    }
    if ((str.indexOf(".") == -1))
    { 
      return false;
    }
		return true;
	}

	function changeit(){
		form = document.regform;
		if(form.fchk.checked == true){
			display1.style.display = "";
			display2.style.display = "none";
		}else{
			display1.style.display = "none";
			display2.style.display = "";
		}
	}

	function changeit2(val){
		form = document.regform;
		if(val == 06){
			display_depart.style.display = "";
		}else{
			display_depart.style.display = "none";
		}
	}

	function loadData(sel,target) {
	
	var trigger = sel.options[sel.selectedIndex].value;	// Ã¹¹øÂ° selectboxÀÇ ¼±ÅÃµÈ ÅØ½ºÆ®
	var form = 'regform';
	
	//alert(form+"-"+target+"-"+trigger);
	dynamic.src = "loadData.php?form=" + form + "&trigger=" + trigger + "&target=" + target;

	}

	function loadDataMod(sel,target,input) {
	//alert(sel.name);
	var trigger = sel.options[sel.selectedIndex].value;	// Ã¹¹øÂ° selectboxÀÇ ¼±ÅÃµÈ ÅØ½ºÆ®
	var form = 'regform';
	//alert(trigger);
	//alert(form+"-"+target+"-"+trigger);
	dynamic.src = "loadDataMod.php?form=" + form + "&trigger=" + trigger + "&target=" + target+"&input="+input;

	}

	var view = false;
	function showThirdMod(name,index,input){
		
		if(name=="major_a"){
			if(index==25){
				document.all['major_c'].style.display = "";
				document.all['major_c'].disabled = false;
				view = true;
			}else{
				document.all['major_c'].style.display = "none";
				document.all['major_c'].disabled = true;
				view = false;
			}

			loadDataMod(document.regform.major_a,'major_b',input)	;

		}else{
			//alert(name);
			if(view){
				if(index==1 || index==2 || index==4 || index==5 || index==9){
					document.all['major_c'].style.display = "";
					document.all['major_c'].disabled = false;
				}else{
					document.all['major_c'].style.display = "none";
					document.all['major_c'].disabled = true;
				}
			}
			loadDataMod(document.regform.major_b,'major_c',input)	;
		}
		
	}

	var view = false;
	function showThird(name,index,input){
		
		if(name=="major_a"){
			if(index==25){
				document.all['major_c'].style.display = "";
				document.all['major_c'].disabled = false;
				view = true;
			}else{
				document.all['major_c'].style.display = "none";
				document.all['major_c'].disabled = true;
				view = false;
			}

			loadData(document.regform.major_a,'major_b',input)	;

		}else{
			//alert(name);
			if(view){
				if(index==1 || index==2 || index==4 || index==5 || index==9){
					document.all['major_c'].style.display = "";
					document.all['major_c'].disabled = false;
				}else{
					document.all['major_c'].style.display = "none";
					document.all['major_c'].disabled = true;
				}
			}
			loadData(document.regform.major_b,'major_c',input)	;
		}
		
	}

