function simplePreload(){ 
	var args = simplePreload.arguments;
	document.imageArray = new Array(args.length);
	for(var i=0; i<args.length; i++){
		document.imageArray[i] = new Image;
		document.imageArray[i].src = args[i];
	}
}

function ChangeImage(strImageUrl,strImageName){
	objImage = document.getElementById('largeImage');
	objImage.style.display = 'none';
	objImage.src = strImageUrl;
	new Effect.Appear('largeImage');


	objImageCap = document.getElementById('imagecaption');
	if(strImageName==""){strImageName="&nbsp;";}
	objImageCap.innerHTML = "<p>"+strImageName+"</p>";




	
}

function changeVideo(strVideoUrl,strVideoName){
var placeholder = document.getElementById("videoplaceholder");
var str = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="400" height="260" id="wasp10143" name="wasp10143" align="middle">';
	str += '			<param name="allowScriptAccess" value="sameDomain" />';
	str += '			<param name="movie" value="../wasp.swf?theFile='+strVideoUrl+'&startPlayingOnload=yes" />';
	str += '			<param name="loop" value="false" />';
	str += '			<param name="menu" value="false" />';
	str += '			<param name="quality" value="high" />';
	str += '			<param name="scale" value="noscale" />';
	str += '			<param name="salign" value="lt" />';
	str += '			<param name="bgcolor" value="#000000" />';
	str += '			<embed src="../wasp.swf?theFile='+strVideoUrl+'&startPlayingOnload=no" loop="false" menu="false" quality="high" scale="noscale" salign="lt" width="400" height="260" name="wasp10143" align="middle" bgcolor="#000000" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	str += '		</object>';
	placeholder.innerHTML = str;

	objVideoCap = document.getElementById('videocaption');
	if(strVideoName==""){strVideoName="&nbsp;";}
	objVideoCap.innerHTML = "<p>"+strVideoName+"</p>";
}

function confirmDelete() {
	if (confirm('Are you sure you want to delete this?')) {
		return true;
	} else {
		return false;
	}
}

function allowExt(what,allowed) {
	var strExtension = what.value.substr(what.value.length-3, 3)
	if (allowed.indexOf(strExtension) < 0) {
		alert("The file type you have selected is not allowed. Please select a different file.\n\nIf the file is a 'jpeg', please rename the extension to 'jpg'.");
		return false;
	} else {
		return true;
	}
}

function disallowExt(what,disallowed) {
	var strExtension = what.value.substr(what.value.length-3, 3)
	if (disallowed.indexOf(strExtension) >= 0) {
		alert("The file type you have selected is not allowed. Please select a different file.\n\nIf the file is a 'jpeg', please rename the extension to 'jpg'.");
		return false;
	} else {
		return true;
	}
}

function validateNewsSearch(what) {
	if (what.q.value == '') {
		alert("Please enter a keyword and submit again");
		what.q.select();
		return false;
	} else {
		return true;
	}
}

function validateTeamSearch(what) {
	if (what.forename.value == '' && what.surname.value == '') {
		alert("Please enter a forename and/or surname and submit again");
		what.forename.select();
		return false;
	} else {
		return true;
	}
}

function dropjump(what) {
	window.location.href = 'default.php?cat=' + what.value;
}

function checkUncheckAll(theElement) {
	var theForm = theElement.form, z = 0;
	alert(theForm[z].name);
	while (theForm[z].type == 'checkbox' && theForm[z].name != 'checkall') {
		theForm[z].checked = theElement.checked;
		z++;
	}
}

function validateSiteSearch(what) {
	if (what.keyword.value == '') {
		alert("Please enter a search term and submit again.");
		what.keyword.select();
		return false;
	} else {
		return true;
	}
}

// ****************************************************
// Show/Hide functions for the FAQs section of the CMS.
// ****************************************************

	function showHideAnswer()
	{
		var numericID = this.id.replace(/[^\d]/g,'');
		var obj = document.getElementById('a' + numericID);
		if(obj.style.display=='none'){
			obj.style.display='block';
		}else{
			obj.style.display='none';
		}		
	}
	
	
	function initShowHideContent()
	{
		var divs = document.getElementsByTagName('DIV');
		for(var no=0;no<divs.length;no++){
			if(divs[no].className=='question'){
				divs[no].onclick = showHideAnswer;
			}	
			
		}	
	}

	window.onload = initShowHideContent;


