/**
*All the below functions restricts the data other than the characters mentioned in variable pattern and alerts for null.
*/
var pattern;

function validate_fname(objName) {

	if(objName.value=="") {
                alert("First Name cannot be empty.")
                objName.select();
                return false;
        }    
        return true;
}


function validate_lname(objName) {

	if(objName.value=="") {
                alert("Last Name cannot be empty.")
                objName.select();
                return false;
        }   
        return true;
}


function validate_email(objName) {
        pattern =/^[a-zA-Z0-9_\-]+(\.[a-zA-Z0-9_\-]+)*(@)([a-zA-Z0-9_\-]+\.)+([a-zA-Z]{2,4})$/;
	if(objName.value=="") {
                alert("Email cannot be empty.")
                objName.select();
                return false;
        }
        if(!pattern.test(objName.value)) {
                alert("Invalid Email Address.");
                objName.select();
                return false;
        }
        return true;
}


function validate_zipcode(objName) {

	if(objName.value=="") {
        	alert("Zip Code cannot be empty.")
        	objName.select();
                return false;
        }
        return true;
}

