	dayName = new Array ("Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday")

	monName = new Array ("January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October", "November" , "December")

var bookmarkurl="http://www.londonvolleyball.org/"
var bookmarktitle="London Volleyball Association (LVA)"

function addbookmark()
{
	if (document.all)
	window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function days_greeting()
{
	now = new Date;

	if (now.getDate()==1 && now.getMonth()==0) {document.write("Happy New Year Everyone!<br>")}
	else if (now.getMonth()==11 && now.getDate()==25) {document.write("Merry Christmas to one and all.<br>")}
	else if (now.getHours() < 5) {document.write("Good Morning! ")}
	else if (now.getHours() < 9) {document.write("Good Morning! ")}
	else if ((now.getHours() < 17) && (now.getDay() == 0 || now.getDay() == 6))
		{document.write("Have a good weekend! ")}
	else if ((now.getHours() < 17) && (now.getDay() > 0 || now.getDay() < 6))
		{document.write("No surfing during working hours! ")}
	else {document.write("Good Evening! ")}

	document.write("Today is " + dayName[now.getDay()] + ", " + monName[now.getMonth()] + " " + now.getDate() + ", "+now.getYear())
}

function when_modified()
{
	var fd = document.lastModified;

	var browser;
	browser=navigator.appName;

	if (browser=="Microsoft Internet Explorer")
	{
		var DateBits=fd.split("/");
		document.write(DateBits[1]+"."+DateBits[0]+"."+DateBits[2].slice(0,4));
	}
	else if (browser=="Netscape")
	{
		var DateBits=fd.split(" ");
		document.write(DateBits[2]+" "+DateBits[1]+" "+DateBits[3]);
	}
	else document.write(fd);
}

function validate() {
	name=document.feedback.name.value
	if (name == '' ) {
		alert('Name is required');
		return false;
	}
	addr=document.feedback.emailaddress.value
	if (addr == '' ) {
	   alert('email address is mandatory');
	   return false;
	}
	if (addr == '') return true;
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
	      alert('email address contains invalid characters');
	      return false;
	   }
	}
	for (i=0; i<addr.length; i++) {
	   if (addr.charCodeAt(i)>127) {
	      alert("email address contains non ascii characters.");
	      return false;
	   }
	}
	
	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
	   alert('email address must contain an @');
	   return false;
	}
	if (atPos == 0) {
	   alert('email address must not start with @');
	   return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) {
	   alert('email address must contain only one @');
	   return false;
	}
	if (addr.indexOf('.', atPos) == -1) {
	   alert('email address must contain a period in the domain name');
	   return false;
	}
	if (addr.indexOf('@.',0) != -1) {
	   alert('period must not immediately follow @ in email address');
	   return false;
	}
	if (addr.indexOf('.@',0) != -1){
	   alert('period must not immediately precede @ in email address');
	   return false;
	}
	if (addr.indexOf('..',0) != -1) {
	   alert('two periods must not be adjacent in email address');
	   return false;
	}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
	   alert('invalid primary domain in email address');
	   return false;
	}
	return true;
}


