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 == "childsName"){
	      strCheck(fieldName,1,'full name');
    	}else if(theFieldName == 'email'){
	  	  emailCheck(fieldName);
		}else if(theFieldName == "myEmail"){
	  	  emailCheck(fieldName);
		}else if(theFieldName == "friendsEmail"){
	  	  friendEmailCheck(fieldName);
		}else if(theFieldName == "myName"){
	  	  strCheck(fieldName,1,'name');
		}else if(theFieldName == "firstName"){
	  	  strCheck(fieldName,1,'first name');
		}else if(theFieldName == "lastName"){
	  	  strCheck(fieldName,1,'last name');
		}else if(theFieldName == "friendsName"){
	  	  strCheck(fieldName,1,'friend\'s name');
		}else if(theFieldName == "friendsEmail"){
	  	  emailCheck(fieldName,1,'friend\'s email');
		}else if(theFieldName == "address"){
	  	  strCheck(fieldName,1,'address');
		}else if(theFieldName == "suburb"){
	  	  strCheck(fieldName,1,'suburb');	
		}else if(theFieldName == "postcode"){
	  	  numCheck(fieldName,4,'postcode');
		}else if(theFieldName == "kidPhone"){
	  	  phoneCheck(fieldName);		  		  
		}else if(theFieldName == "dobYear"){
	  	  dob_yearCheck(fieldName,'date of birth - year');
		}else if(theFieldName == "senderName"){
	  	  strCheck(fieldName,1,'name');

		}else if(theFieldName == "senderEmail"){
	  	  emailCheck(fieldName,'valid email address');
		  
		}else if(theFieldName == "recipientName"){
	  	  strCheck(fieldName,1,'friend\'s name');
		  
		}else if(theFieldName == "recipientEmail"){
	  	  emailCheck(fieldName,'friend\'s valid email address');
		}
		
		else if(theFieldName == "emailAddress"){
	  	  emailCheck(fieldName,'valid email address');
		
		}else if(theFieldName == "k"){
	  	  strCheck(fieldName,2,'Keyword');
		 }
		
	  break;
 	  
	  case 'select-one':
	    if(theFieldName == "kidState"){
	      selectCheck(fieldName,'state');
		}else if(theFieldName == "dobDay"){
	  	  selectCheck(fieldName,'date of birth - day');
		}else if(theFieldName == "dobMonth"){
	  	  selectCheck(fieldName,'date of birth - month');
		}else if(theFieldName == "storeState"){
	  	  selectCheck(fieldName,'favourite store - state');
		}else if(theFieldName == "storeSuburb"){
	  	  selectCheck(fieldName,'favourite store - restaurant area');
		}else if(theFieldName == "storeStores"){
	  	  selectCheck(fieldName,'favourite store - address');
		}else if(theFieldName == "favDessert"){
	  	  selectCheck(fieldName,'favourite dessert');    
		}  
	  break;
	  
	  case 'textarea':
	    if(theFieldName == 'comment'){
	      strCheck(fieldName,1,'feedback');
		}
	  break;
	  
	  case 'password':
	    if(theFieldName == 'memPassword'){
	      strCheck(fieldName,4,'valid password (min.4 chars). eg "hello"');
		}
	  break;
	  	  
	  case 'radio':
	    if(theFieldName == 'gender'){
	      genderCheck(fieldName);
		}else if(theFieldName == 'prize'){
		  prizeCheck(fieldName);
		}else if(theFieldName == 'subscribe'){
		  isChecked(fieldName,'Do you wish to subscribe?');
		}
	  break;
	  
	   case 'checkbox':
	    if(theFieldName == 'parentAgree'){
	      parentCheck(formName,fieldName);
		}else if(theFieldName == 'disclaimer'){
		  discCheck(fieldName);
		}
	  break;
	}
	if(ValidOk == false){
	  break;
	}
	count++;
  }
  if (ValidOk == true){
    formName.submit();
  }
}