function formCheck(formName){
  ValidOk = true;
  var count = 0;
  while(count < formName.elements.length){
    var fieldType = formName.elements[count].type;
    var theFieldName = formName.elements[count].name;
    var fieldName = formName.elements[formName.elements[count].name];
	switch(fieldType){
	  case 'text':
	    if(theFieldName == 'firstname'){
	      strCheck(fieldName,1,'first name');
		}else if(theFieldName == "lastname"){
	  	  strCheck(fieldName,1,'last name');
		}else if(theFieldName == 'email'){
	  	 	emailCheck(fieldName,1,'email');
		}else if(theFieldName == "address"){
	  	  strCheck(fieldName,1,'address');
		}else if(theFieldName == "suburb"){
	  	  strCheck(fieldName,1,'suburb');	
		}
		//else if(theFieldName == "postcode"){
			
	  	 // postcodeCheck(fieldName,4,'postcode');		  		  
		//}
		
	  break;

	  case 'select-one':
	    if(theFieldName == 'states'){
	      selectCheckSpecial(fieldName,'state',formName);
	  	}else if(theFieldName == 'productSelect'){
	  	  selectCheck(fieldName,'product purchased');
		}else if(theFieldName == 'subject'){
	  	  selectCheck(fieldName,'subject');
		}else if(theFieldName == 'storesuburb'){
	  	  selectCheck(fieldName,'preferred dealer suburb');
		}else if(theFieldName == 'storestores'){
	  	  selectCheck(fieldName,'Volkswagen Dealership');
		}else if(theFieldName == 'CardExpYear'){
	  	  selectCheck(fieldName,"Credit Card expiry year"); 
		}else if(theFieldName == 'cardtype'){
	  	  selectCheck(fieldName,"Credit Card type"); 
		}else if(theFieldName == 'storeID'){
	  	  selectCheck(fieldName,"store"); 
		}
	  break;
	  
	  case 'textarea':
	    if(theFieldName == "comments"){
	      strCheck(fieldName,1,'comments');
		}
	  break;
	  
	  case 'password':
	    if(theFieldName == "memPassword"){
	      strCheck(fieldName,1,'password');
		}
	  break;
	  	  
	  case 'radio':
	    if(theFieldName == "country"){
	      postCodeCheck(fieldName);
		}else if(theFieldName == "taste"){
	      tasteCheck(fieldName);
		}else if(theFieldName == "Email_type"){
	      emailtypeCheckdealer(formName);
		}else if(theFieldName == "email_type"){
	      emailtypeCheck(formName);
		}else if(theFieldName == "receivedinfobyZCard"){
	      isChecked(fieldName, 'YES if you have received information from VW before by Z card.');
		}else if(theFieldName == "receivedinfobyPostcard"){
	      isChecked(fieldName, 'YES if you have received information from VW before by postcard.');  
		}else if(theFieldName == "Status"){ 
	      checkDelivered(formName,count);  
		}
	  break;
	  case 'checkbox':
	    if(theFieldName == "subscribe"){
			selectFieldName = formName.elements[formName.typeOfSubscription.name];
			checkboxDropdownCheck(fieldName,selectFieldName,"Please select a way of subscribing");
		} else if(theFieldName == "AdminSuper"){
			validChecked = isCheckBoxChecked(formName, count);
		} else if(theFieldName == "IsShippingSameAsContact"){
			ShippingCheck(formName);
		} else if(theFieldName == "UnsureDealer"){
			UnsureDealerCheck(formName);	
		}
	  break;
	}
	if(ValidOk == false){
	  break;
	}
	count++;
  }
  if (ValidOk == true){
    formName.submit();
  }
}