//function for contact form.........

function check_enquiryform()
{
	
	docf=document.getElementById("frm");
	
	if(docf.name.value=='')
	{
		alert("Please enter your Name");
		docf.name.focus();
		return false;
	}
	
	/*if(docf.city.value=='null')
	{
		alert("Please enter City Name");
		docf.city.focus();
		return false;
	}*/
	if(docf.country.value=='Select a country')
	{
		alert("Please enter Country Name");
		docf.country.focus();
		return false;
	}
	if(docf.email.value=='')
	{
		alert("Please enter your Email ID");
		docf.email.focus();
		return false;
	}

	if(docf.phone.value=='')
	{
		alert("Please enter your Phone");
		docf.phone.focus();
		return false;
	}

if(docf.code_field.value=='')
	{
		alert("Please enter the Code above in Figure");
		docf.code_field.focus();
		return false;
	}


	 return validate_form(docf);
	
}

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}


function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}
	
}

//////////////////////////////////////////////
//function for careers form.........

function check_careerform()
{
	
	docf=document.getElementById("frm");
	
		
	
	if(docf.name.value=='')
	{
		alert("Please enter Name");
		docf.name.focus();
		return false;
	}
	if(docf.email.value=='')
	{
		alert("Please enter your Email ID");
		docf.email.focus();
		return false;
	}

	
if(docf.mobile.value=='')
	{
		alert("Please enter your Mobile No.");
		docf.mobile.focus();
		return false;
	}

	if(docf.comment.value=='')
	{
		alert("Please enter your Comments");
		docf.comment.focus();
		return false;
	}

	if(docf.attachment.value=='')
	{
		alert("Please upload your Resume");
		docf.attachment.focus();
		return false;
	}


	 return validate_form(docf);
	
}

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}


function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}
	
}
