function ValidateRegistrationDetails(form)
{
	if ((form.InstallationNumber.value == null) || (form.InstallationNumber.value == ""))
	{
		alert("Registration details incomplete.\n\nAn installation number has not been supplied.");
		return false;
	}

	if ((form.CustomerName.value == null) || (form.CustomerName.value == ""))
	{
		alert("Registration details incomplete.\n\nA contact name has not been supplied.");
		return false;
	}

	if ((form.CustomerEmail.value == null) || (form.CustomerEmail.value == ""))
	{
		alert("Registration details incomplete.\n\nA contact email address has not been supplied.");
		return false;
	}

	if ((form.CustomerCountry.value == null) || (form.CustomerCountry.value == ""))
	{
		alert("Registration details incomplete.\n\nA country has not been supplied.");
		return false;
	}

	return true;
}	

function ModifiedTimeStamp()
{
	var dateText = "";
	var lastModified = "";
	var modificationDate = new Date();	
	var day;
	var month;
	var year;

	modificationDate.setTime(Date.parse(document.lastModified));

	day = modificationDate.getDate();
	month = modificationDate.getMonth();
	year = modificationDate.getFullYear();


	switch (month)
	{
		case 0:
			month = "January";
			break;

		case 1:
			month = "February";
			break;

		case 2:
			month = "March";
			break;

		case 3:
			month = "April";
			break;

		case 4:
			month = "May";
			break;

		case 5:
			month = "June";
			break;

		case 6:
			month = "July";
			break;

		case 7:
			month = "August";
			break;

		case 8:
			month = "September";
			break;

		case 9:
			month = "October";
			break;

		case 10:
			month = "November";
			break;

		case 11:
			month = "December";
			break;
	}

	switch (day)
	{
		case 01:
		case 21:
		case 31:
			day += "st";
			break;

		case 02:
		case 22:
			day += "nd";
			break;

		case 03:
		case 23:
			day += "rd";
			break;

		default:
			day += "th";
			break;
	}

	document.write("<FONT CLASS=\"footer\">This page was last modified on " + month + " " + day + " " + year + ".</FONT>");

}

function SendRegistrationEmail(body)
{
   var cdoMessage = Server.CreateObject("CDO.Message");
   var cdoConfig = Server.CreateObject("CDO.Configuration");
   var configFields = cdoConfig.Fields;
   cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2;
   cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.addix.com";
   cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10;
   cdoConfig.Fields.Update;
   cdoMessage.Configuration = cdoConfig;
   cdoMessage.To = "registration@addix.com";
   cdoMessage.From = "registration@addix.com";
//   cdoMessage.From =  Request.Cookies("Addix")("CustomerEmail");
//   cdoMessage.ReplyTo = Request.Cookies("Addix")("CustomerEmail");
   cdoMessage.Subject = "Addix product registration";
   cdoMessage.HtmlBody = body;
   cdoMessage.Send;
   var cdoMessage = "";
   var cdoConfig = "";

   return true;
}


