function gi_list_off()
{
	document.getElementById("id_gi_list").style.display="none";
}

function gi_list_on()
{
	document.getElementById("id_gi_list").style.display="";
}

function offense_1(str)
{
	
	if(str=='y')
	{
		document.getElementById("id_offense_3").style.display="";
		document.getElementById("id_offense_2").style.display="";
		document.getElementById("id_offense_1").style.display="";
	}
	else
	{
		
		document.getElementById("id_offense_3").style.display="none";
		document.getElementById("id_offense_2").style.display="none";
		document.getElementById("id_offense_1").style.display="none";
	}
}

function off_1(str)
{
	
	if(str=='y')
	{
		document.getElementById("abc3").style.display="";
		document.getElementById("abc2").style.display="";
		document.getElementById("abc1").style.display="";
	}
	else
	{
		
		document.getElementById("abc3").style.display="none";
		document.getElementById("abc2").style.display="none";
		document.getElementById("abc1").style.display="none";
	}
}
function off_2(str)
{
	
	if(str=='y')
	{
		document.getElementById("abc23").style.display="";
		document.getElementById("abc22").style.display="";
		document.getElementById("abc21").style.display="";
	}
	else
	{
		
		document.getElementById("abc23").style.display="none";
		document.getElementById("abc22").style.display="none";
		document.getElementById("abc21").style.display="none";
	}
}
function off_3(str)
{
	
	if(str=='y')
	{
		document.getElementById("abc33").style.display="";
		document.getElementById("abc32").style.display="";
		document.getElementById("abc31").style.display="";
	}
	else
	{
		
		document.getElementById("abc33").style.display="none";
		document.getElementById("abc32").style.display="none";
		document.getElementById("abc31").style.display="none";
	}
}
function dl_statee(str)
{
	if(str=='y')
	{
		document.getElementById("id_dl_state").style.display="";
		document.getElementById("id_dl").style.display="";
		
	}
	else
	{
		
		document.getElementById("id_dl_state").style.display="none";
		document.getElementById("id_dl").style.display="none";
	}
}
function hschange(str)
{
	if(str=='y')
	{
		document.getElementById("hsline1").style.display="none";
		document.getElementById("hsline2").style.display="none";

		document.getElementById("hss1").style.display="";
		document.getElementById("hss2").style.display="";
		document.getElementById("hss3").style.display="";
		document.getElementById("hss4").style.display="";
		document.getElementById("hss5").style.display="";
		document.getElementById("hss6").style.display="";
		
	}
	else
	{
		document.getElementById("hsline1").style.display="";
		document.getElementById("hsline2").style.display="";
		document.getElementById("hss1").style.display="none";
		document.getElementById("hss2").style.display="none";
		document.getElementById("hss3").style.display="none";
		document.getElementById("hss4").style.display="none";
		document.getElementById("hss5").style.display="none";
		document.getElementById("hss6").style.display="none";
	}
	
}

function tcertificateoff()
{
	
	document.getElementById("id_lic_texas").style.display="none";
}

function tcertificateon()
{
	document.getElementById("id_lic_texas").style.display="";
	
}

function certificateoff()
{
	document.getElementById("lic_type").style.display="none";
	document.getElementById("lic_number").style.display="none";
	document.getElementById("lic_year").style.display="none";
	
}

function certificateon()
{
	
	document.getElementById("lic_type").style.display="";
	document.getElementById("lic_number").style.display="";
	document.getElementById("lic_year").style.display="";
}

function wish_exp_on()
{
	document.getElementById("wish_exp_id").style.display="";
	
}

function wish_exp_off()
{
	document.getElementById("wish_exp_id").style.display="none";
	
}

function Trim(TRIM_VALUE)
{
	if(TRIM_VALUE.length < 1){

	return"";
}

	TRIM_VALUE = RTrim(TRIM_VALUE);

	TRIM_VALUE = LTrim(TRIM_VALUE);

	if(TRIM_VALUE==""){

		return "";

	}

	else{

		return TRIM_VALUE;

	}

} //End Function

function RTrim(VALUE){

var w_space = String.fromCharCode(32);

var v_length = VALUE.length;

var strTemp = "";

if(v_length < 0){

return"";

}

var iTemp = v_length -1;

while(iTemp > -1){

if(VALUE.charAt(iTemp) == w_space){

}

else{

strTemp = VALUE.substring(0,iTemp +1);

break;

}

iTemp = iTemp-1;

} //End While

return strTemp;

} //End Function

function LTrim(VALUE){

var w_space = String.fromCharCode(32);

if(v_length < 1){

return"";

}

var v_length = VALUE.length;

var strTemp = "";

var iTemp = 0;

while(iTemp < v_length){

if(VALUE.charAt(iTemp) == w_space){

}

else{

strTemp = VALUE.substring(iTemp,v_length);

break;

}

iTemp = iTemp + 1;

} //End While

return strTemp;

} //End Function

function checkRef()
{

	if(document.references.name1.value=="")
	{
		alert('At least two references are required.');
		document.references.name1.focus();
		return false;
	}
	
	if(document.references.organization1.value=="")
	{
		alert('At least two references are required.');
		document.references.organization1.focus();
		return false;
	}
	
	if(document.references.relationship1.value=="")
	{
		alert('At least two references are required.');
		document.references.relationship1.focus();
		return false;
	}
	
	if(document.references.name2.value=="")
	{
		alert('At least two references are required.');
		document.references.name2.focus();
		return false;
	}
	
	if(document.references.organization2.value=="")
	{
		alert('At least two references are required.');
		document.references.organization2.focus();
		return false;
	}
	
	if(document.references.relationship2.value=="")
	{
		alert('At least two references are required.');
		document.references.relationship2.focus();
		return false;
	}
	
}

function checkGen()
{
	myOption = -1;
	for (i=0; i<general.appliedbefore.length; i++) 
	{
		if (general.appliedbefore[i].checked) 
		{
			myOption = i;
		}
	}
 
	if (myOption == -1) 
	{
		alert("You must indicate if you have previously applied at OakBend Medical Center.");
		return false;
	}
	
	if(document.general.usa.value=="")
	{
		alert('Please indicate if you are eligible to work in the USA.');
		document.general.age.focus();
		return false;
	}
	
	if(document.general.identify.value=="")
	{
		alert('Please indicate if you are able to provide verification of eligibility.');
		document.general.age.focus();
		return false;
	}
	
	if(document.general.felony.value=="")
	{
		alert('Please indicate if you have been convicted.');
		document.general.felony.focus();
		return false;
	}
	
	if(document.general.discharged.value=="")
	{
		alert('Please indicate if you have been discharged or suspended from a previous position.');
		document.general.discharged.focus();
		return false;
	}
	
	if(document.general.prevemp.value=="")
	{
		alert('Please indicate if you have been previously employed by OakBend Medical Center.');
		document.general.age.focus();
		return false;
	}
	
	if(document.general.famemp.value=="")
	{
		alert('Please indicate if you have any relatives working at OakBend Medical Center.');
		document.general.age.focus();
		return false;
	}
	
	if(document.general.madverse.value=="")
	{
		alert('Please indicate if you ever had any adverse legal actions imposed by Medicare, Medicaid, or any other federal agency or program.');
		document.general.age.focus();
		return false;
	}
}

function checkOther()
{
//APPLICATION OTHER INFO
		
	var obj1=otherskills.txdl.value;
	
		
	if(!document.otherskills.certtype.value=="")

	{
		if(Trim(document.otherskills.certno.value)=="")
		{
			alert('Please enter your certification or license number.');
			document.otherskills.certno.focus();
			return false;
		}
		
		if(document.otherskills.certstate.value=="0")
		{
			alert('Please enter the state of certification');
			document.otherskills.certno.focus();
			return false;
		}
		
		if(Trim(document.otherskills.yearexp.value)=="")
		{
			alert('Please enter expiration date of your certification.');
			document.otherskills.yearexp.focus();
			return false;
		}
		
	}
	if(document.otherskills.notlic[0].checked==true)
	{
	if(document.otherskills.txdl.value=="0")
	{
		alert('Please indicate if you have a Drivers License.');
		document.otherskills.yearexp.focus();
		return false;
	}
	}
	if (obj1 == 'y')
	{
		if(document.otherskills.dlno.value=="")
		{
			alert('Please enter your TXDL number.');
			document.otherskills.dlno.focus();
			return false;
		}		
	}
	
	myOption = -1;
	for (i=0; i<otherskills.medcond.length; i++) 
	{
		if (otherskills.medcond[i].checked) 
		{
			myOption = i;
		}
	}
 
	if (myOption == -1) 
	{
		alert("You select yes or no to indicate your medical condition status.");
		return false;
	}
}

function careersCollege()
{
//APPLICATION COLLEGE INFO
		
	var obj1=collegeinfo.ctype.value;
	
		
	if(obj1 == '1')
	{
		if(Trim(document.collegeinfo.cname.value)=="")
		{
			alert('Please enter the school name.');
			document.collegeinfo.cname.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.cstreet.value)=="")
		{
			alert('Please enter the street name.');
			document.collegeinfo.cstreet.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.ccity.value)=="")
		{
			alert('Please enter the city name.');
			document.collegeinfo.ccity.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.cstate.value)=="0")
		{
			alert('Please select the state name.');
			document.collegeinfo.ccity.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.czip.value)=="")
		{
			alert('Please enter the zip code.');
			document.collegeinfo.czip.focus();
			return false;
		}	

		if(document.collegeinfo.czip.value!="")
		{
			if(isNaN(document.collegeinfo.czip.value))
			{
				alert('Please enter the valid zip code.');
				document.collegeinfo.czip.focus();
				return false;
			}	
		}
		
		if(Trim(document.collegeinfo.chours.value)=="")
		{
			alert('Please enter your degree hours.');
			document.collegeinfo.chours.focus();
			return false;
		}	
			
		if(Trim(document.collegeinfo.cskill.value)=="")
		{
			alert('Please enter your major or skill.');
			document.collegeinfo.cskill.focus();
			return false;
		}	
	}
	
	if(obj1 == '2')
	{
		if(Trim(document.collegeinfo.cname1.value)=="")
		{
			alert('Please enter the school name.');
			document.collegeinfo.cname1.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.cstreet1.value)=="")
		{
			alert('Please enter the street name.');
			document.collegeinfo.cstreet1.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.ccity1.value)=="")
		{
			alert('Please enter the city name.');
			document.collegeinfo.ccity1.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.cstate1.value)=="0")
		{
			alert('Please select the state name.');
			document.collegeinfo.ccity1.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.czip1.value)=="")
		{
			alert('Please enter the zip code.');
			document.collegeinfo.czip1.focus();
			return false;
		}	

		if(document.collegeinfo.czip1.value!="")
		{
			if(isNaN(document.collegeinfo.czip1.value))
			{
				alert('Please enter the valid zip code.');
				document.collegeinfo.czip1.focus();
				return false;
			}	
		}
		
		if(Trim(document.collegeinfo.chours1.value)=="")
		{
			alert('Please enter your degree hours.');
			document.collegeinfo.chours1.focus();
			return false;
		}	
			
		if(Trim(document.collegeinfo.cskill1.value)=="")
		{
			alert('Please enter your major or skill.');
			document.collegeinfo.cskill1.focus();
			return false;
		}	
	}
	
	if(obj1 == '3')
	{
		if(Trim(document.collegeinfo.branch.value)=="")
		{
			alert('Please enter the military branch.');
			document.collegeinfo.branch.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.highestrank.value)=="")
		{
			alert('Please enter your highest rank.');
			document.collegeinfo.highestrank.focus();
			return false;
		}	
		
	}
	
	if(obj1 == '4')
	{
		if(Trim(document.collegeinfo.cname2.value)=="")
		{
			alert('Please enter the school name.');
			document.collegeinfo.cname2.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.cstreet2.value)=="")
		{
			alert('Please enter the street name.');
			document.collegeinfo.cstreet2.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.ccity2.value)=="")
		{
			alert('Please enter the city name.');
			document.collegeinfo.ccity2.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.cstate2.value)=="0")
		{
			alert('Please select the state name.');
			document.collegeinfo.ccity2.focus();
			return false;
		}	
		
		if(Trim(document.collegeinfo.czip2.value)=="")
		{
			alert('Please enter the zip code.');
			document.collegeinfo.czip2.focus();
			return false;
		}	

		if(document.collegeinfo.czip2.value!="")
		{
			if(isNaN(document.collegeinfo.czip2.value))
			{
				alert('Please enter the valid zip code.');
				document.collegeinfo.czip2.focus();
				return false;
			}
		}
		
		if(Trim(document.collegeinfo.chours2.value)=="")
		{
			alert('Please enter your degree hours.');
			document.collegeinfo.chours2.focus();
			return false;
		}	
			
		if(Trim(document.collegeinfo.cskill2.value)=="")
		{
			alert('Please enter your major or skill.');
			document.collegeinfo.cskill2.focus();
			return false;
		}	
	}
}

function careersHS()
{
//APPLICATION HIGHSCHOOL INFO
		
		var obj1=highschoolinfo.gradhighschool.value;
		
		if(Trim(document.highschoolinfo.gradhighschool.value)=="")
		{
			alert('Please indicate if you graduated highschool.');
			document.highschoolinfo.highestgrade.focus();
			return false;
		}	
		
		if (obj1 == 'n')
		{
			if(Trim(document.highschoolinfo.ged.value)=="")
			{
				//alert('Please indicate if you passed the GED.');
				//document.highschoolinfo.highestgrade.focus();
				//return false;
			}	
		
		}
		
}


function checkEE()
{
//EMPLOYMENT INFO

	var obj1=workexp.ename.value;
	var obj2=workexp.sdate.value;
	var obj3=workexp.edate.value;
	
	if (obj1 != '')
	{
		myOption = -1;
		for (i=0; i<workexp.econtact.length; i++) 
		{
			if (workexp.econtact[i].checked) 
			{
				myOption = i;
			}
		}
	 
		if (myOption == -1) 
		{
			alert("You must indicate whether we may contact your employer or not.");
			workexp.ephone.focus();
			return false;
		}
	}
	else
	{
	
		//alert("You must enter at least one previous employer or not applicable.");
		//workexp.ename.focus();
		//return false;
	
	}
	
	if (obj2 == "" && obj1 != "")
	{
		alert ("Please enter a valid date.")
		workexp.sdate.focus();
		return false;
	}
	
	


}

function checkEE2()
{
	var obj1=workexp.ename.value;
	var obj2=workexp.sdate.value;
	var obj3=workexp.edate.value;
	
	
	if (obj2 == "" && obj1 != "")
	{
		alert ("Please enter a valid date.")
		workexp.sdate.focus();
		return false;
	}
	
	if (obj3 == "" && obj1 != "")
	{
		alert ("Please enter a valid date.")
		workexp.edate.focus();
		return false;
	}

}

function checkTerms()
{
	if (!final.terms.checked)
	{
		alert('You must agree to the above statements to continue');
		return false;
	}	
	
	if (!final.terms1.checked)
	{
		alert('You must agree to the terms of service and regulations');
		return false;
	}
	
	if(document.final.bname.value=="")
	{
		alert('Please enter your name and aliases.');
		document.final.bname.focus();
		return false;
	}	
	
	if(document.final.bssn.value=="")
	{
		alert('Please enter your social security number.');
		document.final.bssn.focus();
		return false;
	}
	
	if(document.final.bssn.value!="")
	{
		if(document.final.bssn.value.length!=9)
		{
			alert('Please enter valid social security number.');
			document.final.bssn.focus();
			return false;
		}
	}
	
	if(document.final.bdl.value=="")
	{
		alert('Please enter your drivers license number.');
		document.final.bdl.focus();
		return false;
	}	
	
	if(document.final.bdob.value=="")
	{
		alert('Please enter your date of birth.');
		document.final.bdob.focus();
		return false;
	}	
	
	if(document.final.badd.value=="")
	{
		alert('Please enter your addresses.');
		document.final.badd.focus();
		return false;
	}	
		
	if(document.final.bother.value=="")
	{
		alert('Please enter other cities and states.');
		document.final.bother.focus();
		return false;
	}	
	
	if (!final.brelease.checked)
	{
		alert('You must authorize your background check to proceed');
		return false;
	}
	
}

function swapDon(nm)
{
	var nm;
	
	var obj1=document.getElementById("individual");
	var obj2=document.getElementById("corp");
	
	if(nm == 1)
	{
	 	obj1.style.visibility="visible"; 
	 	obj1.style.display="";	
	 	obj2.style.visibility="hidden"; 
	 	obj2.style.display="none";	 	
	}
	
	if(nm == 2)
	{
		obj1.style.visibility="hidden"; 
	 	obj1.style.display="none";	
	 	obj2.style.visibility="visible"; 
	 	obj2.style.display="";		
	}				
}

function showOther(nm)
{
	var nm;
	
	var obj1=document.getElementById("other");	
	
	if(nm == 1)
	{
	 	obj1.style.visibility="visible"; 
	 	obj1.style.display="";		 	
	}	
	
	if(nm == 2)
	{
	 	obj1.style.visibility="hidden"; 
	 	obj1.style.display="none";		 	
	}	
		
}

function showOther2(nm)
{
	var nm;
	
	var obj1=document.getElementById("other2");	
	
	if(nm == 1)
	{
	 	obj1.style.visibility="visible"; 
	 	obj1.style.display="";		 	
	}	
	
	if(nm == 2)
	{
	 	obj1.style.visibility="hidden"; 
	 	obj1.style.display="none";		 	
	}	
		
}

function copyBilling()
{
	if (donation.billing.checked)
	{
		document.donation.billingaddress1.value = document.donation.address1.value;
		document.donation.billingaddress2.value = document.donation.address2.value;
		document.donation.billingzip.value = document.donation.zip.value;
	}
}

function checkDonation()
{
//DONATION INFO

	myOption = -1;
	for (i=0; i<donation.giftfrom.length; i++) 
	{
		if (donation.giftfrom[i].checked) 
		{
			myOption = i;
		}
	}
 
	if (myOption == -1) 
	{
		alert("You must select individual or corporation.");
		return false;
	}
	
	if (donation.giftfrom[myOption].value == 'individual')
	{
		if(donation.firstname.value=="")
			{
				alert('Please enter your first name.');
				donation.firstname.focus();
				return false;
			}	
			
			if(donation.lastname.value=="")
			{
				alert('Please enter your last name.');
				donation.lastname.focus();
				return false;
			}	
	
	}
	
	//IF CORPORATION
	
	if (donation.giftfrom[myOption].value == 'corporate')
	{	
			if(donation.corporation.value=="")
			{
				alert('Please enter your corporation name.');
				donation.corporation.focus();
				return false;
			}
	}

	myOption2 = -1;
	for (b=0; b<donation.joint.length; b++) 
	{
		if (donation.joint[b].checked) 
		{
			myOption2 = b;
		}
	}
 
	if (myOption2 == -1) 
	{
		alert("You must a joint donation option.");
		return false;
	}


		
	//REG FORM VALIDATION
	
			if(donation.email.value=="")
			{
				alert('Please enter your email address.');
				donation.email.focus();
				return false;
			}	
			
			  if(!emailCheck(donation.email.value))
			  {
			     alert("Email is in an invalid format - Please RE-Enter");
			     donation.email.focus();
			     return false;
			  }
			  
			 
			if(document.donation.phone.value=="")
			{
				alert('Please enter your phone number.');
				document.donation.phone.focus();
				return false;
			}	
			
			if(document.donation.address1.value=="")
			{
				alert('Please enter your address.');
				document.donation.address1.focus();
				return false;
			}	
			
			if(document.donation.city.value=="")
			{
				alert('Please enter the billing city.');
				document.donation.city.focus();
				return false;
			}	
			
			if(document.donation.state.value=="")
			{
				alert('Please select the billing state.');
				document.donation.city.focus();
				return false;
			}	
			
			if(document.donation.zip.value=="")
			{
				alert('Please enter the billing zip code.');
				document.donation.zip.focus();
				return false;
			}	
			
			if(document.donation.country.value=="")
			{
				alert('Please select your country.');
				document.donation.zip.focus();
				return false;
			}
	
	myOption3 = -1;
	for (c=0; c<donation.giftfor.length; c++) 
	{
		if (donation.giftfor[c].checked) 
		{
			myOption3 = c;
		}
	}
 
		if (myOption3 == -1) 
		{
			alert("You must designate the use of your gift.");
			return false;
		}

	if (donation.giftfor[myOption].value == 'researchspecific')
	{
		if(document.donation.otherprogram.value=="")
		{
			alert('Please enter the program name.');
			document.donation.otherprogram.focus();
			return false;
		}	

	}	
	
	myOption4 = -1;
	for (d=0; d<donation.giftamt.length; d++) 
	{
		if (donation.giftamt[d].checked) 
		{
			myOption4 = d;
		}
	}
 
		if (myOption4 == -1) 
		{
			alert("You must designate the amount of your gift.");
			return false;
		}
		
	if (donation.otheramount[myOption].value == 'amount')
	{
		if(document.donation.otheramount.value=="")
		{
			alert('Please enter the program name.');
			document.donation.otheramount.focus();
			return false;
		}	
	}	
		  if(document.donation.ccno.value=="")
		{
			alert('Please enter your credit card number.');
			document.donation.ccno.focus();
			return false;
		}	
		
		if(document.donation.expdate.value=="")
		{
			alert('Please enter your credt card expiration date.');
			document.donation.expdate.focus();
			return false;
		}	
		
		if(document.donation.cvv.value=="")
		{
			alert('Please enter your credit card security code.');
			document.donation.cvv.focus();
			return false;
		}	


	donation.submit(); 

}	





function checkPayment()
{
//BILLING INFO

		if(document.billinginfo.firstname.value=="")
		{
			alert('Please enter the billing first name.');
			document.billinginfo.firstname.focus();
			return false;
		}	
		
		if(document.billinginfo.lastname.value=="")
		{
			alert('Please enter the billing last name.');
			document.billinginfo.lastname.focus();
			return false;
		}	
		
		if(document.billinginfo.address.value=="")
		{
			alert('Please enter the billing address.');
			document.billinginfo.address.focus();
			return false;
		}	
		
		if(document.billinginfo.city.value=="")
		{
			alert('Please enter the billing city.');
			document.billinginfo.city.focus();
			return false;
		}	
		
		if(document.billinginfo.state.value=="")
		{
			alert('Please select the billing state.');
			document.billinginfo.city.focus();
			return false;
		}	
		
		if(document.billinginfo.zip.value=="")
		{
			alert('Please enter the billing zip code.');
			document.billinginfo.zip.focus();
			return false;
		}	
		
		if(document.billinginfo.phone.value=="")
		{
			alert('Please enter the billing phone number.');
			document.billinginfo.phone.focus();
			return false;
		}	
		
		if(document.billinginfo.email.value=="")
		{
			alert('Please enter your email address.');
			document.billinginfo.email.focus();
			return false;
		}	
		
		  if(!emailCheck(billinginfo.email.value))
		  {
		     alert("Email is in an invalid format - Please RE-Enter");
		     billinginfo.email.focus();
		     return false;
		  }
		  
		  if(document.billinginfo.ccno.value=="")
		{
			alert('Please enter your credit card number.');
			document.billinginfo.ccno.focus();
			return false;
		}	
		
		if(document.billinginfo.expdate.value=="")
		{
			alert('Please enter your credt card expiration date.');
			document.billinginfo.expdate.focus();
			return false;
		}	
		
		if(document.billinginfo.cvv.value=="")
		{
			alert('Please enter your credit card security code.');
			document.billinginfo.cvv.focus();
			return false;
		}	
		
		return true();
}

function checkEcard()
{
//ECARDS

		if(document.ecard.patientname.value=="")
		{
			alert('Please enter the patient\'s name.');
			document.ecard.patientname.focus();
			return false;
		}	

		if(document.ecard.fromemail.value=="")
		{
			alert('Please enter your email address.');
			document.ecard.fromemail.focus();
			return false;
		}
		
}

function checkVol()
{
//VOLUNTEERS

		if(document.personalinfo.name.value=="")
		{
			alert('Please enter your name.');
			document.personalinfo.name.focus();
			return false;
		}	

		if(document.personalinfo.address1.value=="")
		{
			alert('Please enter your home address.');
			document.personalinfo.address1.focus();
			return false;
		}
		if(document.personalinfo.phone.value=="")
		{
			alert('Please enter your home phone number.');
			document.personalinfo.phone.focus();
			return false;
		}	
}
function careersPer()
{
//APPLICATION PERSONAL INFO
		var dt = new Date();
//var y  = dt.getYear();
//alert(dt);
		if(Trim(document.personalinfo.lastname.value)=="")
		{
			alert('Please enter your last name.');
			document.personalinfo.lastname.focus();
			return false;
		}	

		if(Trim(document.personalinfo.firstname.value)=="")
		{
			alert('Please enter your firstname.');
			document.personalinfo.firstname.focus();
			return false;
		}	
		
		if(document.personalinfo.ssn.value=="")
		{
			alert('Please enter your Social Security Number.');
			document.personalinfo.ssn.focus();
			return false;
		}
		
		if(Trim(document.personalinfo.address1.value)=="")
		{
			alert('Please enter your address.');
			document.personalinfo.address1.focus();
			return false;
		}
		
		if(Trim(document.personalinfo.city.value)=="")
		{
			alert('Please enter your city.');
			document.personalinfo.city.focus();
			return false;
		}
		
		if(Trim(document.personalinfo.state.value)=="0")
		{
			alert('Please select your state.');
			document.personalinfo.city.focus();
			return false;
		}
		
		if(Trim(document.personalinfo.zip.value)=="")
		{
			alert('Please enter your zip code.');
			document.personalinfo.zip.focus();
			return false;
		}

		if(document.personalinfo.zip.value!="")
		{
			if(isNaN(document.personalinfo.zip.value))
			{
				alert('Please enter valid zip code.');
				document.personalinfo.zip.focus();
				return false;
			}
		}
		
		if(Trim(document.personalinfo.phone.value)=="")
		{
			alert('Please enter your home phone.');
			document.personalinfo.phone.focus();
			return false;
		}

		if(document.personalinfo.phone.value!="")
		{
			if(isNaN(document.personalinfo.phone.value))
			{
				alert('Please enter valid home phone.');
				document.personalinfo.phone.focus();
				return false;
			}
		}
		
		if(document.personalinfo.dayphone.value=="")
		{
			alert('Please enter your day phone.');
			document.personalinfo.dayphone.focus();
			return false;
		}

		if(document.personalinfo.dayphone.value!="")
		{
			if(isNaN(document.personalinfo.dayphone.value))
			{
				alert('Please enter valid day phone.');
				document.personalinfo.dayphone.focus();
				return false;
			}
		}
		
		//VALIDATE AVAILABLE FOR
		
		if (!personalinfo.fulltime.checked && !personalinfo.parttime.checked && !personalinfo.summer.checked && !personalinfo.floatshift.checked)
		{
			
			alert('You enter at least one value for availability.');
			return false;
		}
			
		if(document.personalinfo.dateavail.value=="")
		{
			alert('Please enter the date you are available for work.');
			document.personalinfo.dateavail.focus();
			return false;
		}
		
		if(document.personalinfo.referredby.value=="")
		{
			alert('How were you referred to OakBend Medical Center?');
			document.personalinfo.referredby.focus();
			return false;
		}
		
}

function copyEm()
{
	
	
	if (contact.same.checked)
	{
		document.contact.kname.value = document.contact.emname.value;
		document.contact.krelation.value = document.contact.emrelation.value;
		document.contact.kaddress1.value = document.contact.emaddress1.value;
		document.contact.kaddress2.value = document.contact.emaddress2.value;
		document.contact.kcity.value = document.contact.emcity.value;
		document.contact.kstate.value = document.contact.emstate.value;
		document.contact.kzip.value = document.contact.emzip.value;
		document.contact.kphone.value = document.contact.emphone.value;
		document.contact.kwkphone.value = document.contact.emwkphone.value;
	}
}




function valbutton(thisform) {
// place any other field validations that you require here
// validate myradiobuttons
myOption = -1;
for (i=thisform.prev.length-1; i > -1; i--) {
if (thisform.prev[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("You must select an answer.");
return false;
}

	if (thisform.prev[myOption].value == 'y');
	{
		myOption = -1;
		for (i=thisform.contactchange.length-1; i > -1; i--) {
		if (thisform.contactchange[i].checked) {
		myOption = i; i = -1;
		}
		}
		if (myOption == -1) {
		alert("You must select an answer.");
		return false;
	}

}
// place any other field validations that you require here
thisform.submit(); // this line submits the form after validation
}

function checkPatient()
{

//PATIENT INFO

	
		if(document.patientinfo.firstname.value=="")
		{
			alert('Please enter your firstname.');
			document.patientinfo.firstname.focus();
			return false;
		}	
		if(document.patientinfo.lastname.value=="")
		{
			alert('Please enter your lastname.');
			document.patientinfo.lastname.focus();
			return false;
		}	
		if(document.patientinfo.marital_status.value=="")
		{
			alert('Please select your marital status.');
			document.patientinfo.lastname.focus();
			return false;
		}	
		if(document.patientinfo.race.value=="")
		{
			alert('Please enter your race.');
			document.patientinfo.race.focus();
			return false;
		}	
		if(document.patientinfo.month.value=="")
		{
			alert('Please select your birth month.');
			document.patientinfo.race.focus();
			return false;
		}	
		if(document.patientinfo.day.value=="")
		{
			alert('Please select your birth day.');
			document.patientinfo.race.focus();
			return false;
		}	
		if(document.patientinfo.year.value=="")
		{
			alert('Please select your birth year.');
			document.patientinfo.race.focus();
			return false;
		}	
		if(document.patientinfo.address1.value=="")
		{
			alert('Please enter street address.');
			document.patientinfo.address1.focus();
			return false;
		}	
		if(document.patientinfo.city.value=="")
		{
			alert('Please enter city.');
			document.patientinfo.city.focus();
			return false;
		}
		if(document.patientinfo.state.value=="")
		{
			alert('Please enter your state.');
			document.patientinfo.address1.focus();
			return false;
		}	
		if(document.patientinfo.zip.value=="")
		{
			alert('Please enter your zip code.');
			document.patientinfo.zip.focus();
			return false;
		}	
		if(document.patientinfo.phone.value=="")
		{
			alert('Please enter your phone number.');
			document.patientinfo.phone.focus();
			return false;
		}	
		
		if(document.patientinfo.employer.value=="")
		{
			alert('Please enter employer.');
			document.patientinfo.employer.focus();
			return false;
		}	
		
		if(document.patientinfo.eaddress1.value=="")
		{
			alert('Please enter your employer street address.');
			document.patientinfo.eaddress1.focus();
			return false;
		}	
		if(document.patientinfo.ecity.value=="")
		{
			alert('Please enter city.');
			document.patientinfo.ecity.focus();
			return false;
		}
		if(document.patientinfo.state.value=="")
		{
			alert('Please enter your employer state.');
			document.patientinfo.eaddress1.focus();
			return false;
		}	
		if(document.patientinfo.ezip.value=="")
		{
			alert('Please enter your employer zip code.');
			document.patientinfo.ezip.focus();
			return false;
		}	
		if(document.patientinfo.ephone.value=="")
		{
			alert('Please enter your employer phone number.');
			document.patientinfo.ephone.focus();
			return false;
		}
	
	return(patientinfo.action='patient_registration.php?pageid=false&frompageid=otherskills&link_id=124&tertiary=true');
	
}



function checkContact()
{

//PATIENT INFO

	if(document.contact.emname.value=="")
	{
		alert('Please enter contact name.');
		document.contact.emname.focus();
		return false;
	}	
	if(document.contact.emrelation.value=="")
	{
		alert('Please enter relationship to patient.');
		document.contact.emrelation.focus();
		return false;
	}	
	if(document.contact.emaddress1.value=="")
	{
		alert('Please enter contact address.');
		document.contact.emaddress1.focus();
		return false;
	}	
	if(document.contact.emcity.value=="")
	{
		alert('Please enter contact city.');
		document.contact.emcity.focus();
		return false;
	}	
	if(document.contact.emstate.value=="")
	{
		alert('Please select contact state.');
		document.contact.emcity.focus();
		return false;
	}	
	if(document.contact.emzip.value=="")
	{
		alert('Please enter contact zip code.');
		document.contact.emzip.focus();
		return false;
	}	
	if(document.contact.emphone.value=="")
	{
		alert('Please enter contact phone.');
		document.contact.emphone.focus();
		return false;
	}	
	if(document.contact.emwkphone.value=="")
	{
		alert('Please enter contact work phone.');
		document.contact.emwkphone.focus();
		return false;
	}	
	if(document.contact.kname.value=="")
	{
		alert('Please contact name.');
		document.contact.kname.focus();
		return false;
	}	
	if(document.contact.krelation.value=="")
	{
		alert('Please enter relationship to patient.');
		document.contact.krelation.focus();
		return false;
	}	
	if(document.contact.kaddress1.value=="")
	{
		alert('Please enter contact address.');
		document.contact.kaddress1.focus();
		return false;
	}	
	if(document.contact.kcity.value=="")
	{
		alert('Please enter contact city.');
		document.contact.kcity.focus();
		return false;
	}	
	
	if(document.contact.kstate.value=="")
	{
		alert('Please select contact state.');
		document.contact.kcity.focus();
		return false;
	}	
	
	if(document.contact.kzip.value=="")
	{
		alert('Please enter contact zip code.');
		document.contact.kzip.focus();
		return false;
	}	
	if(document.contact.kphone.value=="")
	{
		alert('Please enter contact phone.');
		document.contact.kphone.focus();
		return false;
	}	
	if(document.contact.kwkphone.value=="")
	{
		alert('Please enter contact work phone.');
		document.contact.kwkphone.focus();
		return false;
	}	
	return(contact.action='patient_registration.php?pageid=false&frompageid=general&link_id=124&tertiary=true');
	
}

function checkInsurance()
{

//INSURANCE INFO

	if(document.references.ins1address1.value=="")
	{
		alert('Please enter the insurance company address.');
		document.references.ins1address1.focus();
		return false;
	}	
	if(document.references.ins1city.value=="")
	{
		alert('Please enter the insurance company city.');
		document.references.ins1city.focus();
		return false;
	}	
	if(document.references.ins1state.value=="")
	{
		alert('Please select insurance company state.');
		document.references.ins1city.focus();
		return false;
	}	
	if(document.references.ins1zip.value=="")
	{
		alert('Please enter insurance company zip code.');
		document.references.ins1zip.focus();
		return false;
	}	

	return(references.action='patient_registration.php?skip=true&pageid=false&frompageid=references&link_id=124&tertiary=true');
	
}


function swapPatient(nm)
{
	var nm;
	
	var obj1=document.getElementById("1");
	var obj2=document.getElementById("2");

	
	if(nm == 1)
	{
	 	obj1.style.visibility="visible"; 
	 	obj1.style.display="";	
	 	obj2.style.visibility="visible"; 
	 	obj2.style.display="";	 	
	}
	
	if(nm == 2)
	{
		obj1.style.visibility="hidden"; 
	 	obj1.style.display="none";	
	 	obj2.style.visibility="hidden"; 
	 	obj2.style.display="none";		
	}			
	
}

function swapPatient2(nm)
{
	var nm;
	
	var obj1=document.getElementById("3");

	
	if(nm == 1)
	{
	 	obj1.style.visibility="visible"; 
	 	obj1.style.display="";	 	
	}
	
	if(nm == 2)
	{
		obj1.style.visibility="hidden"; 
	 	obj1.style.display="none";		
	}			
	
}

