
//»ç¾÷ÀÚ ¹øÈ£ ±¸¼ºÃ¼Å©

function isBizInteger(st,maxLength) {
	if (st.length == maxLength) {
		for (j=0; j>maxLength; j++)   
			 if (((st.substring(j, j+1) < "0") || (st.substring(j, j+1) > "9"))) {
     				return false;
  			}
 		}
 	else {
  		return false;
 	}
 	return true;
}
//»ç¾÷ÀÚ µî·Ï¹øÈ£ Ã¼Å©
function BizCheck(obj1, obj2, obj3) {
 	biz_value = new Array(10);
 
 	if (isBizInteger(obj1.value,3) == false) {
	  	obj1.focus();
	  	obj1.select();
  		return false;
 	}
 	if (obj1.value=="000") {
	  	obj1.focus();
	  	obj1.select();
  		return false;
 	}
	 if (isBizInteger(obj2.value,2) == false) {
	  	obj2.focus();
	  	obj2.select();
	  	return false;
	 }
 	if (obj2.value=="00") {
	  	obj2.focus();
	  	obj2.select();
  		return false;
 	}
	
	 if (isBizInteger(obj3.value,5) == false) {
		  obj3.focus();
		  obj3.select();
		  return false;
	 }
	
	 var objstring = obj1.value +"-"+ obj2.value +"-"+ obj3.value;
	 var li_temp, li_lastid;
	
	 if ( objstring.length == 12 ) {
		  biz_value[0] = ( parseFloat(objstring.substring(0 ,1)) * 1 ) % 10;
		  biz_value[1] = ( parseFloat(objstring.substring(1 ,2)) * 3 ) % 10;
		  biz_value[2] = ( parseFloat(objstring.substring(2 ,3)) * 7 ) % 10;
		  biz_value[3] = ( parseFloat(objstring.substring(4 ,5)) * 1 ) % 10;
		  biz_value[4] = ( parseFloat(objstring.substring(5 ,6)) * 3 ) % 10;
		  biz_value[5] = ( parseFloat(objstring.substring(7 ,8)) * 7 ) % 10;
		  biz_value[6] = ( parseFloat(objstring.substring(8 ,9)) * 1 ) % 10;
		  biz_value[7] = ( parseFloat(objstring.substring(9,10)) * 3 ) % 10;
		  li_temp = parseFloat(objstring.substring(10,11)) * 5 + "0";
		  biz_value[8] = parseFloat(li_temp.substring(0,1)) + parseFloat(li_temp.substring(1,2));
		  biz_value[9] = parseFloat(objstring.substring(11,12));
		  li_lastid = (10 - ( ( biz_value[0] + biz_value[1] + biz_value[2] + biz_value[3] + biz_value[4] + biz_value[5] + biz_value[6] + biz_value[7] + biz_value[8] ) % 10 ) ) % 10;
		   if (biz_value[9] != li_lastid) {
			    obj1.focus();
			    obj1.select();
			    return false;
		   }
		   else
		    	return true;
	 }
	 else {
		  obj1.focus();
		  obj1.select();
		  return false;
	 }
}
