ApplicantsForm = function() {
    return {
        SendData: function() {
            if(ApplicantsForm.validateData())
            {
                $('frmApplicantForm').submit();
            }
        },
        
        ResetData: function() {
            $('frmApplicantForm').reset();
        },
        
        validateData: function() {
            
            if($('txtContactName').value == ""){
                alert('Please enter Contact Name.');
                return false;
            }
            
            if($('txtCompanyName').value == ""){
                alert('Please enter Company Name.');
                return false;
            }
            
            if($('txtEmail').value == ""){
                alert('Please enter Email.');
                return false;
            }else{
                if(!this.isEmail($('txtEmail').value)){
                    alert('Please enter a valid email.');
                    return false;
                }
            }
            
            if($('txtPhone').value == ""){
                alert('Please enter Phone.');
                return false;
            }
            
            /*if($('txtURL').value != ""){
                if(!this.isUrl($('txtURL').value)){
                    alert('Please enter valid url.');
                    return false;
                }
            }*/
            
            return true;
        },
        
        isEmail: function(str) {
		    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str))
		    {
		        return (true);
		    }
		    else
		    {
                return false;
            }		    
		},
		
		isUrl: function(str) {
	        var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
	        return regexp.test(str);
        },
		
		isValidAlphaNum: function(str) {
            var cc = /^[a-zA-Z0-9._\- ,\'&\/]+$/;
            
             if (cc.test(str) == false )			    
			    return false;
		      else
			    return true;            
        }
    };
}();
