function CheckField(field,alerttxt) {
  with (field) {
    if (value==null||value==""){
			alert(alerttxt);
			return false;
		} else {
			return true;
		}
  }
}
function CheckEmailField(field,alerttxt) {
  with (field) {
    if (value==null||value==""||value.indexOf("@")==-1){
			alert(alerttxt);
			return false;
		} else {
			return true;
		}
  }
}


function CheckForm(thisform) {
	with (thisform) {
	  if (CheckEmailField(Email,"Please enter your email address")==false){
			Email.focus();
			return false;
		}
	  if (CheckField(Contact1,"Please enter in a contact number.")==false){
			Contact1.focus();
			return false;
		}
	  if (CheckField(Message1,"Please enter in a message.")==false){
			Message1.focus();
			return false;
		}
	}
}

function CheckForm2(thisform) {
	with (thisform) {
	  if (CheckField(Name1,"Please enter in your name.")==false){
			Name1.focus();
			return false;
		}		
	  if (CheckEmailField(Email,"Please enter your email address")==false){
			Email.focus();
			return false;
		}
	  if (CheckField(Contact1,"Please enter in a contact number.")==false){
			Contact1.focus();
			return false;
		}
	  if (CheckField(Message1,"Please enter in a message.")==false){
			Message1.focus();
			return false;
		}
	  if (CheckField(City1,"Please select a city.")==false){
			City1.focus();
			return false;
		}
	  if (CheckField(captcha,"Please enter in the security code on the screen.")==false){
			captcha.focus();
			return false;
		}
	}
}