//	Be aware this sorce code file is the property of Andrew Jackson, and by copying it, 
//	or distributing the code, you will violate copyright laws.
//	Andrew Jackson, is the code developer and you may seek
//	his permission to use the code on your own page.

//	Developed by:		Andrew Jackson, Interneers
//	Released on:		15 Aug 2002

//	Version No:		1.0

//	Updates:		None


































window.defaultStatus = "Born to Maul";

function checkemail(str){

	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (filter.test(str))
		testresults=true;
	else
		testresults=false;
	return (testresults);
}

function App10sSubmit()
{
	if (document.App10s.ApplicantsName.value.length < 1){
		alert("Please enter the Applicants Name.");
		document.App10s.ApplicantsName.focus();
		return false;
	}	
	if (document.App10s.ApplicantsRank.value.length < 1){
		alert("Please enter the Applicants Rank.");
		document.App10s.ApplicantsRank.focus();
		return false;
	}
	if (document.App10s.Surname.value.length < 1){
		alert("Please enter your Surname.");
		document.App10s.Surname.focus();
		return false;
	}
	if (document.App10s.FirstName.value.length < 1){
		alert("Please enter your First Name.");
		document.App10s.FirstName.focus();
		return false;
	}
	if (document.App10s.ApplicantsEmail.value.length < 1){
		alert("Please enter the Applicants contact Email.");
		document.App10s.ApplicantsEmail.focus();
		return false;
	}
	if (document.App10s.Email.value.length < 1){
		alert("Please enter your contact Email.");
		document.App10s.Email.focus();
		return false;
	}
	if (document.App10s.word.value.length < 1){
		alert("Please enter the Security word.");
		document.App10s.word.focus();
		return false;
	}
	isemail = checkemail(document.App10s.ApplicantsEmail.value);
	if (!isemail){
		alert("Email Address does not follow normal guidelines. Please try again or Email pr@akrotirirugbyclub.org.uk directly.");
		document.App10s.ApplicantsEmail.focus();
		return false;
	}
	isemail = checkemail(document.App10s.Email.value);
	if (!isemail){
		alert("Email Address does not follow normal guidelines. Please try again or Email pr@akrotirirugbyclub.org.uk directly.");
		document.App10s.Email.focus();
		return false;
	}
}

function ApplicationSubmit()
{
	if (document.Application.Name.value.length < 1){
		alert("Please enter your Name.");
		document.Application.Name.focus();
		return false;
	}
	if (document.Application.HomeNumber.value.length < 1){
		alert("Please enter your Home Phone Number.");
		document.Application.HomeNumber.focus();
		return false;
	}
	if (document.Application.ServiceNumber.value.length < 1){
		alert("Please enter your Service Number.");
		document.Application.ServiceNumber.focus();
		return false;
	}
	if (document.Application.WorkExtension.value.length < 1){
		alert("Please enter your Work Extension.");
		document.Application.WorkExtension.focus();
		return false;
	}
	if (document.Application.Rank.value.length < 1){
		alert("Please enter your Rank.");
		document.Application.Rank.focus();
		return false;
	}
	if (document.Application.WorkAddress.value.length < 1){
		alert("Please enter your Work Address.");
		document.Application.WorkAddress.focus();
		return false;
	}
	if (document.Application.Email.value.length < 1){
		alert("Please enter your Email Address.");
		document.Application.Email.focus();
		return false;
	}
	if (document.Application.word.value.length < 1){
		alert("Please enter the Security word.");
		document.Application.word.focus();
		return false;
	}
	isemail = checkemail(document.Application.Email.value);
	if (!isemail){
		alert("Email Address does not follow normal guidelines. Please try again or Email pr@akrotirirugbyclub.org.uk directly.");
		document.Application.Email.focus();
		return false;
	}
}

function ContactSubmit()
{
	if (document.ContactForm.Name.value.length < 1){
		alert("Please enter your Name.");
		document.ContactForm.Name.focus();
		return false;
	}
	if (document.ContactForm.Email.value.length < 1){
		alert("Please enter your Email Address.");
		document.ContactForm.Email.focus();
		return false;
	}
	if (document.ContactForm.Comments.value.length < 5){
		alert("Please enter your Comments.");
		document.ContactForm.Comments.focus();
		return false;
	}
	if (document.ContactForm.word.value.length < 1){
		alert("Please enter the Security word.");
		document.ContactForm.word.focus();
		return false;
	}
	isemail = checkemail(document.ContactForm.Email.value);
	if (!isemail){
		alert("Email Address does not follow normal guidelines. Please try again or Email pr@akrotirirugbyclub.org.uk directly.");
		document.ContactForm.Email.focus();
		return false;
	}
}
function Move(destination){
	location.href = destination;
}
function new_freecap()
{
	// loads new freeCap image
	if(document.getElementById)
	{
		// extract image name from image source (i.e. cut off ?randomness)
		thesrc = document.getElementById("freecap").src;
		thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);
		// add ?(random) to prevent browser/isp caching
		document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()*100000);
	} else {
		alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded");
	}
}
function SearchGuide(){
	sgwparams = "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=515, height=370";
	sgw = open('', 'sgw', sgwparams);
	sgw.document.writeln('<html>');
	sgw.document.writeln('<head>');
	sgw.document.writeln('<title>Interneers Summer Offer</title>');
	sgw.document.writeln('</head>');
	sgw.document.writeln('<style type=text/css>');
	sgw.document.writeln('body');
	sgw.document.writeln('{ font-family: arial; font-size: 10pt; font-weight: bold; text-align: justify;}');
	sgw.document.writeln('i');
	sgw.document.writeln('{ color: red; cursor: hand;}');
	sgw.document.writeln('a');
	sgw.document.writeln('{ color: blue; text-decoration: none;}');
	sgw.document.writeln('a:hover');
	sgw.document.writeln('{ text-decoration: underline ;}');	
	sgw.document.writeln('</style>');
	sgw.document.writeln('<body bgcolor="cfcfcf" onLoad="window.focus();">');
	sgw.document.writeln('<h2><u>Interneers Summer Special</u></h2>');
	sgw.document.writeln('<p>Up until the 30 July 2004, Interneers are offering Free Web Hosting to certain types of web sites.</p>');
	sgw.document.writeln('<p>Usually Free Hosting will predominantly include Military Clubs or organisations and all kinds of Charity sites. During this offer, everyone will be considered.</p>');
	sgw.document.writeln('<p>If Free Hosting is not applicable, reduced rates Web Hosting will be dependant up on each customers circumstances.</p>');
	sgw.document.writeln('<p>To get a free, no obligation, personalised quote please send details of your site to Interneers using the contact details below.</p>');
	sgw.document.writeln('<p><a href="mailto:admin@interneers.co.uk?subject=Interneers Summer Offer">admin@interneers.co.uk</a></p>');
	sgw.document.writeln('<p>To get a full list of services that will be provided, view the <a target="_blank" href="http://www.interneers.co.uk">Interneers</a> web site.</p>');
	sgw.document.writeln('<p onClick="self.close()";><i>Close this window</i></p>');
	sgw.document.writeln('</body>');
	sgw.document.writeln('</html>');
	sgw.document.close();
}

function Status(message)
{
	window.status = message;
}

function PageLoad()
{
jd = new Date();
var sec, min, hour, date, month, year;
sec = jd.getSeconds();
if (sec <= 9){
	sec = "0" + sec;
}
min = jd.getMinutes();
if (min <= 9){
	min = "0" + min;
}
hour = jd.getHours();
if (hour <= 9){
	hour = "0" + hour;
}
var time = hour + ":" + min + ":" + sec + " on th";
t.innerHTML = time;
date = jd.getDate();
if (date <= 9){
	date = "0" + date;
}
month = jd.getMonth();
year = jd.getFullYear();
Arraym = new Array("Jan","Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
var fulldate = "e " + date + " " + Arraym[month] + " " + year;
d.innerHTML = fulldate;
setTimeout("clock();", 1000);

//manufacturer=navigator.appName;
//b.innerHTML = manufacturer;
}
function clock(){
jd = new Date();
var sec, min, hour, day, month, year;
sec = jd.getSeconds();
if (sec <= 9){
	sec = "0" + sec;
}
min = jd.getMinutes();
if (min <= 9){
	min = "0" + min;
}
hour = jd.getHours();
if (hour <= 9){
	hour = "0" + hour;
}
var time = hour + ":" + min + ":" + sec + " on th";
t.innerHTML = time;
setTimeout("clock();", 1000);

}
