// JavaScript Document

function validation(page_name){
 
 
 if(page_name == "my_account"){


   if(document.forms[0].txt_first_name.value==""){
	   
	   	alert("Enter the first name and proceed");
		document.forms[0].txt_first_name.focus();
		return false;
   }
   if(document.forms[0].txt_last_name.value==""){
	   
	   	alert("Enter the Second name and proceed");
		document.forms[0].txt_last_name.focus();
		return false;
   }
   if(document.forms[0].txt_address.value==""){
	   
	   	alert("Enter the address and proceed");
		document.forms[0].txt_address.focus();
		return false;
   }
   if(document.forms[0].txt_city.value==""){
	   	alert("Enter the city and proceed");
		document.forms[0].txt_city.focus();
		return false;
   }
   if(document.forms[0].txt_state.value==""){
	   
	   	alert("Enter the state and proceed");
		document.forms[0].txt_state.focus();
		return false;
   }
   if(document.forms[0].country.value==""){
	   	alert("Select Country and proceed");
		document.forms[0].country.focus();
		return false;
   }
  if(document.forms[0].txt_pri_tele.value==""){
	   	alert("Enter the telephone number and proceed");
		document.forms[0].txt_pri_tele.focus();
		return false;
   }
   if(document.forms[0].txt_email.value==""){
	   	alert("Enter the email address and proceed");
		document.forms[0].txt_email.focus();
		return false;
   }
   if(document.forms[0].txt_re_email.value==""){
	   	alert("Re-enter email address and proceed");
		document.forms[0].txt_re_email.focus();
		return false;
   }
   if(document.forms[0].txt_email.value != document.forms[0].txt_re_email.value){
	   	alert("Entered E-mail Address mismatched");
		document.forms[0].txt_email.focus();
		return false;
   }
   if(document.forms[0].txt_user_id.value  ==""){
	   	alert("Enter the User id  and proceed");
		document.forms[0].txt_user_id.focus();
		return false;
   }
    if(document.forms[0].txt_password.value  ==""){
	   	alert("Enter the Password  and proceed");
		document.forms[0].txt_password.focus();
		return false;
   }
  if(document.forms[0].txt_re_password.value  ==""){
	   	alert("Re-Enter password and proceed");
		document.forms[0].txt_re_password.focus();
		return false;
   } 
   
   
   if(document.forms[0].txt_re_password.value != document.forms[0].txt_password.value){
	    alert("Entered Password mismatched");
		document.forms[0].txt_user_id.focus();
		return false;
   }
   
  
   
}  // end of page condition

 if(page_name == "shipping_address"){

 if(document.getElementById('gov_check').checked==true){
			  if(document.getElementById('txtNewTaxId').value=="")
			 {
			 alert("Enter the taxid and proceed");				 
			 document.forms[0].txtNewTaxId.focus();
			 return false;
			}
			 			 
		 }
		 
		/* if(document.forms[0].address_new.value ==""){
			 alert("Enter the shipping address and proceed");
			 document.forms[0].address_new.focus();
			 return false;
		 }
		 
		 if(document.forms[0].txt_new_city.value == ""){
			 alert("Enter the city and proceed");
			  document.forms[0].txt_new_city.focus();
			 return false;
		 }//comment
		/* if(document.forms[0].txt_new_state.value==""){
			 	alert("Enter the state and proceed");
				 document.forms[0].txt_new_state.focus();
				return false;
		 }*/
		 /*
		 selObj = document.getElementById("txt_new_state");
	        if(selObj.selectedIndex == ""){
				
				alert("Select State and proceed");
				 return false;
			}
		 
		 //comment
		  /*selObj = document.getElementById("new_shipping_country");
	        if(selObj.selectedIndex == ""){
				
				alert("Select country and proceed");
				 return false;
			}*/
		 
		 /*if(document.forms[0].txt_zip.value==""){
			 alert("Enter the Zip code and proceed");
			  document.forms[0].txt_zip.focus();
			 return false;
		 }
		 
		  if(document.forms[0].shipping_provider.value==""){
			 alert("Select Shipping provider and proceed");
			  document.forms[0].shipping_provider.focus();
			 return false;
		 }
		  if(document.forms[0].shipping_method.value==""){
			 alert("Select Shipping method and proceed");
			  document.forms[0].shipping_method.focus();
			 return false;
		 }
		  
		 
		  
*/
}


     if(page_name == "shipping"){

if(document.forms[0].address_new.value ==""){
			 alert("Enter the shipping address and proceed");
			 document.forms[0].address_new.focus();
			 return false;
		 }
		 
		 if(document.forms[0].txt_new_city.value == ""){
			 alert("Enter the city and proceed");
			  document.forms[0].txt_new_city.focus();
			 return false;
		 }
 selObj = document.getElementById("txt_new_state");
	        if(selObj.selectedIndex == ""){
				
				alert("Select State and proceed");
				 return false;
			}

 if(document.forms[0].txt_zip.value==""){
			 alert("Enter the Zip code and proceed");
			  document.forms[0].txt_zip.focus();
			 return false;
		 }
		 
		  if(document.forms[0].shipping_provider.value==""){
			 alert("Select Shipping provider and proceed");
			  document.forms[0].shipping_provider.focus();
			 return false;
		 }
		  if(document.forms[0].shipping_method.value==""){
			 alert("Select Shipping method and proceed");
			  document.forms[0].shipping_method.focus();
			 return false;
		 }
		  
		 


  }
 
}// end of the function

 

