function showDate(){
//Date object
		var d=new Date()
		var month=d.getMonth()
		var m=month+1
		var day=d.getDate()
		var year=d.getFullYear()
	
		document.Employment.t141.value=m+"/"+day+"/"+year;
		document.Employment.t145.value=m+"/"+day+"/"+year;

		}


//This function duplicates ssn number into signature section

//	function showSSN(){
//	var SSN="";
//	SSN=document.Employment.t17.value;
//	document.Employment.t143.value=SSN;
//	document.Employment.t147.value=SSN;

//	}




	function checkForm(){
		page_one=true;
		
		var at=window.document.getElementById("email").value.indexOf("@")
		var dot=window.document.getElementById("email").value.indexOf(".")
			if (window.document.Employment.email.value==""){
  				//empty email field
				page_one=false;
				document.Employment.email.style.backgroundColor="red";
  				} else{
           				 if (at==-1 || dot==-1)
                      		{
                       		 alert("Not a valid e-mail!")
							 document.Employment.email.style.backgroundColor="red";
                        		page_one=false;
                      		}
        		}
		
		
			if (document.Employment.t1.value=="") {
				
				document.Employment.t1.style.backgroundColor="red";
				page_one=false;
				

			}

			if(document.Employment.t9.value==""){
				document.Employment.t9.style.backgroundColor="red";
				page_one=false;
			}	
			
			if(document.Employment.t10.value==""){
				document.Employment.t10.style.backgroundColor="red";
				page_one=false;
			}


			if(document.Employment.t12.value==""){
				document.Employment.t12.style.backgroundColor="red";
				page_one=false;
			}

			if(document.Employment.t13.value==""){
				document.Employment.t13.style.backgroundColor="red";
				page_one=false;
			}

			if(document.Employment.t14.value==""){
				document.Employment.t14.style.backgroundColor="red";
				page_one=false;
			}

			if(document.Employment.t15.value==""){
				document.Employment.t15.style.backgroundColor="red";
				page_one=false;
			}
			
		//	if(document.Employment.t17.value==""){
		//		document.Employment.t17.style.backgroundColor="red";
		//		page_one=false;
		//	}

			

			if(document.Employment.t20.value==""){
				document.Employment.t20.style.backgroundColor="red";
				page_one=false;
			}

			if(document.Employment.t21.checked || document.Employment.t22.checked || document.Employment.t23.checked){
				//Submit true
			}
			else{
				document.Employment.t21.style.backgroundColor="red";
				document.Employment.t22.style.backgroundColor="red";
				document.Employment.t23.style.backgroundColor="red";
				page_one=false;
				
			}



			if(document.Employment.t24.checked || document.Employment.t25.checked){
				//Submit true
			}
			else{
				document.Employment.t24.style.backgroundColor="red";
				document.Employment.t25.style.backgroundColor="red";
				page_one=false;
				
				
			}

			if (document.Employment.t24.checked && document.Employment.t26.value==""){

				document.Employment.t26.style.backgroundColor="red";
				page_one=false;
			}






			if(document.Employment.t27.checked || document.Employment.t28.checked){
				//Submit true
			}
			else{
				document.Employment.t27.style.backgroundColor="red";
				document.Employment.t28.style.backgroundColor="red";
				page_one=false;
				
				
			}


			


			if(document.Employment.t29.checked || document.Employment.t30.checked){
				//Submit true
			}
			else{
				document.Employment.t29.style.backgroundColor="red";
				document.Employment.t30.style.backgroundColor="red";
				page_one=false;
				
				
			}

			if(document.Employment.t31.checked || document.Employment.t32.checked){
				//Submit true
			}
			else{
				document.Employment.t31.style.backgroundColor="red";
				document.Employment.t32.style.backgroundColor="red";
				page_one=false;
				
				
			}

			if(document.Employment.t33.checked || document.Employment.t34.checked){
				//Submit true
			}
			else{
				document.Employment.t33.style.backgroundColor="red";
				document.Employment.t34.style.backgroundColor="red";
				page_one=false;
				
				
			}
			
			if(document.Employment.t33.checked && document.Employment.t35.value==""){
				document.Employment.t35.style.backgroundColor="red";
				page_one=false;
			}
			else{
				//Submit true
				
			}


///////////////////////////////////////////////////////////////////////////////////////////






			if (document.Employment.t39.value=="") {
				
				document.Employment.t39.style.backgroundColor="red";
				page_one=false;
				

			}

			if (document.Employment.t40.value=="") {
				
				document.Employment.t40.style.backgroundColor="red";
				page_one=false;
				

			}

			if (document.Employment.t41.value=="") {
				
				document.Employment.t41.style.backgroundColor="red";
				page_one=false;
				

			}

			if (document.Employment.t42.value=="") {
				
				document.Employment.t42.style.backgroundColor="red";
				page_one=false;
				

			}

			if (document.Employment.t43.value=="") {
				
				document.Employment.t43.style.backgroundColor="red";
				page_one=false;
				

			}


			if (document.Employment.t44.value=="") {
				
				document.Employment.t44.style.backgroundColor="red";
				page_one=false;
				

			}

			if (document.Employment.t45.value=="") {
				
				document.Employment.t45.style.backgroundColor="red";
				page_one=false;
				

			}


			if (document.Employment.t46.value=="") {
				
				document.Employment.t46.style.backgroundColor="red";
				page_one=false;
				

			}



			if(document.Employment.t47.checked || document.Employment.t48.checked){
				//Submit true
			}
			else{
				document.Employment.t47.style.backgroundColor="red";
				document.Employment.t48.style.backgroundColor="red";
				page_one=false;
				
				
			}

			if(document.Employment.t47.checked && document.Employment.t49.value==""){
				document.Employment.t49.style.backgroundColor="red";
				page_one=false;
			}
			else{
				//Submit true
				
			}


			if(document.Employment.t50.checked || document.Employment.t50a.checked){
				//Submit true
			}
			else{
				document.Employment.t50.style.backgroundColor="red";
				document.Employment.t50a.style.backgroundColor="red";
				page_one=false;
				
				
			}

			if(document.Employment.t50.checked && document.Employment.t51.value==""){
				document.Employment.t51.style.backgroundColor="red";
				page_one=false;
			}
			else{
				//Submit true
				
			}


			if(document.Employment.t56.checked || document.Employment.t57.checked){
				//Submit true
			}
			else{
				document.Employment.t56.style.backgroundColor="red";
				document.Employment.t57.style.backgroundColor="red";
				page_one=false;
				
				
			}

			if(document.Employment.t56.checked && document.Employment.t58.value==""){
				document.Employment.t58.style.backgroundColor="red";
				page_one=false;
			}
			else{
				//Submit true
				
			}

			if (document.Employment.t59.value=="") {
				
				document.Employment.t59.style.backgroundColor="red";
				page_one=false;
				

			}

//Page 3 Validation////////////////////////////////////////////////////////////////////////

			if (document.Employment.t101.value=="") {
				
				document.Employment.t101.style.backgroundColor="red";
				page_one=false;
				

			}




			if(document.Employment.t102.checked || document.Employment.t103.checked){
				//Submit true
			}
			else{
				document.Employment.t102.style.backgroundColor="red";
				document.Employment.t103.style.backgroundColor="red";
				page_one=false;
				
				
			}
			
			if(document.Employment.t103.checked) {
				page_one=true;
			}






			if(document.Employment.t102.checked && document.Employment.t104.value==""){
				document.Employment.t104.style.backgroundColor="red";
				page_one=false;
			}
			else{
				//Submit true
				
			}

			if (document.Employment.t102.checked && document.Employment.t104a.value=="") {
				
				document.Employment.t104a.style.backgroundColor="red";
				page_one=false;
				

			}





			if(document.Employment.t105.checked || document.Employment.t106.checked){
				//Submit true
			}
			else{
				document.Employment.t105.style.backgroundColor="red";
				document.Employment.t106.style.backgroundColor="red";
				page_one=false;
				
				
			}


			
			if(document.Employment.t105.checked && document.Employment.t107.value==""){
				document.Employment.t107.style.backgroundColor="red";
				page_one=false;
			}
			else{
				//Submit true
				
			}

			


			if(document.Employment.t108.checked || document.Employment.t109.checked){
				//Submit true
			}
			else{
				document.Employment.t108.style.backgroundColor="red";
				document.Employment.t109.style.backgroundColor="red";
				page_one=false;
				
				
			}


			
			if(document.Employment.t108.checked && document.Employment.t110.value==""){
				document.Employment.t110.style.backgroundColor="red";
				page_one=false;
			}
			else{
				//Submit true
				
			}


			

			if(document.Employment.t111.checked || document.Employment.t112.checked){
				//Submit true
			}
			else{
				document.Employment.t111.style.backgroundColor="red";
				document.Employment.t112.style.backgroundColor="red";
				page_one=false;
				
				
			}


			
			if(document.Employment.t111.checked && document.Employment.t113.value==""){
				document.Employment.t113.style.backgroundColor="red";
				page_one=false;
			}
			else{
				//Submit true
				
			}








		if (document.Employment.t124.value=="") {
				
				document.Employment.t124.style.backgroundColor="red";
				page_one=false;
				

			}






		if (document.Employment.t125.value=="") {
				
				document.Employment.t125.style.backgroundColor="red";
				page_one=false;
				

			}


		if (document.Employment.t126.value=="") {
				
				document.Employment.t126.style.backgroundColor="red";
				page_one=false;
				

			}


		if (document.Employment.t127.value=="") {
				
				document.Employment.t127.style.backgroundColor="red";
				page_one=false;
				

			}


		if (document.Employment.t128.value=="") {
				
				document.Employment.t128.style.backgroundColor="red";
				page_one=false;
				

			}


		if (document.Employment.t129.value=="") {
				
				document.Employment.t129.style.backgroundColor="red";
				page_one=false;
				

			}

		if (document.Employment.t130.value=="") {
				
				document.Employment.t130.style.backgroundColor="red";
				page_one=false;
				

			}


		if (document.Employment.t131.value=="") {
				
				document.Employment.t131.style.backgroundColor="red";
				page_one=false;
				

			}

		
		if (document.Employment.t132.value=="") {
				
				document.Employment.t132.style.backgroundColor="red";
				page_one=false;
				

			}


		if (document.Employment.t133.value=="") {
				
				document.Employment.t133.style.backgroundColor="red";
				page_one=false;
				

			}


		if (document.Employment.t134.value=="") {
				
				document.Employment.t134.style.backgroundColor="red";
				page_one=false;
				

			}
		
		if (document.Employment.t135.value=="") {
				
				document.Employment.t135.style.backgroundColor="red";
				page_one=false;
				

			}



		if (document.Employment.t136.value=="") {
				
				document.Employment.t136.style.backgroundColor="red";
				page_one=false;
				

			}



		if (document.Employment.t137.value=="") {
				
				document.Employment.t137.style.backgroundColor="red";
				page_one=false;
				

			}

		if (document.Employment.t138.value=="") {
				
				document.Employment.t138.style.backgroundColor="red";
				page_one=false;
				

			}


		if (document.Employment.t139.value=="") {
				
				document.Employment.t139.style.backgroundColor="red";
				page_one=false;
				

			}

//Start Page 4 and 5 Validation/////////////////////////////////////////////////////////////////////
		



			if (document.Employment.t142.value=="" && document.Employment.t146.value=="") {
				
			//Signature Section
				document.Employment.t142.style.backgroundColor="red";
				document.Employment.t146.style.backgroundColor="red";
				page_one=false;
				
				

			}
			
			if (document.Employment.t142.value != document.Employment.t146.value){
				alert ("Please check your signatures on Page 4 and Page 5. Signatures should be identical !");
				page_one=false;
			}





	
	if(page_one){
	//alert("Your Order has been Completed, Please Click OK button to Submit your Form");
	}
	else{
	
	alert("Please Check Required Fields");

	}

	form_ok=(page_one);
	return form_ok;
}

//End of checkForm function



// This function adds N/A value to Educational History Table, if user clicks on checkbox 

function edHistoryNA1(){

if (document.Employment.t124c.checked){

				

				document.Employment.t124.style.backgroundColor="white";
				document.Employment.t124.value="N/A";
				document.Employment.t125.style.backgroundColor="white";
				document.Employment.t125.value="N/A";
				document.Employment.t126.style.backgroundColor="white";
				document.Employment.t126.value="N/A";
				document.Employment.t127.style.backgroundColor="white";
				document.Employment.t127.value="N/A";
				
				}

	else  {
		document.Employment.t124.value="";
		document.Employment.t125.value="";
		document.Employment.t126.value="";
		document.Employment.t127.value="";
	}
}


function edHistoryNA2(){
if (document.Employment.t128c.checked){

				

				document.Employment.t128.style.backgroundColor="white";
				document.Employment.t128.value="N/A";
				document.Employment.t129.style.backgroundColor="white";
				document.Employment.t129.value="N/A";
				document.Employment.t130.style.backgroundColor="white";
				document.Employment.t130.value="N/A";
				document.Employment.t131.style.backgroundColor="white";
				document.Employment.t131.value="N/A";
				
				}

	else {
		document.Employment.t128.value="";
		document.Employment.t129.value="";
		document.Employment.t130.value="";
		document.Employment.t131.value="";
	}

}




function edHistoryNA3(){

if (document.Employment.t132c.checked){

				

				document.Employment.t132.style.backgroundColor="white";
				document.Employment.t132.value="N/A";
				document.Employment.t133.style.backgroundColor="white";
				document.Employment.t133.value="N/A";
				document.Employment.t134.style.backgroundColor="white";
				document.Employment.t134.value="N/A";
				document.Employment.t135.style.backgroundColor="white";
				document.Employment.t135.value="N/A";
				
				}

	else {
		document.Employment.t132.value="";
		document.Employment.t133.value="";
		document.Employment.t134.value="";
		document.Employment.t135.value="";
	}

}



function edHistoryNA4(){

if (document.Employment.t136c.checked){

				

				document.Employment.t136.style.backgroundColor="white";
				document.Employment.t136.value="N/A";
				document.Employment.t137.style.backgroundColor="white";
				document.Employment.t137.value="N/A";
				document.Employment.t138.style.backgroundColor="white";
				document.Employment.t138.value="N/A";
				document.Employment.t139.style.backgroundColor="white";
				document.Employment.t139.value="N/A";
				
				}

	else {
		document.Employment.t136.value="";
		document.Employment.t137.value="";
		document.Employment.t138.value="";
		document.Employment.t139.value="";
	}


}




//This function restores background color in text box when user clicks or types on

function restoreBackground(id){

	document.getElementById(id).style.backgroundColor="white";
				
}

//Restore Multiple Backgrounds Fucntions
//Purpose: Restores group backgrounds (user clicks on one check box and restores background for all checkboxes in a group)

function restoreMBackgrounds9(){

	document.getElementById("t21").style.backgroundColor="white";
	document.getElementById("t22").style.backgroundColor="white";	
	document.getElementById("t23").style.backgroundColor="white";		
}

function restoreMBackgrounds10(){

	document.getElementById("t24").style.backgroundColor="white";
	document.getElementById("t25").style.backgroundColor="white";	
			
}

function restoreMBackgrounds11(){

	document.getElementById("t27").style.backgroundColor="white";
	document.getElementById("t28").style.backgroundColor="white";	
			
}


function restoreMBackgrounds12(){

	document.getElementById("t29").style.backgroundColor="white";
	document.getElementById("t30").style.backgroundColor="white";	
			
}

function restoreMBackgrounds13(){

	document.getElementById("t31").style.backgroundColor="white";
	document.getElementById("t32").style.backgroundColor="white";	
			
}

function restoreMBackgrounds14(){

	document.getElementById("t33").style.backgroundColor="white";
	document.getElementById("t34").style.backgroundColor="white";	
			
}


function restoreMBackgrounds19(){

	document.getElementById("t47").style.backgroundColor="white";
	document.getElementById("t48").style.backgroundColor="white";	
			
}


function restoreMBackgrounds20(){

	document.getElementById("t50").style.backgroundColor="white";
	document.getElementById("t50a").style.backgroundColor="white";	
			
}

function restoreMBackgrounds22(){

	document.getElementById("t56").style.backgroundColor="white";
	document.getElementById("t57").style.backgroundColor="white";	
			
}

function restoreMBackgrounds27a(){

	document.getElementById("t102").style.backgroundColor="white";
	document.getElementById("t103").style.backgroundColor="white";	
			
}

function restoreMBackgrounds27b(){

	document.getElementById("t105").style.backgroundColor="white";
	document.getElementById("t106").style.backgroundColor="white";	
			
}

function restoreMBackgrounds27c(){

	document.getElementById("t108").style.backgroundColor="white";
	document.getElementById("t109").style.backgroundColor="white";	
			
}

function restoreMBackgrounds27d(){

	document.getElementById("t111").style.backgroundColor="white";
	document.getElementById("t112").style.backgroundColor="white";	
			
}
