<!--

//Javascript written by Jim Richardson
//Contact: jim@djimm.co.uk

oldSrc = new Array();

function swapImgOver(imgName,newSrc){
	eval('oldSrc[\'' + imgName + '\'] = document.images.' + imgName + '.src');
	eval('document.images.' + imgName + '.src = \"media/' + newSrc + '\"');
	}

function swapImgOut(imgName){
	eval('document.images.' + imgName + '.src = oldSrc[\'' + imgName + '\']');
	}

//onMouseOver="swapImgOver('news','nav_news_on.gif');" onMouseOut="swapImgOut('news');"

//onmouseover="swapImgOver('news','nav_news_on.gif');" onmouseout="swapImgOut('news');"

function preloadImages(){

for(i=0; i<preLoad.length; i++){
	eval('Image' + i + ' = new Image();')
	eval('Image' + i + '.src = "' + preLoad[i] + '";')
	}

}

function popup(text,width,height){
newWin=window.open(text,"","width="+width+",height="+height+",top=10,left=10,scrollbars=yes");
}
//<a href="javascript:popup('popups/pop1.htm','690','225');">
//<a name="close" href="#" onClick="window.close();">Close</a>

function popupNoScr(text,width,height){
newWin=window.open(text,"","width="+width+",height="+height+",top=30,left=30");
}
//<a href="javascript:popup('popups/pop1.htm','690','225');">
//<a name="close" href="#" onClick="window.close();">Close</a>

var regExp = /^.+\@.+\..+$/; //Define regular expression for email address validation

function validForm(){

	if(document.getElementById('myform').name.value == ""){
		alert("Please supply your name");
		return false;
	}
	
	if(!document.getElementById('myform').email.value.match(regExp)){ //Check email address with regular expression
		alert('The email address you have given is not valid.\nPlease supply a valid email address.');
		return false;
	}
	
	if(document.getElementById('myform').message.value == ""){
		alert("Please provide details of your enquiry in the message box");
		return false;
	}

}

preLoad = new Array();

//preLoad[0] = "media/nav/nav_au_on.gif"
//preLoad[1] = "media/nav/nav_ce_on.gif"
//preLoad[2] = "media/nav/nav_projects_on.gif"
//preLoad[3] = "media/nav/nav_pe_on.gif"
//preLoad[4] = "media/nav/nav_news_on.gif"
//preLoad[5] = "media/nav/nav_cu_on.gif"

//preloadImages();

function changePic(id, directory){
	eval("document.getElementById(\'main_shot\').src = \'media/" + directory + "/" + id + ".jpg\';");
}
//-->