//Authod : Parvendra
//Date   : 21-Jan-2010

function validate(thisObj)
{
	email		 = thisObj.reqEmail.value;
	firstname	 = thisObj.reqFirstName.value;
	lastname	 = thisObj.reqLastName.value;
	title		 = thisObj.reqTitle.value;
	organization = thisObj.reqOrg.value;
	city		 = thisObj.reqCity.value;
	country		 = thisObj.reqCountry.value;
	phone		 = thisObj.reqPhone.value;
	securitycode = thisObj.security_code.value;

	if(email == '')
	{
		alert('Please enter Email Address.');
		thisObj.reqEmail.focus();
		return false;
	}
	else if(!validateEmail(email)){
		alert('Please enter a valid email address.');
		thisObj.reqEmail.focus();
		return false;
	}

	if(firstname == '')
	{
		alert('Please enter First name.');
		thisObj.reqFirstName.focus();
		return false;
	}
	if(lastname == '')
	{
		alert('Please enter Last name.');
		thisObj.reqLastName.focus();
		return false;
	}
	if(title == '')
	{
		alert('Please enter Title.');
		thisObj.reqTitle.focus();
		return false;
	}
	if(organization == '')
	{
		alert('Please enter your organization.');
		thisObj.reqOrg.focus();
		return false;
	}
	if(city == '')
	{
		alert('Please enter your city.');
		thisObj.reqCity.focus();
		return false;
	}


	if(country == '')
	{
		alert('Please select country.');
		thisObj.reqCountry.focus();
		return false;
	}

	if(phone == '')
	{
		alert('Please enter phone.');
		thisObj.reqPhone.focus();
		return false;
	}
	if(securitycode == '')
	{
		alert('Please enter security code.');
		thisObj.security_code.focus();
		return false;
	}

}

//function to validate email format
function validateEmail(str){
	var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(str.match(emailRegEx)){
		return true;
	}else{
	
	return false;
}
}