var Events;
(function (){
	if(!Array.prototype.pop){Array.prototype.pop=function(){var r=null;if(this.length){r=this[this.length-1];--this.length;}return r;};}
	if(!Array.prototype.push){Array.prototype.push=function(){for(var i=0;i<arguments.length;++i){this[this.length]=arguments[i];}return this.length;};}
	if(!Array.prototype.shift){Array.prototype.shift=function(){var r=null;if(this.length){r=this.reverse().pop();this.reverse();}return r;};}
	if(!Array.prototype.splice){Array.prototype.splice=function(b,d){var m=b+d,af=this.slice(m),r=d>0?this.slice(b,m-1):[];for(var i=2;i<arguments.length;++i){af.unshift(arguments[i]);}if(b>0){this.slice(0,b).concat(af);}else{while(this.length){this.pop();}while(af.length){this.push(af.pop());}}return r;};}
	if(!Array.prototype.unshift){Array.prototype.unshift=function(){this.reverse();for(var i=0;i<arguments.length;++i){this.push(arguments[i]);}this.reverse();return this.length;};}
	Array.prototype.within=function(s,b){var r=false;for(var i=0;i<this.length&&r===false;++i){if(s==this[i]){r=true;}}return b?r?--i:-1:r;};
	Function.prototype.selfName=function(){var s;return(s=/function (\w+)/.exec(this.toString()))?s[1]:'(anonymous)';};
	String.prototype.escapeHTML=function(){return this.replace(/\&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');};
	String.prototype.trimWhiteSpace=function(){return this.replace(/\t/g,'    ').replace(/\r\n?/g,'\n').replace(/^(\s*\S*(\s+\S+)*)\s*$/,'$1');};

	function isAlien(a){return isObject(a)&&typeof a.constructor!='function';}
	function isArray(a){return isObject(a)&&a.constructor==Array;}
	function isBoolean(a){return typeof a=='boolean';}
	function isEmpty(o){var i,v;if(isObject(o)){for(i in o){v=o[i];if(isUndefined(v)&&isFunction(v)){return false;}}}return true;}
	function isFunction(a){return typeof a=='function';}
	function isNull(a){return typeof a=='object'&&!a;}
	function isNumber(a){return typeof a=='number'&&isFinite(a);}
	function isObject(a){return(a&&typeof a=='object')||isFunction(a);}
	function isString(a){return typeof a=='string';}
	function isUndefined(a){return typeof a=='undefined';}

	// mozilla equivalent for insertAdjacentElement and (inn|out)er HTML|Text in IE5+
	if(typeof HTMLElement!='undefined'){
		HTMLElement.method=Function.prototype.method;
		HTMLElement.prototype.__defineSetter__('outerHTML',function(s){var r=this.ownerDocument.createRange();r.setStartBefore(this);var df=r.createContextualFragment(s);this.parentNode.replaceChild(df,this);});
		HTMLElement.prototype.__defineGetter__('outerHTML',function(){var aA=this.attributes,eT=['area','base','basefont','br','col','frame','hr','img','input','isindex','link','meta','param'],cA=['checked','compact','declare','defer','disabled','ismap','multiple','nohref','noresize','noshade','nowrap','readonly','selected'],t=this.tagName.toLowerCase(),s='<'+t;
			for(var i=0,a=aA[i].name.toLowerCase(),p=cA.within(a,true),v=aA[i].value,l=aA.length;i<l;++i){s+=' '+a+'="'+((p>-1&&!v.length)?cA[p]:v)+'"';}
			s+=(eT.within(t))?' />':'>'+this.innerHTML+'</'+t+'>';return s;});
		HTMLElement.prototype.__defineSetter__('innerText',function(s){this.innerHTML=s.escapeHTML();});
		HTMLElement.prototype.__defineGetter__('innerText',function(){var r=this.ownerDocument.createRange();r.selectNodeContents(this);return String(r);});
		HTMLElement.prototype.__defineSetter__('outerText',function(s){this.outerHTML=s.escapeHTML();});
		HTMLElement.prototype.__defineGetter__('outerText',function(){return this.innerText();});
		if(!HTMLElement.prototype.insertAdjacentElement){
			HTMLElement.prototype.insertAdjacentElement=function(w,pN){switch(String(w).toLowerCase()){case 'afterbegin':this.insertBefore(pN,this.firstChild);break;case 'afterend':if(this.nextSibling){this.parentNode.insertBefore(pN,this.nextSibling);}else{this.parentNode.appendChild(pN);}break;case 'beforebegin':this.parentNode.insertBefore(pN,this);break;case 'beforeend':this.appendChild(pN);break;}};
			HTMLElement.prototype.insertAdjacentHTML=function(w,S){var r=this.ownerDocument.createRange();switch(String(w).toLowerCase()){case 'beforebegin':r.setStartBefore(this);break;case 'beforeend':case 'afterbegin':r.selectNodeContents(this);r.collapse(false);break;case 'afterend':r.setStartAfter(this);break;}var pH=r.createContextualFragment(S);this.insertAdjacentElement(w,pH);};
			HTMLElement.prototype.insertAdjacentText=function(w,s){this.insertAdjacentHTML(w,s.escapeHTML());};
		}
	}
	Events=Events||{};
	Events.add=function(elm,evType,fn,useCapture){
		if(Events.orig!==null&&elm==window&&evType=='load'){var wo=Events.orig;Events.orig=null;Events.add(window,'load',wo);}
		var ret;evType=evType.toLowerCase();if(typeof useCapture!='boolean'){useCapture=new Boolean(false);}
		if(elm===window&&!window.addEventListener&&document.addEventListener){elm=document;} // Opera 7 check
		if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);ret=true;}
		else if(elm.attachEvent){ret=elm.attachEvent('on'+evType,fn);if(!ret){ret=true;}}
		else{
			this.fName=fn.selfName();if(!elm.events){elm.events={};}if(!elm.events[evType]){elm.events[evType]={};}
			if(/anonymous/.test(this.fName)){if(!elm.events[evType]['anonymous']){elm.events[evType]['anonymous']=[];}elm.events[evType]['anonymous'].push(fn);}
			if(!elm.events[evType][this.fName]||elm.events[evType][this.fName]===null){elm.events[evType][this.fName]=fn;}
			var oe=elm['on'+evType];if(oe&&oe!==null&&!elm.events[evType][oe.selfName()]){elm.events[evType][oe.selfName()]=oe;}
			elm['on'+evType]=function(e){e=e||window.event;for(var fn in this.events[evType]){if(this.events[evType][fn]!==null){if(/anonymous/.test(fn)){for(var i=0,l=this.events[evType][fn].length;i<l;++i){this.events[evType][fn][i]();}}else{this.events[evType][fn]();}}}if(self.routeEvent){routeEvent(e);}};
			if(elm.captureEvents){elm.captureEvents(Event[evType.toUpperCase()]);}ret=true;
		}return this.check(ret,fn);
	};
	Events.check=function(r,fn){if(typeof r!='boolean'){var s=fn.selfName();window.alert(s+' function handler could not be assigned');r=new Boolean(false);}return r;};
	Events.remove=function(elm,evType,fn,useCapture){ // can't be used with anonymous functions...
		if(/anonymous/.test(fn.selfName())){return this.check(false,fn);}
		var ret;evType=evType.toLowerCase();if(!isBoolean(useCapture)){useCapture=new Boolean(false);}
		if(elm===window&&!window.addEventListener&&document.addEventListener){elm=document;} // Opera 7 check
		if(elm.removeEventListener){elm.removeEventListener(evType,fn,useCapture);ret=true;}
		else if(elm.detachEvent){ret=elm.detachEvent('on'+evType,fn);if(!ret){ret=true;}}
		else{var fName=fn.selfName();if(elm.events&&elm.events[evType]&&!(/anonymous/.test(elm.events[evType][fName]))){if(elm.events[evType][fName]){elm.events[evType][fName]=null;}}if(elm.releaseEvents&&isEmpty(elm.events[evType])){elm.releaseEvents(Event[evType.toUpperCase()]);}ret=true;}
		return this.check(ret,fn);
	};
	Events.orig=(typeof window.onload=='undefined'||window.onload=='null')?null:window.onload;
})();

var __Browser=function(){
	var self=this;this.__parseInt=function(x,r){return isNaN(r=parseInt(x,10))?0:r;};this.__db=(document.compatMode&&document.compatMode.toLowerCase()!='backcompat'||document.documentElement)?document.documentElement:(document.body||null);this.__n6=!!((typeof window.getComputedStyle!=='undefined')&&(typeof document.createRange!=='undefined'));
	this.Opera=!!(window.opera);this.OperaVer=this.Opera?!!(window.getSelection)?9:!!(opera.defineMagicFunction)?8:!!(opera.version)?7.6:!!(document.createComment)?7:!!(opera.buildNumber)?6:5:0;
	this.IE=!!(document.all&&!self.Opera&&self.__db&&(/microsoft/i.test(navigator.appName)));this.IEVer=self.IE?(/mac/i.test(navigator.platform))?5.2:!!(document.createComment)?6:!!(document.fireEvent)?5.5:!!(document.getElementById)?5:4:0;this.IEMac=!!(self.IE&&(self.IEVer===5.2));
	this.w3c=!!(!self.Opera&&!self.IE&&!self.__n6&&document.getElementById);this.NN4=!!(!self.w3c&&document.layers&&(typeof document.classes!=='undefined'));this.Safari=!!(!document.all&&document.childNodes&&!navigator.taintEnabled);this.px=self.NN4?'':'px';this.tiv=self.w3c?40:10;
	this.window={
		height:self.__parseInt((self.__db&&!self.Opera&!self.w3c&&self.__db.clientHeight)?self.__db.clientHeight:(window.innerHeight||0)),
		scroll:{x:self.__parseInt(window.pageXOffset||(self.__db?self.__db.scrollLeft:0)),y:self.__parseInt(window.pageYOffset||(self.__db?self.__db.scrollTop:0))},
		width:self.__parseInt((self.__db&&!self.Opera&&!self.w3c&&self.__db.clientWidth)?self.__db.clientWidth:(window.innerWidth||0))
	};
};
var Browser=new __Browser();

/* Run on DOM loaded code */
/* this is the function that will run */
function domInit(){
	if(arguments.callee.done){return;}arguments.callee.done=true; //double execution check
	if((document.all&&(/mac/i.test(navigator.appVersion)))||(document.getElementById?0:document.layers?1:0)){return;} // we don't run script on IE5.2/Mac or NN4...
	loadedInit();
}
/* conditional IE/Win code */
/*@cc_on
@if (@_win32)
	document.write('<script id="__ie_onload" defer src="//0"><\/script>');
	document.getElementById('__ie_onload').onreadystatechange=function(){if(this.readyState=='complete'){domInit();}};// call the onload handler
@end
@*/
/* End IE/Win conditional code */
if(document.addEventListener){
	document.addEventListener('DOMContentLoaded',domInit,null); // Mozilla only...
	/* for Safari */
	if(/WebKit|KHTML/i.test(navigator.userAgent)){
		window.__WebKitTimer=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){
			window.clearInterval(window.__WebKitTimer);try{delete window.__WebKitTimer;}catch(ex){window.__WebKitTimer=null;} // clear the interval
			domInit(); // call the onload handler
		}},10);
	}
}
else{Events.add(window,'load',domInit);}
/* do not change above this line */

function loadedInit(){
	//setForm();
	setPrint();
	//sortNav();
}
/* end DOM loaded code */

function changeImage(name,src){if(document.images){document.images[name].src=src;}}
function checktext(field,out){
	if(out&&field.value.length===0){field.value=field.defaultValue;}
	else if(field.defaultValue.toLowerCase()==field.value.toLowerCase()){field.value='';}
}
function clearText(field,def){if(field.value.toLowerCase()==(def&&def.length?def:field.defaultValue).toLowerCase()){field.value='';}}
function resetText(field){if(field.defaultValue.length&&!field.value.length){field.value=field.defaultValue; }}
function setForm(){
	if(document.forms.length){
		for(var i=0,f;i<document.forms.length;++i){
			f=document.forms[i];for(var j=0,e;j<f.length;++j){
				e=f[j];if(/^(text|pass)/.test(e.type)){
					if(!e.defaultValue){e.defaultValue='';}
					e.onblur=new Function('checkText(this,true);');
					e.onfocus=new Function('checkText(this);');
					if((e.defaultValue.length===0)&&document.getElementsByTagName){
						var l=document.getElementsByTagName('label');
						for(var k=0;k<l.length;++k){if(l[k].htmlFor==e.id){e.defaultValue=e.value=l[j].innerText.replace(':','');break;}}
					}
				}
			}
		}
	}
}
function setPrint(){
	if(window.print){
		var pEl=document.getElementById?document.getElementById('printLink'):document.all?document.all['printLink']:null;
		if(pEl){pEl.innerHTML='<a class="print" href="#" onclick="return printer();" onkeypress="return printer();" title="Print this page"><span class="hide">Print this page</span></a>';}
	}
}
function printer(){if(window.print){window.print();}return false;}
function changePage(id){
	var d=document,pN=d.all?d.all['PageNumber']:d.getElementById?d.getElementById('PageNumber'):null;
	if(pN){pN.value=id;if(__doPostBack){__doPostBack('PageClick','');}}
}
var popUpWin=0;
function popUp(URLStr,left,top,width,height){
	if(popUpWin&&!popUpWin.closed){popUpWin.close();}
	popUpWin=open(URLStr,'popUpWin','copyhistory=yes,toolbar=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top);
}

function sortNav(){
	var l=document.getElementById('topNav').getElementsByTagName('dd'),i=-1,item;
	if(l){while((item=l[++i])){var a=item.getElementsByTagName('a'),j=-1,link;while((link=a[++j])){
		link.style.textIndent='-999em';link.style.display='block';link.style.textIndent='';
	}}}
}

//Webforms validation ------------------------------------------
function checkEmail(objFld){
	var emailFld = objFld;
	var strEmail = objFld.value;
	var reEmail = /^[a-zA-Z0-9_\-\.\']+\@([a-zA-Z0-9_\-]+\.){1,4}[a-zA-Z]{2,4}$/;
	if(strEmail === ''){window.alert('Please enter an email adddress');objFld.focus();return false;}
	else{
		if(!reEmail.test(strEmail)){window.alert('Please enter a valid email adddress');objFld.focus();return false;}
		else{return true;}
	}
}

function checkMatch(objFld,strMatch,strFldName){
	var reMatch = new RegExp('^' + strMatch + '$', "i");
	var strVal = objFld.value;
	if (strVal !== ''){
		if(!reMatch.test(strVal)){window.alert('Please enter a valid ' + strFldName);objFld.focus();return false;}
		else{return true;}
	}
	else{return true;}	
}

function checkText(objFld,strFldName){
	if(objFld.value===''){window.alert('Please complete the ' + strFldName + ' field');objFld.focus();return false;}
	else{return true;}
}

function checkGroup(objFld,strFldName){
	var bHalt = false;
	for (var i=0;i<objFld.length;++i){
		if (objFld[i].checked){
			bHalt = true;
		}
	}
	if(!bHalt){window.alert('Please select one of the ' + strFldName + ' options');objFld[0].focus();}
	return bHalt;
}

function checkDropDown(objFld,strFldName){
	if(objFld.selectedIndex === 0){window.alert('Please select one of the ' + strFldName + ' options');objFld[0].focus();return false;}
	else{return true;}
}
function checkChecked(rbList){
	var checked=false;
	for(var i=0;i<rbList.length&&!checked;++i){checked=rbList[i].checked;}
	return checked;
}

function checkDetForm(theform){
	if ((theform.schemeName.value==='')&&(theform.employerName.value==='')&&(theform.decision_date_month.selectedIndex===0)&&(theform.decision_date_year.selectedIndex===0)&&!checkChecked(theform.breach)){
		window.alert('You must search for something');
		theform.schemeName.focus();
		return false;
	}
	else{return true;}
}

function checkWebEnquiry(theForm){
	if(!checkMatch(theForm.Email,"[A-Z0-9_\.'\-]+@([A-Z0-9_\-]+\.){1,4}[A-Z]{2,4}",'Email')){return false;}
	if(!checkText(theForm.Comments,'Comments')){return false;}
}

function checkSR(theForm){
	if(!checkMatch(theForm.Title,'[A-Za-z0-9\s~!&quot;@#$%&amp;\'\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]_\{\}\^&#xa3;&#x20ac;]*','Title')){return false;}
	if(!checkText(theForm.Forenames,'Forename')){return false;}		
	if(!checkMatch(theForm.Forenames,'[A-Za-z0-9\s~!&quot;@#$%&amp;\'\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]_\{\}\^&#xa3;&#x20ac;]*','Forename')){return false;}
	if(!checkText(theForm.Surname,'Surname')){return false;}
	if(!checkMatch(theForm.Surname,'[A-Za-z0-9\s~!&quot;@#$%&amp;\'\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]_\{\}\^&#xa3;&#x20ac;]*','Surname')){return false;}
	if(!checkText(theForm.Address1,'Address')){return false;}
	if(!checkText(theForm.Town,'Town')){return false;}
	if(!checkMatch(theForm.Postcode,'[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][A-Z]{2}','Postcode')){return false;}
	if(!checkMatch(theForm.Telephone,'[0-9 \-]{1,20}','Telephone')){return false;}
	if(!checkMatch(theForm.Email,"[A-Z0-9_\.'\-]+@([A-Z0-9_\-]+\.){1,4}[A-Z]{2,4}",'Email')){return false;}
}

function checkGE(theForm){
	if(!checkMatch(theForm.Title,'[A-Za-z0-9\s~!&quot;@#$%&amp;\'\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]_\{\}\^&#xa3;&#x20ac;]*','Title')){return false;}
	if(!checkText(theForm.Forenames,'Forename')){return false;}
	if(!checkMatch(theForm.Forenames,'[A-Za-z0-9\s~!&quot;@#$%&amp;\'\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]_\{\}\^&#xa3;&#x20ac;]*','Forename')){return false;}
	if(!checkText(theForm.Surname,'Surname')){return false;}
	if(!checkMatch(theForm.Surname,'[A-Za-z0-9\s~!&quot;@#$%&amp;\'\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]_\{\}\^&#xa3;&#x20ac;]*','Surname')){return false;}
	if(!checkMatch(theForm.Postcode,'[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][A-Z]{2}','Postcode')){return false;}
	if(!checkMatch(theForm.Email,"[A-Z0-9_\.'\-]+@([A-Z0-9_\-]+\.){1,4}[A-Z]{2,4}",'Email')){return false;}
	if(!checkMatch(theForm.Telephone,'[0-9 \-]{1,20}','Telephone')){return false;}
	if(!checkDropDown(theForm.Role,'Role')){return false;}
	if(!checkText(theForm.Enquiry,'Enquiry')){return false;}
	if(!checkGroup(theForm.Response,'Response')){return false;}
	if(theForm.Response[0].checked){if(!checkEmail(theForm.Email)){return false;}}
	if(theForm.Response[1].checked){if(!checkText(theForm.Address1,'Address')||!checkText(theForm.Town,'Town')||!checkText(theForm.County,'County')||!checkText(theForm.Postcode,'Postcode')){return false;}}
	if(theForm.Response[2].checked){if(!checkText(theForm.Telephone,'Telephone')){return false;}}
}

//Webforms validation end-----------------------------------------


/* </script> */