function Show(e) {
    if (document.getElementById(e).style.display == 'none') {
        document.getElementById(e).style.display = 'block';				
				
    } else {
       				
    }
}

function Hide(e) {
    if (document.getElementById(e).style.display == 'block') {
        document.getElementById(e).style.display = 'none';				
				
    } else {
        document.getElementById(e).style.display = 'none';
				
    }
}

function isValidEmail(theEmail){
  this.validMail= /(^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-_])+\.)+([a-zA-Z0-9]{2,4})+$)/;
  if(theEmail.match(this.validMail)){
    return true;
  }
  return false;
}

function validateContactFormAndSubmit(f){
	
	var errorString="";
	if(f.name.value == ""){
		errorString+="You must enter your name\n\n";
	}
		
	if(f.email.value == ""){
		errorString+="You must enter your email address\n\n";
	}
	else {
		if (!isValidEmail(f.email.value)) {
			errorString+="You have entered an invalid email address\n\n";
		}
	}
	
	if(f.phone.value == ""){
		errorString+="You must enter your contact number\n\n";
	}
	
	if(f.subject.value==""){
		errorString+="You must enter a subject\n\n";
	}
	
	if(f.message.value==""){
		errorString+="You must enter message\n\n";
	}	
	
	if(errorString==""){
		return true;
	}
	else{
		alert(errorString);
		return false;
	}
}