
///////////////////////////////////////////////////////
//////////// Validation of Contact Form  //////////////
///////////////////////////////////////////////////////

function validate_me(formobj){
	var re = /^[\w ]+$/;
    if ((formobj.name.value == "")) {		
		alert("Please enter your Name");
		formobj.name.select();
		formobj.name.focus();
		return false;
	}
	// checking invalid character
	if(!re.test(formobj.name.value)){
		alert("Error: Input contains invalid characters! Please use alphanumeric characters and spaces.");
		formobj.name.select();
		formobj.name.focus();
		return false;
	}
	
	if ((formobj.company.value == "")) {		
		alert("Please enter your Company Name");
		formobj.company.select();
		formobj.company.focus();
		return false;
	}
	
	if(!re.test(formobj.company.value)){
		alert("Error: Input contains invalid characters! Please use alphanumeric characters and spaces.");
		formobj.company.select();
		formobj.company.focus();
		return false;
	}
	
	if ((formobj.email.value == "") || (formobj.email.value.indexOf("@") == -1) || (formobj.email.value.indexOf(".") == -1)) {
		alert("Please enter a valid email ID");
		formobj.email.select();
		formobj.email.focus();
		return false;
	}	
	
}


function validate1(formobj){
	var re = /^[\w ]+$/;
	
	if(formobj.partner.selectedIndex <= 0) {
		alert("Please select one from the Partner");
		return false;
	}
	
    if ((formobj.fname.value == "")) {		
		alert("Please enter your First Name");
		formobj.fname.select();
		formobj.fname.focus();
		return false;
	}
	// checking invalid character
	if(!re.test(formobj.fname.value)){
		alert("Error: Input contains invalid characters! Please use alphanumeric characters and spaces.");
		formobj.fname.select();
		formobj.fname.focus();
		return false;
	}
	
	    if ((formobj.lname.value == "")) {		
		alert("Please enter your Last Name");
		formobj.lname.select();
		formobj.lname.focus();
		return false;
	}
	// checking invalid character
	if(!re.test(formobj.lname.value)){
		alert("Error: Input contains invalid characters! Please use alphanumeric characters and spaces.");
		formobj.lname.select();
		formobj.lname.focus();
		return false;
	}
	
	if ((formobj.company.value == "")) {		
		alert("Please enter your Company Name");
		formobj.company.select();
		formobj.company.focus();
		return false;
	}
	
	if(!re.test(formobj.company.value)){
		alert("Error: Input contains invalid characters! Please use alphanumeric characters and spaces.");
		formobj.company.select();
		formobj.company.focus();
		return false;
	}
	
	
	if(formobj.jobFunction.selectedIndex <= 0) {
		alert("Please select one of the Job Function");
		return false;
	}

	if(formobj.organization.selectedIndex <= 0) {
		alert("Please select one of the Organisation");
		return false;
	}
	
	
	if ((formobj.phone.value == "")) {
		alert("Please enter your Contact Phone Number");
		formobj.phone.select();
		formobj.phone.focus();		
		return false;
	} else if (isNaN(formobj.phone.value)){
		alert("Please Enter Numbers Only (0-9)..");
		formobj.phone.select();
		formobj.phone.focus();
		return false;
	}
	
	
	
	if ((formobj.email.value == "") || (formobj.email.value.indexOf("@") == -1) || (formobj.email.value.indexOf(".") == -1)) {
		alert("Please enter a valid email ID");
		formobj.email.select();
		formobj.email.focus();
		return false;
	}
	
	if(formobj.country.selectedIndex <= 0) {
		alert("Please select one of the Country");
		return false;
	}
	
	
}

