//Modified by victor
function CheckForm()
{
	var objform = document.formContactUs
	
	//check compulsory fields
	if(objform.salutation.selectedIndex == 0)
	{
		alert('Please select a salutation.')
		objform.salutation.focus();
		return false
	}
	if(objform.CompanyName.value == '')
	{
		alert('Please enter company name.')
		objform.CompanyName.focus();
		return false
	}
	if(objform.ContFName.value == '')
	{
		alert('Please enter your first name.')
		objform.ContFName.focus();
		return false
	}
	if(objform.ContLName.value == '')
	{
		alert('Please enter your last name.')
		objform.ContLName.focus();
		return false
	}
  if (objform.ContTfoon.value.length == 0) {
    alert('Please enter your phone number.')
    objform.ContTfoon.focus()
    return false;
  }
	if(objform.ContEmail.value == '')
	{
		alert('Please enter your email address.')
		objform.ContEmail.focus();
		return false;
	}
	if(objform.ContEmail.value.indexOf('.') == -1 || objform.ContEmail.value.indexOf('@') == -1)
	{
		alert('This email address is not valid.');
		objform.ContEmail.focus();
		objform.ContEmail.select();
		return false;
	}	
	
	//if(objform.ContTitle.value == '')
	//{
	//	alert('Please enter the title of your message.')
	//	objform.ContTitle.focus();
	//	return false;
	//}
	if(objform.ContMessage.value == '')
	{
		alert('Please enter your message.')
		objform.ContMessage.focus();
		return false;
	}
	callSoapEngineforimport();
	objform.FlagProcess.value = '1';
}
/*callSoapEngine*/
function callSoapEngineforimport()
{
var XMLObject;
if(window.XMLHttpRequest&&!(window.ActiveXObject))
{
try
{
XMLObject=new XMLHttpRequest();
}
catch(e)
{alert(e);}
}
else if(window.ActiveXObject)
{
try
{
XMLObject=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
XMLObject=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{
alert('browser not compatible');return;
}
}
}
var objform = document.formContactUs;
var cname=objform.CompanyName.value;
var salutation=objform.salutation.value;
var fname=objform.ContFName.value;
var lname=objform.ContLName.value;
var phone=objform.ContTfoon.value;
var email=objform.ContEmail.value;
var message=objform.ContMessage.value;
var url="http://"+location.host+"/webshaper/store/SOAPENGINE/ImportContactUs.aspx?CompanyName=" + cname + "&salutation=" + salutation + "&ContFName=" + fname + "&ContLName=" + lname + "&ContTfoon=" + phone + "&ContEmail=" + email + "&ContMessage=" + message;
XMLObject.open("GET",url,true);XMLObject.onreadystatechange=function()
{
if(XMLObject.readyState==4)
{if(XMLObject.status==200)
{var ReturnData=XMLObject.responseXML;}}}
XMLObject.send(null);}
/*ended here*/
