﻿
    function Validation()
    {
        var prefix = 'ctl00$ContentPlaceHolder1$'
        var frm = document.frmSubscribe; 
        frm.txtSave.value = 'save';
        var intError = 0;
        var strDescription = 'Your information was not submitted because:\n';
        var focus_field = null;
        
	     if (isEmpty(frm.txtfname.value)) {
		     strDescription = strDescription + ' -You did not enter the first name\n';
		     intError = 1;
		     if (focus_field == null) focus_field = frm.txtfname;
	    }

	     if (isEmpty(frm.txtlname.value)) {
		     strDescription = strDescription + ' -You did not enter the last name\n';
		     intError = 1;
		     if (focus_field == null) focus_field = frm.txtlname;
	    }
	    
	    if (isEmpty(eval('frm.'+prefix+'txtEmail.value'))) {
		     strDescription = strDescription + ' -You did not enter the email\n';
		     intError = 1;
		     if (focus_field == null) focus_field = eval('frm.'+prefix+'txtEmail');
	    }
	    
	     if (!isEmpty(eval('frm.'+prefix+'txtEmail.value'))) {
            if (!isValidEmail(eval('frm.'+prefix+'txtEmail.value'))) {
            strDescription = strDescription + ' -You did not enter a valid email format\n';
            intError = 1;
            if (focus_field == null) focus_field = eval('frm.'+prefix+'txtEmail');
            }
	 	 }
	 	 
//	     if (isEmpty(frm.txtAddress.value)) {
//		     strDescription = strDescription + ' -You did not enter the post Address\n';
//		     intError = 1;
//		     if (focus_field == null) focus_field = frm.txtAddress;
//	    }	    		 	 

//	     if (isEmpty(frm.txtMobile.value)) {
//		     strDescription = strDescription + ' -You did not enter the mobile\n';
//		     intError = 1;
//		     if (focus_field == null) focus_field = frm.txtMobile;
//	    }
 
	     if (intError == 1) {
	 	     alert(strDescription);
	 	     if (focus_field != null)
	 	 	     focus_field.focus();
	 	     return false;
	     }
	     else 
         {	 	   
            frm.submit();
	     }
	    
    }
    

