function emptyBox(box)	{
	if (box.value == " Optional comments" || box.value == " Enter your message here" || box.value == "Email Address")	 {
		box.value = "";
		}
	};

function checkContactForm(form)	{
	var pattern1 = /[\w\-]+\@[\w\-]+\.\w{2,3}/;
	var check;
	var pattern2 = /\d{3}\-\d{3}\-\d{4}/;

	if ((form.clientName.value.length < 8) || (form.clientName.value.indexOf(" ") == -1))	 {
		alert("Please enter your full name");
		form.clientName.focus();
		return false;
		}

	if ((form.clientAddress1.value.length < 8) || (form.clientAddress1.value.indexOf(" ") == -1))	 {
		alert("Please enter your full postal address");
		form.clientAddress1.focus();
		return false;
		}

	if (form.postCode.value.length < 5)	 {
		alert("Please enter your full postcode");
		form.postCode.focus();
		return false;
		}
/*
	if (form.emailAddress.value.length < 5)	{
		alert("Please enter an email address");
		form.emailAddress.focus();
		return false;
		}

	if (!pattern1.test(form.emailAddress.value))	{
		alert("The email you have entered appears to be invalid, please check it and resubmit");
		form.emailAddress.focus();
		return false;
		}
*/
}


// Display date
function dateShow() {

  var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
  var months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
  var now = new Date();
  var day = now.getDay();
  var today = now.getDate();
  var month = now.getMonth();
  var year = now.getFullYear();


//dateStamp = days[day] + ' ' + two_digit(today) + ' ' + months[month] + ' ' + year; 
dateStamp = two_digit(today) + ' ' + months[month] + ' ' + year; 
document.write(dateStamp);
}

 function two_digit(value) {
 
var s = value + '';

if (s.length == 1)
return('0' + s); else
return(s);
}
  
// Open link in new window

/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Alan Coleman | http://www.alancoleman.co.uk */
function externalLinks() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
      anchor.target = "_blank";
    }
  }
}

// Multiple onload function created by: Simon Willison
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  externalLinks();
});




// Random name order for Colin and Neil

function random_fullname_order_or() {
var $names;
var a;
a = Math.round(Math.random()); // a = random number between 0 and 1
if (a == 0) $names = 'Colin Miller or Neil Bourne';
if (a == 1) $names = 'Neil Bourne or Colin Miller';
return $names;
}

function random_fullname_order_and() {
var $names;
var a;
a = Math.round(Math.random()); // a = random number between 0 and 1
if (a == 0) $names = 'Colin Miller and Neil Bourne';
if (a == 1) $names = 'Neil Bourne and Colin Miller';
return $names;
}

function random_firstname_order_or() {
var $names;
var a;
a = Math.round(Math.random()); // a = random number between 0 and 1
if (a == 0) $names = 'Colin or Neil';
if (a == 1) $names = 'Neil or Colin';
return $names;
}

function random_firstname_order_and() {
var $names;
var a;
a = Math.round(Math.random()); // a = random number between 0 and 1
if (a == 0) $names = 'Colin and Neil';
if (a == 1) $names = 'Neil and Colin';
return $names;
}