// JavaScript Document
function removedefault(id,val){
		if(val=="Name" || val=="Phone" || val=="Email")
			document.getElementById(id).value="";
	}
	function showdefault(id,val){
		if(document.getElementById(id).value=='')
			document.getElementById(id).value=val;
	}

function frmValidate()
{
	var Field= Array();
	var FieldName= Array();
	//var email=document.frmCareer.email.value;
	Field[0]=document.frmcontact.Name.value;
	Field[1]=document.frmcontact.Phone.value;
	Field[2]=document.frmcontact.Email.value;

		
	FieldName[0]="Name";
	FieldName[1]="Phone";
	FieldName[2]="Email";
	
	var al="";
	var bval = true;
	
	for(i=0; i<3; i++)
	{
		if(Field[i]=="" || Field[0]=="Name" || Field[1]=="Phone" || Field[2]=="Email")
			al=al + ">> " + FieldName[i] + "   " + "\n";
	}
	
	if(al!="")
	{
		alert("Please Fill the following Fields\n\n" + al);
		bval = false;
	} 
	
	if(bval)
	 {
		bval= emailCheck(Field[2]);
	 }
	return bval;
}
function emailCheck(emailStr) 
  	{
  	  		var emailPat=/^(.+)@(.+)$/
  	        var matchArray;	
  	  		//var emailStr = document.frmcontact.Email.value;	
  	  	
  	  		if(emailStr.length > 1)
  	  			{  	  	
			matchArray = emailStr.match(emailPat);
			if (matchArray == null) 
			
			{
				alert("Please Enter Correct Email Address"); 
				return false;
			}	
			else
			{
				return true;
			}  		
  		}
  	  	
    }