function CallContact(result)
{
	if(result.value == 'True')
	{
		hide("Loading")
		hide("Panel1")
		hide("Panel3")
		show("Panel2");
	}
	else {
		show("Panel3");
		hide("Loading");
		alert("We aplogise for this error: "+ result.value)
	}
}

function Contact()
{
	hide("Panel1");
	show("Loading");
	
	var WhoTo, FullName, Email, TelNo, Country, Subject, Query = new String();
	WhoTo = document.Form.Who.options[document.Form.Who.selectedIndex].text;
	FullName = document.getElementById("FullName").value;
	Email = document.getElementById("Email").value;
	TelNo = document.getElementById("TelNo").value;
	Country = document.Form.Country.options[document.Form.Country.selectedIndex].value;
	Subject = document.getElementById("Subject").value;
	Query = document.getElementById("Query").value;
	
	Wonderbra.ContactPage.SendMail(
		WhoTo,   
		FullName, 
		Email,
		TelNo,
		Country,
		Subject,
		Query,
		CallContact
		);
	
	//setTimeout("hide('Loading');show('Panel2')",10000)
}

function RequestFeature()
{
	hide("Panel1");
	show("Loading");
	Wonderbra.ContactPage.RequestFeature(
		document.getElementById("FullName").value, 
		document.getElementById("Email").value,
		document.getElementById("Query").value,
		CallContact
		);
}

      function ValidateData() {
           var CanSubmit = false;
		   var errormessage = "Please make sure that you have filled in the following fields before clicking Send:\n\n"

           // Check to make sure that the full name field is not empty.
           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].Subject);
		   if (CanSubmit == false) 
		   	{
				errormessage += "What is the query regarding?.\n";
			}
		   CanSubmit = ForceEntry(document.forms[0].Query);
		   if (CanSubmit == false) 
		   	{
				errormessage += "What would you like to say\n";
			}

           // Check to make sure ranking is between 1 and 10
		   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;
		   }
      }
	  
	  function ValidateData2() {
           var CanSubmit = false;
		   var errormessage = "Please make sure that you have filled in the following fields before clicking Send:\n\n"

           // Check to make sure that the full name field is not empty.
           CanSubmit = ForceEntry(document.forms[0].FullName);
		   if (CanSubmit == false) 
		   	{
				errormessage += "Full Name.\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].Query);
		   if (CanSubmit == false) 
		   	{
				errormessage += "Please enter the feature you would like added.\n";
			}

           // Check to make sure ranking is between 1 and 10
		   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;
		   }
      }
