function ShowEnquiry(productname)
{
	document.getElementById("Item").innerHTML = productname;
	hide('ProductDiv');
	show('EnquireDiv')
	show('EnquireForm');
	hide("Loading");
}


function CallContact(result)
{
	if(result.value == 'True')
	{
		show('ProductDiv');
		hide('EnquireDiv');
		hide('Loading');
		show('EnquireForm')
		alert("Thank you, your enquiry was sent off to Cor-Pro successfully!")
	}
	else {
		hide('Loading');
		show('EnquireForm')
		alert("We aplogise for this error: "+ result.value)
	}
}

function Contact()
{
	hide("EnquireForm");
	show("Loading");
	
	var FullName, Email, TelNo, Country, Query, Item, Cell = new String();
	FullName = document.getElementById("FullName").value;
	Email = document.getElementById("Email").value;
	TelNo = document.getElementById("TelNo").value;
	Cell = document.getElementById("Cell").value;
	Item = document.getElementById("Item").innerHTML;
	Query = document.getElementById("Query").value;
	Country = document.Form.Country.options[document.Form.Country.selectedIndex].value;
	
	CorPro.ViewProperty.SendMail(FullName,TelNo, Cell, Email, Country, Item, Query,CallContact);
}

function ValidateData() {
   var CanSubmit = false;
   var errormessage = "Please make sure that you have filled in the following fields before clicking Send:\n\n"
   CanSubmit = ForceEntry(document.forms[0].FullName);
   if (CanSubmit == false) 
	{
		errormessage += "Full Name.\n";
	}
   CanSubmit = ForceEntry(document.forms[0].TelNo);
   if (CanSubmit == false) 
	{
		errormessage += "Contact number.\n";
	}
   CanSubmit = ForceEntry(document.forms[0].Email);
   if (CanSubmit == false) 
	{
		errormessage += "E-mail address.\n";
	}
	CanSubmit = checkEmailAddress(document.forms[0].Email);
   if (CanSubmit == false) 
	{
		errormessage += "Please enter a Valid E-mail Address.\n";
	}
	
	CanSubmit = ForceEntry(document.forms[0].Cell);
   if (CanSubmit == false) 
	{
		errormessage += "Your Cell Number.\n";
	}
	
	CanSubmit = ForceEntry(document.forms[0].TelNo);
   if (CanSubmit == false) 
	{
		errormessage += "Your Telephone Number.\n";
	}
  
   if (errormessage == 'Please make sure that you have filled in the following fields before clicking Send:\n\n')
   {
	return true;
   }
   else 
   {
	alert(errormessage)
	return false;
   }
}  
