/*
 Author :		Michael Cheung
 E-mail :		info@michaelassociates.co.uk
 Date Start :	09/05/2005
 Date Amend :	09/05/2005
 Client : 		British Precast Concrete Federation
 Website : 		www.britishprecast.org
 Version : 		v1.0.
*/

dayName = new Array("", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
monName = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
now = new Date;



<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var currentdate = 0;
var core = 0;

function StringArray (n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '

  }
}

image = new StringArray(15);
image[0] = 'http://www.britishprecast.org/images/random/0.jpg';
image[1] = 'http://www.britishprecast.org/images/random/1.jpg';
image[2] = 'http://www.britishprecast.org/images/random/2.jpg';
image[3] = 'http://www.britishprecast.org/images/random/3.jpg';
image[4] = 'http://www.britishprecast.org/images/random/4.jpg';
image[5] = 'http://www.britishprecast.org/images/random/5.jpg';
image[6] = 'http://www.britishprecast.org/images/random/6.jpg';
image[7] = 'http://www.britishprecast.org/images/random/7.jpg';
image[8] = 'http://www.britishprecast.org/images/random/8.jpg';
image[9] = 'http://www.britishprecast.org/images/random/9.jpg';
image[10] = 'http://www.britishprecast.org/images/random/10.jpg';
image[11] = 'http://www.britishprecast.org/images/random/11.jpg';
image[12] = 'http://www.britishprecast.org/images/random/12.jpg';
image[13] = 'http://www.britishprecast.org/images/random/13.jpg';
image[14] = 'http://www.britishprecast.org/images/random/14.jpg';
image[15] = 'http://www.britishprecast.org/images/random/15.jpg';
image[16] = 'http://www.britishprecast.org/images/random/16.jpg';
image[17] = 'http://www.britishprecast.org/images/random/17.jpg';
image[18] = 'http://www.britishprecast.org/images/random/18.jpg';
image[19] = 'http://www.britishprecast.org/images/random/19.jpg';
image[20] = 'http://www.britishprecast.org/images/random/20.jpg';

var ran = 60/image.length;

function ranimage() {
  currentdate = new Date();
  core = currentdate.getSeconds();
  core = Math.floor(core/ran);
    return(image[core])
}
function checkPrestressedOrder() 
{ 
	with(document.forms[0]) 
	{ 
		var Tot=parseFloat(Total.value); 
		if( isNaN(Tot) || Tot<=0.0) 
		{ 
		alert("You cannot order nothing. Please select a publication to order"); 
		return false; 
		} 
	} 
	return true; 
} 

function checkPublicationForm()
{
	if (document.contactform.Name.value == null || document.contactform.Name.value == 0 )
	{
		alert("Please enter your name.");
		document.contactform.Name.select();
		document.contactform.Name.focus();
		return false;
	}
	if (document.contactform.Company.value == null || document.contactform.Company.value == 0 )
	{
		alert("Please enter your Company/Organisation Name.");
		document.contactform.Company.select();
		document.contactform.Company.focus();
		return false;
	}
	if (document.contactform.Address.value == null || document.contactform.Address.value == 0 )
	{
		alert("Please enter your Address. Post Code is entered below.");
		document.contactform.Address.select();
		document.contactform.Address.focus();
		return false;
	}
	if (document.contactform.PostCode.value == null || document.contactform.PostCode.value == 0 )
	{
		alert("Please enter your Post Code.");
		document.contactform.PostCode.select();			
		document.contactform.PostCode.focus();
		return false;
	}
	if (document.contactform.Email.value == null || document.contactform.Email.value == 0 )
	{
		alert("Please enter your E-mail Address");
		document.contactform.Email.select();
		document.contactform.Email.focus();
		return false;
	}
	if (document.contactform.Email.value.match(/\s/))
	{
		alert("Please enter a valid E-mail Address");
		document.contactform.Email.select();
		document.contactform.Email.focus();
		return false;
	}
	if (!(document.contactform.Email.value.match(/^[^@]+@[^@]+\.[A-Za-z]{2,4}$/)))
	{
		alert("Please enter a valid E-mail Address");
		document.contactform.Email.select();
		document.contactform.Email.focus();
		return false;
	}
	return true;
}

function checkContactUsForm()
{
	if (document.contactform.Name.value == null || document.contactform.Name.value == 0 )
	{
		alert("Please enter your name.");
		document.contactform.Name.select();
		document.contactform.Name.focus();
		return false;
	}
	if (document.contactform.Email.value == null || document.contactform.Email.value == 0 )
	{
		alert("Please enter your E-mail Address");
		document.contactform.Email.select();
		document.contactform.Email.focus();
		return false;
	}
	if (document.contactform.Email.value.match(/\s/))
	{
		alert("Please enter a valid E-mail Address");
		document.contactform.Email.select();
		document.contactform.Email.focus();
		return false;
	}
	if (!(document.contactform.Email.value.match(/^[^@]+@[^@]+\.[A-Za-z]{2,4}$/)))
	{
		alert("Please enter a valid E-mail Address");
		document.contactform.Email.select();
		document.contactform.Email.focus();
		return false;
	}
	return true;
}

function textPostCodeToUpper()
{
	document.contactform.PostCode.value = document.contactform.PostCode.value.toUpperCase();
	return;
}

function textInvPostCodeToUpper()
{
	document.contactform.Invoice_PostCode.value = document.contactform.Invoice_PostCode.value.toUpperCase();
	return;
}


function checkPrestressedPubForm()
{
	checkPublicationForm();
	checkPrestressedOrder();
}