startList = function() {
	if (document.all&&document.getElementById) {
		topnaviRoot = document.getElementById("topnavi");
		for (i=0; i<topnaviRoot.childNodes.length; i++) {
			node = topnaviRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

var slideShowSpeed = 6000
var t
var j = 0

var preLoad = new Array()
for (var i = 0; i < Pic.length; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow() {
	blendimage('middle_banner', 'middle_banner_image', preLoad[j].src, 2000)
	j = j + 1
	if (j > (Pic.length - 1)) j = 0
	t = setTimeout('runSlideShow()', slideShowSpeed)
}
	
function centre(size,area) {
	return (area/2)-(size/2);
}

function open_window(fileName, windowName, windowWidth, windowHeight, scrollbars, resizable) {
	window.open(fileName, windowName, 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=' + scrollbars + ', resizable=' + resizable + ', left=' + centre(windowWidth, screen.availWidth) + ', top=' + centre(windowHeight, screen.availHeight) + ', width=' + windowWidth + ', height=' + windowHeight);
}

function checkDate(element) {
	my_regex = /^(?:[01]?[0-9]|2[0-9](?!\/0?2)|2(?:[0-8]|9(?=\/(?:0?2\/\d{2}0[48]|[2468][048]|[13579][26])))|(?:3(?:0|1(?=\/(?:0?[13578]|1[02]))))(?!\/0?2))\/(?:0?[1-9]|1[0-2])\/(?:\d{4})$/
	if (element.value != "" && my_regex.test(element.value) == false) {
		alert("You have not entered a valid date, please try again using the \"DD/MM/YYYY\" format.")
		element.focus();
		return false;
	}
}

function toggleDisplay (element, show) {
	element.style.display = show;
	return true;
}

function theflash(movie,width,height) 
{
	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'">\n');
    document.write('<param name="movie" value="'+movie+'">\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="menu" value="false">\n');
	document.write('<param name="wmode" value="transparent">\n');
	document.write('<embed src="'+movie+'" width="'+width+'" height="'+height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed>\n');
    document.write('</object>\n');
	
}

function quickSelect(formName, value) {
    if (value != "") {
        document.getElementById(formName).submit();
    }
}