function CallRegister(result)
{
	if(result.value == 'True')
	{
		hide("Loading")
		hide("Panel1")
		show("Panel2");
	}
	else {
		show("Panel1");
		hide("Loading");
		alert("We aplogise for this error: "+ result.value)
	}
}

function Register()
{
	hide("Panel1");
	show("Loading");
	var Firstname, Lastname, Email, Telno, Country, URL, Postal, Fax, Company, Username = new String();
	Firstname = document.getElementById("FirstName").value;
	Lastname = document.getElementById("LastName").value;
	Email = document.getElementById("Email").value;
	Country = document.Form.Country.options[document.Form.Country.selectedIndex].value;
	Telno = document.getElementById("TelNo").value;
	URL = document.getElementById("URL").value;
	Postal = document.getElementById("Postal").value;
	Fax = document.getElementById("Fax").value;
	Company = document.getElementById("Company").value;
	Username = document.getElementById("Username").value;
	
	Nortech.Register.SendMail(
		Firstname, 
		Lastname, 
		Email,
		Telno,
		Country,
		URL,
		Postal,
		Fax,
		Company,
		Username,
		CallRegister
		);
	
	setTimeout("hidePanel()",10000)
}

function hidePanel() {
	hide("Loading");
	hide("Panel1");
	show("Panel2");
}

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].FirstName);
   if (CanSubmit == false) 
	{
		errormessage += "First Name.\n";
	}
	CanSubmit = ForceEntry(document.forms[0].LastName);
   if (CanSubmit == false) 
	{
		errormessage += "Last 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 += "Valid E-mail Address.\n";
	}
   CanSubmit = ForceEntry(document.forms[0].Postal);
   if (CanSubmit == false) 
	{
		errormessage += "Postal Address.\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;
   }
}