/***********************************************
* Email Validation script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e){
var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Please enter a valid email address. \n example: mail@yahoo.com")
e.select()
}
return returnval
}

<!--document.contact.count.value = (400 - document.contact.msg.value.length);-->

function textCounter(field, countfield, maxlimit) {
	 if (field.value.length > maxlimit) {
		field.value = field.value.substring(0, maxlimit);
	 } else {
		countfield.value = maxlimit - field.value.length;
	 }
 }

function emptycontact()
{
 y=document.contact
 c1=y.name.value
 c3=y.subject.value
 c2=y.msg.value
 btsend="True"
  if(c1==null||c1==""){
    alert("Please enter your name!")
    btsend="False"
	y.name.focus();
  }else if(c3==null||c3==""){
    alert("Please enter subject")
    btsend="False"
	y.subject.focus();
  }else if(c2==null||c2==""){
    alert("Please enter your message")
    btsend="False"
	y.msg.focus();
  }if(btsend=="False"){
    return false
  } 	
}
