// JavaScript Document

function deletelement(del)
	{
		document.getElementById(del).style.display = "none";
	} 
	
 function validatecontactform(formid)
 {
	
    var reason = "";
	reason += validateName(formid.name);
	
	
	if (reason != "") {
    alert("Some fields need correction: >>\n" + reason );
    return false;
	}
	
 }
 
function validateName(fid)
{
	
	 var error = "";
	 var alphaExp = /^[a-zA-Z ]+$/;
	if(fld.value.match(alphaExp)){

     }else{
      error = "Enter character only for name.\n";
     }
    if (fld.value == "") {       
        error = "Enter a Name.\n";
    } else if (fld.value.length > 35) {      
        error = "The name is the wrong length.\n";
    //} else if (illegalChars.test(fld.value)) {
   //     error = "The last name contains illegal characters.\n";
    }else {
        
    }
    if(error != ""){
        fld.style.background = '#fbc1a4';
    }else{
          fld.style.background = 'White';
        }

    return error;
	alert(error);
	return false;
}
 
 
 
 
