function formValidated(txtCompany,txtName,txtPhone,txtEmail,txtComments)

{ 

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)

 {

 alert ("Browser does not support HTTP Request")

 return

 }

 

var url="dynamic.php"

url=url+"?content=thankyou&txtCompany="+txtCompany+"&txtName="+txtName+"&txtPhone="+txtPhone+"&txtEmail="+txtEmail+"&txtComments="+txtComments

xmlHttp.onreadystatechange=stateChange 

xmlHttp.open("GET",url,true)

xmlHttp.send(null)

}

function stateChange() 

{ 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 

 document.getElementById("content").innerHTML=xmlHttp.responseText 

 } 

}

function GetXmlHttpObject()

{

var xmlHttp=null;

try

 {

 // Firefox, Opera 8.0+, Safari

 xmlHttp=new XMLHttpRequest();

 }

catch (e)

 {

 //Internet Explorer

 try

  {

  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

  }

 catch (e)

  {

  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

  }

 }

return xmlHttp;

}

//end of dynamic content script

function send()

{

	var txtCompany = document.contactITCSS.txtCompany.value;

	var txtName = document.contactITCSS.txtName.value;

	var txtPhone = document.contactITCSS.txtPhone.value;

	var txtEmail = document.contactITCSS.txtEmail.value;

	var txtComments = document.contactITCSS.txtComments.value;

	

	var error = "You have missed the below fields:\n";

	if (txtCompany == "" ) {

							error = error+"- company name\n";

							var display = 1;

						   }

	if (txtName == "") {

						error = error+"- your name\n";

						var display = 1;

					   }

	if (txtPhone == "") {

						 error = error+"- telephone\n";

						 var display = 1;

						}

	if (txtEmail == "") {

						 error = error+"- email address\n";

						 var display = 1;

						}

	if (txtComments == "") {

							error = error+"- description\n";

							var display = 1;

						   }

						   						   

	if (display>0) {

					alert(error+"Please fill all the fields and try again\n");

				   }

				   else {

				   		 formValidated(txtCompany,txtName,txtPhone,txtEmail,txtComments)

						}

	

	 

}



function clearValue(fieldID)

{

document.getElementById(fieldID).value = "";

document.getElementById("aabb").innerHTML = "<input id=txtPassword type=password name=password class=txtLoginBox style='margin-top:6px; width:194px;' onClick=focus();>";

}


