window.onload = init;function init() {setItemVal();externalLinks();replaceTag();}var photoWin = null;function viewPhoto( imgSrc, imgTitle ) {	if( photoWin ) {		photoWin.close();	}	photoWin = window.open( '', 'photoWin', 'width=150,height=150' );	var htm = '<html>' +	'<head>' +	'<title>' + imgTitle + '</title>' +	'<meta http-equiv="imagetoolbar" content="false" />' +	'</head>' +	'<body style="margin: auto; padding: auto; overflow: hidden;" onload="document.getElementById(\'theDiv\').style.visibility=\'visible\';document.getElementById(\'closeWin\').style.visibility=\'visible\';window.resizeTo(document.images[ \'theImage\' ].width+30,document.images[ \'theImage\' ].height+70);">' +	'<p style="font: 11px Verdana,sans-serif; position: absolute; top: 10px; left: 10px;">Image Loading<br /><blink>Please wait...</blink></p>' +	'<div id="theDiv" style="visibility: hidden; position: absolute; top: 10px; left: 10px; text-align: center;"><img src="' + imgSrc + '" border="0" id="theImage" alt="' + imgTitle + '" /></div>' +	'<div id="closeWin" style="visibility: hidden; position: absolute; top: 5px; left: 0; width: 100%; z-index: 100; text-align: right; display: block;"><form><input type="button" style="background: #fff; border: 1px solid #000000; color: #000000; font: bold 11px Verdana, sans-serif; margin-right: 5px; display: inline;" onclick="window.close();" value="Close Window" /></form></div>' +	'</body>' +	'</html>';	photoWin.document.write( htm );	photoWin.document.close();}var popUpWin = null;function openWindow( winUrl, winWidth, winHeight ) {    if( popUpWin ) {		popUpWin.close();	}	popUpWin = window.open( winUrl, 'popUpWin', 'width=' + winWidth + ',height=' + winHeight + ',status=yes,scrollbars=yes,resizable=yes' );}function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=0; i<anchors.length; i++) { var anchor = anchors[i]; if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank"; } }function setItemVal() {	// get value passed from url - in this case ?subject=1	var val = getVal( 'subject' );	// target item	var item = document.getElementById( 'menu' );	// loop through menu and select	if( val && item ) {		for( var i = 0; i < item.length; i ++ ) {			var vals = item.options[ i ];			if( vals.value == unescape( val ) ) {				vals.selected = true;			}		}	}}function getVal( var_name ) {	// return matching value for var_name in url string	var query = window.location.search.substring( 1 );	// loop through all parameteres on url	var values = query.split( '&' );	for( var i = 0; i < values.length; i ++ ) {		var pair = values[ i ].split( '=' );		if( pair[ 0 ] == var_name ) {			return pair[ 1 ];		}	}	return;}function verifyForm( theForm ) {	for( i = 0; i < theForm.elements.length; i++ ) {		var theFld = theForm.elements[i];		var reqFld = ( theFld.id.indexOf( '_Req' ) != -1 ) ? true : false;		var valSet = ( theFld.value == 0 || theFld.value == '' ) ? false : true;		var fldChop = theFld.id.split( '_Req' );		var fldName = fldChop[0].split( '_' ).join( ' ' );		if( reqFld == true && ( valSet == false || ( theFld.type == 'checkbox' && theFld.checked == false ) ) ) {			alert( fldName + ' cannot be left blank' );			if( theFld.type == 'text' || theFld.type == 'textarea' ) {				theFld.focus();				theFld.select();			} else {				theFld.focus();			}			return false;		}		if( fldName.indexOf( 'Email' ) != -1 && valSet ) {			if( !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test( theFld.value )) {				alert( fldName + ' ' + theFld.value + ' is not in a recognised format' );				theFld.focus();				theFld.select();				return false;			}		}	}    var btns = document.getElementsByTagName( 'input' );	for( btn=0; btn<btns.length; btn++ ) {		if( btns[ btn ].type == 'submit' ) {			btns[ btn ].disabled = true;			btns[ btn ].value = 'Sending...';		}	}	return true;}function mailTo( e, m, v) {	var d = 'invocal.co.uk';		if( ! v ) var v = e + '@' + d;		return '<a href="mailto:' + e + '@' + d + '?subject=' + m + '" title="' + m + '">' + v + '</a>';}function replaceTag() {	if( document.createElement && document.getElementsByTagName ) {		var target = document.getElementsByTagName( 'h1' );		var replace = document.createElement( 'img' );		for( var i = 0; i < target.length; i ++ ) {			if( target[ i ].id ) {				var y = replace.cloneNode( true );				y.src = res_path + '_res/_img/h1/' + target[ i ].id;				y.alt = target[ i ].firstChild.nodeValue;				with ( y.style ) {width = '200px';height = '57px';margin = '0';padding = '0';backgrounColour = 'transparent';}				target[ i ].replaceChild( y, target[ i ].firstChild );			}		}	}	return;}