function MM_preloadImages(){var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}
function MM_swapImgRestore(){var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}
function MM_findObj(n, d){var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);if(!x && d.getElementById) x=d.getElementById(n); return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}
// START ROW COLOUR CHANGE
function changecolour(idname){idname.style.backgroundColor = '#CCCCCC';idname.style.cursor = 'hand';}
function changeback(idname){idname.style.backgroundColor = '#FFFFFF';}
// CONTACT FORM
function contactForm_Validator(theForm){
if (theForm.Name.value == ""){alert("Please enter your name.");theForm.Name.focus();return (false);}
if (theForm.email.value == ""){alert("Please enter your email address.");theForm.email.focus();return (false);}return (true);}
// START CENTERED POPUP
function openDefaultWindow(fpath,wWidth,wHeight){var winX=(screen.availWidth - wWidth)*.5;var winY=(screen.availHeight - wHeight)*.5;win1 = window.open(fpath, "_________", "toolbar=yes,menubar=yes,resize=yes,width=" + wWidth + ",height=" + wHeight + ",left=" + winX + ",top=" + winY + ",scrollbars=yes");}
// window open
function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features);}
//flash embed - Kay Smoljak - based on code by Chris Nott (chris[at]dithered[dot]com)
var flashVersion = 0;function getFlashVersion(){var latestFlashVersion=8;var agent=navigator.userAgent.toLowerCase();if(navigator.plugins!=null&&navigator.plugins.length>0){var flashPlugin=navigator.plugins['Shockwave Flash'];if (typeof flashPlugin=='object'){for(var i=latestFlashVersion;i>=3;i--){if (flashPlugin.description.indexOf(i+'.')!=-1){flashVersion=i;break;}}}}else if(agent.indexOf("msie")!=-1&&parseInt(navigator.appVersion)>=4&&agent.indexOf("win")!=-1&&agent.indexOf("16bit")==-1){var doc='<scr'+'ipt language="VBScript"\>\n';doc+='On Error Resume Next \n';doc+='Dim obFlash \n';doc+='For i='+latestFlashVersion+' To 3 Step -1 \n';doc+='Set obFlash=CreateObject("ShockwaveFlash.ShockwaveFlash."&i)\n';doc+='If IsObject(obFlash) Then \n';doc+='flashVersion=i \n';doc+='Exit For \n';doc+='End If \n';doc+='Next \n';doc+='</scr' + 'ipt\>\n';document.write(doc);} else{flashVersion=flashVersion_DONTKNOW;}return flashVersion;}flashVersion_DONTKNOW=-1;function flasher(flashfile,statik,minver,height,width,alt){var flashVersion=getFlashVersion();if(flashVersion>=minver){document.write('<object type="application/x-shockwave-flash" data="' + flashfile + '" width="' + width + '" height="' + height + '">');document.write('<param name="movie" value="' + flashfile + '" />');document.write('<img src="' + statik + '" width="' + width + '" height="' + height + '" alt="' + alt + '" title="" />');document.write(' </object>');}else{document.write('<img src="' + statik + '" width="' + width + '" height="' + height + '" alt="' + alt + '" title="" />');}}

var num;

function generate_randimage()
{
	num = Math.floor(Math.random()*8);
	
		if ( num == 0 )
		{
			generate_randimage();
		}
		
	html = '';
	html += '<img src="/grfx/anti-spam/image' + num + '.jpg" alt="Anti-Spam Code" width="150" height="35" />';
	html += "\n";
	html += '<input type="hidden" name="pwAntiCode" value="' + num + '" />';
	return html;
}

function set_email()
{
	document.getElementById('pwRecipients').value = document.getElementById('department').value
}

//sfhover - js for ie6 dropdowns

sfHover = function() {
	var sfEls = document.getElementById("navigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);
