
function validate_adm(Theform)
{
if((Theform.user_type.checked==false)&&(Theform.user_type1.checked==false)){
alert("Select the types of trainings you'd like to provide to PHII students on your facility");
Theform("user_type").focus();
return(false);
}

if(!check(Theform, 'Fname','First Name', 1, 30, 'characters','\' ', 'mandatory'))
		return(false);
if(!check(Theform, 'Lname','Last Name ', 1, 30, 'characters','\' ', 'mandatory'))
		return(false);
if(!check(Theform, 'DOB_MM','Date of Birth - Month', 3, 20, 'dropdown', 'mandatory'))
	return(false);	
if(!check(Theform, 'DOB_DD','Date of Birth - Day', 3, 20, 'dropdown', 'mandatory'))
	return(false);

if(!IsNumeric('User_id',Theform))
	return false;
		
//if(!check(Theform, 'DOB_YYYY','Date of Birth - Year', 3, 20, 'dropdown', 'mandatory'))
//	return(false);	
	
DOB_MM = Theform("DOB_MM").value;
DOB_DD = Theform("DOB_DD").value;
//DOB_YYYY = Theform("DOB_YYYY").value;

DOB = DOB_MM + "/" + DOB_DD //+ "/" + DOB_YYYY;

if(DOB_MM==2){
	//if (LeapYear(DOB_YYYY)) {
		if(DOB_DD>29){
			alert("Please enter valid Birth date...");
			Theform("DOB_DD").focus();
			return(false);
		}
	//}
	else {
		if(DOB_DD>28){
			alert("Please enter valid Birth date...");
			Theform("DOB_DD").focus();
			return(false);
		}
	}
}
else if(DOB_MM==4 | DOB_MM==6 | DOB_MM==9 | DOB_MM==11) {
	if (DOB_DD>30) {
		alert("Please enter valid Birth date...");
		Theform("DOB_DD").focus();
		return(false);
	}
}

if(!check(Theform, 'Email','Email Address', 5, 200, 'email', '_-', 'mandatory'))
		return(false);
if(!check(Theform, 'Phone','Phone', 5, 20, 'digits','ex- ()+_', 'mandatory'))
		return(false);
		if(!check(Theform, 'cell','Cell Phone', 5, 20, 'digits', 'ex- ()+_','optional'))
		return(false);
if(!check(Theform, 'fax','Fax no', 5, 20, 'digits', 'ex- ()+_','optional'))
		return(false);
if(!check(Theform, 'work','Work phone', 5, 20, 'digits', 'ex- ()+_','optional'))
		return(false);
if(!check(Theform, 'Address','Address', 5, 400, 'none', 'mandatory'))
		return(false); 
if(!check(Theform, 'City','City', 2, 50, 'characters', ' -_', 'mandatory'))
		return(false);	
if(Theform("country").value==0){
alert("please select country");
return(false);
}	
if(!check(Theform, 'State','State', 3, 20, 'dropdown', 'mandatory'))
	return(false);		
if(!check(Theform, 'Zip','Zip', 5, 10, 'characters', '1234567890 _-', 'mandatory'))
		return(false);

if(Theform('CmpEducationalBackground').value==""){
	alert("Educational Background field is required.");
	Theform('CmpEducationalBackground').focus();
	return(false);
}else if ( Theform('CmpEducationalBackground').value.length > 8000) {
	alert("Educational Background should not be more then 8000.");
	Theform('CmpEducationalBackground').focus();
	return(false);
}




if(Theform('CmpExperience').value==""){
		alert("Experience field is required.");
		Theform('CmpExperience').focus();
		return(false);
}else if ( Theform('CmpExperience').value.length > 8000) {
	alert("Professional Experience should not be more then 8000.");
	Theform('CmpExperience').focus();
	return(false);
}


if (Theform('ExistingUser_Type').value == "") {
	if(!check(Theform, 'User_id','User id', 4, 70, 'characters', '1234567890_', 'mandatory'))
			return(false);
	if(!check(Theform, 'Password','Password', 6, 15, 'characters', '1234567890', 'mandatory'))
			return(false);
	if(!check(Theform, 'A_Password','Re-type Password ', 6, 15, 'characters', '1234567890', 'mandatory'))
			return(false);
	if (Theform.Password.value != Theform.A_Password.value) {
		alert("Given passwords do not match. Please re-type your password and then try again.");
		return(false);
	}
	}	
Theform.action = 'Agreement.asp';
Theform.submit();
return(true);
}		

