// js for checking contact form	
var errorText = "";

function checkForm()
{	
	if ((document.subForm.contactEmail.value.indexOf('@') == -1) || (document.subForm.contactEmail.value.indexOf('.') == -1))
	{	
		errorText = "Please provide your correct email address";
		document.getElementById('contactEmail').focus();
		document.getElementById('contactEmail').className  = "contact_form_error";
		
		return false;
	}
	
	if (document.subForm.contactPhone.value.length < 1 )
	{	
		errorText = "Please provide your telephone number";
		document.getElementById('contactPhone').className  = "contact_form_error";
		document.getElementById('contactPhone').focus();		
		
		return false;
	}

	return true;
}	

function SubmitForm()
{					
	var isValid = checkForm();
	
	if (isValid == true)
	{
		//var str = "email=" + document.getElementById(contactEmail) + "&company" + document.getElementById(contactCompany) + "&position" + document.getElementById(contactPosition) + "&phone" + document.getElementById(contactPhone) + "&message" + document.getElementById(contactMessage);
		//alert (str);
		//document.subForm.action="/content/contact/contact_do.php?" + str; 
		document.subForm.submit();	
		
		return true;				
	}
	else
	{
		document.getElementById('txtErrorMsg').innerHTML = errorText;
		document.getElementById('errorMsg').style.visibility = 'visible';
		
		return false;
	}
}