function onlynum(eventObj, obj)

{
	var keyCode


	// Check For Browser Type
	if (document.all){ 		keyCode=eventObj.keyCode
	}
	else{
		keyCode=eventObj.which
	}
	var str=obj.value
	if(keyCode!=0){
	if(keyCode!=8){
	if(keyCode==46){ 
			if (str.indexOf(".")>0){
				return false
			}
		}
	if(keyCode==46){ 
			if (str.indexOf(".")>0){
				return false
			}
		}
		if((keyCode<48 || keyCode >58)   &&   (keyCode != 46)){ // Allow only integers and decimal points
			return false
		}
	}}
	return true

}



function contactcheck(){
	if(contact.fname.value==""){
		alert ("Please enter the information for the \"First Name\" field." )
		contact.fname.focus();
		return false;
	}
	if(contact.lname.value==""){
		alert ("Please enter the information for the \"Last Name\" field." )
		contact.lname.focus();
		return false;
	}
	if(contact.email.value == ""){ 
		alert ("Please enter the information for the \"Email\" field." );
		contact.email.focus();   
		return false;
	}

    if ((contact.email.value.indexOf('@', 0) == -1) || (contact.email.value.indexOf('.') == -1)){ 
		alert ("Please fill in a correct email address" );    
		contact.email.focus();
		return false;
	}
	if(contact.phone.value==""){
		alert ("Please enter the information for the \"Phone\" field." );
		contact.phone.focus();
		return false;
	}
	if(contact.gender.value==""){
		alert ("Please choose the information for the \"Gender\" field." );
		contact.gender.focus();
		return false;
	}
	if(contact.zip.value==""){
		alert ("Please enter the information for the \"Zip/Postal code\" field." );
		contact.zip.focus();
		return false;
	}
	if(contact.city.value==""){
		alert ("Please enter the information for the \"City\" field." );
		contact.city.focus();
		return false;
	}
	if(contact.country.value==""){
		alert ("Please enter the information for the \"Country\" field." );
		contact.city.focus();
		return false;
	}

	if(contact.comment.value==""){
		alert ("Please enter the information for the \"Comment\" field." );
		contact.comment.focus();
		return false;
	}

}

function enquirycheck(){
	if(enquiry.compname.value==""){
		alert ("Please enter the information for the \"Company Name\" field." )
		enquiry.compname.focus();
		return false;
	}
	if(enquiry.person.value==""){
		alert ("Please enter the information for the \"Contact Person\" field." )
		enquiry.person.focus();
		return false;
	}
	if(enquiry.email.value == ""){ 
		alert ("Please enter the information for the \"Email\" field." );
		enquiry.email.focus();   
		return false;
	}

    if ((enquiry.email.value.indexOf('@', 0) == -1) || (enquiry.email.value.indexOf('.') == -1)){ 
		alert ("Please fill in a correct email address" );    
		enquiry.email.focus();
		return false;
	}
	if(enquiry.phone.value==""){
		alert ("Please enter the information for the \"Phone\" field." );
		enquiry.phone.focus();
		return false;
	}
	if(enquiry.address.value==""){
		alert ("Please choose the information for the \"Address\" field." );
		enquiry.address.focus();
		return false;
	}
	if(enquiry.comment.value==""){
		alert ("Please choose the information for the \"Comment\" field." );
		enquiry.comment.focus();
		return false;
	}
}

function validate(){
	if(carreer.position.value==""){
		alert ("Please enter the information for the \"Postion\" field.");
		carreer.position.focus();
		return false;
	}
	if(carreer.location.value==""){
		alert ("Please enter the information for the \"Preferred Location\" field.");
		carreer.location.focus();
		return false;
	}
	if(carreer.firstname.value==""){
		alert ("Please enter the information for the \"First Name\" field.");
		carreer.firstname.focus();
		return false;
	}
	if(carreer.lastname.value==""){
		alert ("Please enter the information for the \"Last Name\" field.");
		carreer.lastname.focus();
		return false;
	}
	if(carreer.age.value==""){
		alert ("Please select information for the \"Year of Birth\" field.");
		carreer.age.focus();
		return false;
	}
	if(carreer.gender.value==""){
		alert ("Please select information for the \"Gender\" field.");
		carreer.gender.focus();
		return false;
	}
	if(carreer.nationality.value==""){
		alert ("Please select information for the \"Nationality\" field.");
		carreer.nationality.focus();
		return false;
	}
	if(carreer.maritalstatus.value==""){
		alert ("Please select information for the \"Marital Status\" field.");
		carreer.maritalstatus.focus();
		return false;
	}
	if(carreer.visastatus.value==""){
		alert ("Please select information for the \"Visa Status\" field.");
		carreer.visastatus.focus();
		return false;
	}
	if(carreer.presentaddress.value==""){
		alert ("Please enter information for the \"Present Address\" field.");
		carreer.presentaddress.focus();
		return false;
	}
	if(carreer.telephone.value==""){
		alert ("Please enter information for the \"Telephone\" field.");
		carreer.telephone.focus();
		return false;
	}
	if(carreer.email.value==""){
		alert ("Please enter information for the \"Email\" field.");
		carreer.email.focus();
		return false;
	}
	if ((carreer.email.value.indexOf('@', 0) == -1) || (carreer.email.value.indexOf('.') == -1)){ 
		alert ("Please fill in a correct email address" );    
		carreer.email.focus();
		return false;
	}
	if(carreer.country.value==""){
		alert ("Please enter information for the \"Country Of Residence\" field.");
		carreer.country.focus();
		return false;
	}

	if(carreer.lastemployer.value==""){
		alert ("Please enter information for the \"Last Employer\" field.");
		carreer.lastemployer.focus();
		return false;
	}
	
	if(carreer.lastposition.value==""){
		alert ("Please enter information for the \"Current Designation\" field.");
		carreer.lastposition.focus();
		return false;
	}
	if(carreer.lastfrom.value==""){
		alert ("Please select information for the \"From\" field.");
		carreer.lastfrom.focus();
		return false;
	}
	if(carreer.lastto.value==""){
		alert ("Please select information for the \"To\" field.");
		carreer.lastto.focus();
		return false;
	}
	if(carreer.responsibilities.value==""){
		alert ("Please select information for the \"Responsibilities\" field.");
		carreer.responsibilities.focus();
		return false;
	}
	if(carreer.lastsalary.value==""){
		alert ("Please select information for the \"Current Salary\" field.");
		carreer.lastsalary.focus();
		return false;
	}
	if(carreer.prvexp.value==""){
		alert ("Please enter information for the \"Previous Experience\" field.");
		carreer.prvexp.focus();
		return false;
	}
	if(carreer.langknown.value==""){
		alert ("Please enter information for the \"Languages Known\" field.");
		carreer.langknown.focus();
		return false;
	}
	if(carreer.expsalary.value==""){
		alert ("Please enter information for the \"Expected Salary\" field.");
		carreer.expsalary.focus();
		return false;
	}
	if(carreer.noc.value==""){
		alert ("Please enter information for the \"Noc Availabilty\" field.");
		carreer.noc.focus();
		return false;
	}
	if(carreer.nperiod.value==""){
		alert ("Please enter information for the \"Notice Period Required\" field.");
		carreer.nperiod.focus();
		return false;
	}
	if(!carreer.lastsalary.value.match(numericexpression)){
		alert("Salary cannot contain letters.");
		carreer.lastsalary.focus();
		return false;
	}

}

function showOther(formObject)
{	
	document.getElementById('OtherTextField').style.display = (formObject.checked) ? '' : 'none';
}

function submitComplaintForm(ComplaintForm)
{
	if(ComplaintForm.fullname.value.length == 0)
	{
		alert("Please fill in all mandatory fields.")
		ComplaintForm.fullname.focus();
		return false;
	}
	else if(ComplaintForm.tel.value.length == 0)
	{
		alert("Please fill in all mandatory fields.")
		ComplaintForm.tel.focus();
		return false;
	}
	else if(ComplaintForm.email.value.length == 0)
	{
		alert("Please fill in all mandatory fields.")
		ComplaintForm.email.focus();
		return false;
	}
	else if ((ComplaintForm.email.value.indexOf('@', 0) == -1) || (ComplaintForm.email.value.indexOf('.') == -1)){ 
		alert ("Please enter a correct email address." );    
		ComplaintForm.email.focus();
		return false;
	}
	else if(ComplaintForm.project.value.length == 0)
	{
		alert("Please fill in all mandatory fields.")
		ComplaintForm.project.focus();
		return false;
	}
	
	var isChecked = false;
	for(var i = 1; i <= 17; i++)
	{
		if(document.getElementById('c'+i).checked)
		{
			
			isChecked = true;
			break;
		}
	}
	
	if(!isChecked) 
	{
		alert("Please tick at least one box.")
		ComplaintForm.c1.focus();
		return false;
	}
	
	if(ComplaintForm.c17.checked && ComplaintForm.other.value.length == 0)
	{
		alert("Please specify the reason for your complaint.")
		ComplaintForm.other.focus();
		return false;
	}
	
	if(ComplaintForm.complaint.value.length == 0)
	{
		alert("Please fill in all mandatory fields.")
		ComplaintForm.complaint.focus();
		return false;
	}
	
	return true;
}

