function submitEnquiry()
{ 



if (document.getElementById("name").value=="")
	{
		alert("Please enter name properly.");
		document.quickcontact.name.focus();		
		return false;
	}
if (document.getElementById("name").value=="Name")
	{
		alert("Please enter name properly.");
		document.quickcontact.name.focus();		
		return false;
	}
	
if (document.getElementById("contact_no").value=="")
	{
		alert("Sorry, the phone field is blank.");
		document.quickcontact.contact_no.focus();		
		return false;
	}
if (document.getElementById("contact_no").value=="Contact No.")
	{
		alert("Sorry, the phone field is blank.");
		document.quickcontact.contact_no.focus();		
		return false;
	}	
	if(!isEmailValid(document.getElementById("email").value))	
	{
		alert("Please enter valid email");
		document.quickcontact.email.focus();		
		return false;
	}
	
	
	
	if(document.getElementById("turingNo1").value=="")
		{
			alert("Please enter text from the image.");
			document.quickcontact.turingNo1.focus();
			return false;	
		}
	return true;
}

function isEmailValid(fieldValue) {
var emailFilter = /^.+@.+\..{2,4}$/;
var atSignFound = 0;
for (var i = 0; i <= fieldValue.length; i++)
if ( fieldValue.charAt(i) == "@" )
atSignFound++;
if ( atSignFound > 1 )
return false;
else
return ( emailFilter.test(fieldValue) &&!doesEmailHaveInvalidChar(fieldValue) )? true : false;
}

function doesEmailHaveInvalidChar(fieldValue) {
var illegalChars = /[\(\)\<\>\,\;\:\\\/\"\[\] ]/;
return ( illegalChars.test(fieldValue) )? true : false;
}

function refreshCaptcha()
{
 	var randomnumber=Math.random();
	document.getElementById('captcha1').src = "CaptchaSecurityImages.php?width=80&height=28&characters="+randomnumber;
}

