//javascript for form validation
function isValidForm(){
	var email =  document.getElementById('tx_ablinklist_pi1[contact]').value; 
	var label =  document.getElementById('tx_ablinklist_pi1[label]').value; 
	var country = document.getElementById('country').value;
	var region  = document.getElementById('region').value;
	var password  = document.getElementById('password').value;
	var cpassword  = document.getElementById('newpassword').value;
	var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
	
	   if(document.getElementById('tx_ablinklist_pi1[label]').value == '') {
                   alert('Please enter Company Name');
                   document.getElementById('tx_ablinklist_pi1[label]').focus();
                   return (false);
            } 
       else if(document.getElementById('country').value = '') {
                 alert('Please select the Country');
                 document.getElementById('country').focus();
                 return (false);
            }
      else if(document.getElementById('region').value == 0) {
                   alert('Please Select Region');
                   document.getElementById('region').focus();
                   return (false);
            } 
        else if(document.getElementById('category').value == 0) {
            if (document.getElementById('tx_ablinklist_pi1[new_category]')) {
                if (document.getElementById('tx_ablinklist_pi1[new_category]').value == '') {
                    alert('Please Select atleast One Category');
                    document.getElementById('category').focus();
                    return (false);
                }
            }
            else if (document.getElementById('category').value == 0) {
                alert('Please Select atleast One Category');
                document.getElementById('category').focus();
                return (false);
            }
        }   
            else if(!document.getElementById('tx_ablinklist_pi1[contact]').value.match(re)) {
                   alert('Please enter Correct Email Address');
                   document.getElementById('tx_ablinklist_pi1[contact]').focus();
                   return (false);
            } 
//             else if(document.getElementById('password').value == '') {
//                 if (document.getElementById('password').value == '') {
//                    alert('Please enter password');
//                    document.getElementById('password').focus();
//                    return (false);
//                 }
//                 else if (document.getElementById('confirmpassword').value == '') {
//                    alert('Please enter Confirm password');
//                    document.getElementById('confirmpassword').focus();
//                    return (false);
//                 
//                 }
//             }
                       
            else if(document.Addjob.jobstartdate.value=='') {
                   alert('Please enter start date');
                   document.Addjob.jobstartdate.focus();
                   return (false);
            } 
            else if(document.Addjob.jobenddate.value=='') {
                   alert('Please enter end date');
                   document.Addjob.jobenddate.focus();
                   return (false);
            } 
	
	
	//	if(val == "" || coun == 0|| reg == 0 || pas != cpas || !vishnu.match(re)){
		//	alert("Please Fill all fields properly");
	//		return false;
	//	} else {
		//	return true;
	//	}
		
	var cata = document.getElementById('category').value
	alert(cata);
//	var newcat = document.getElementById('newcat').value;
//	alert(newcat); 	
	
   
}
//ends validation script
//	if (!vishnu.match(re)) {
//				alert("Invalid Email Address");
//			return false;
//		} else {
//			return true;
//		}
