wp=window.parent; bw=wp.bw; tp=location.href.match(/([^\/\.]+)\.html(#.*)?$/i); tp2=tp?tp[1].match(/barts/):0;
if(wp.showCont&&bw.loaded){
	if(!tp){ tq=location.href.match(/\?nurse=(\d+)/); tp=[,"nurse"+tq[1]]; }
	tp2=tp[1].match(/barts/);
	wp.showCont(tp[1]);
	if(bw.flash){ if(bw.ie)document.execCommand('Stop'); else window.stop(); }
}
/*if(!wp.showCont)window.top.location.replace("../index.html?goto="+tp[1]);
else{ alert(tp[1]); wp.showCont(tp[1]); }*/
function goHref(tp){
	el=document.getElementById(tp); if(!el)el=document.getElementById("A"+tp);
	et=el.offsetTop; if(!et)et=el.parentNode.offsetTop;
	window.scrollTo(0,et);
}
function get(el){ return document.getElementById(el); }
function bartsPOP(){
	POPbart=window.open("http://www.bartsandthelondon.nhs.uk");
	if(!POPbart)alert("Your browser settings did not allow you to open a new content window.\nPlease check the status of your Popup Blocker.");
}
function formCheck(){
	tp=f.email.value.match(bw.email)&&f.question.value.match(/\w+/);
	if(!tp)alert("Please enter your email address and your question.");
	return tp?true:false;
}
function barts(){
	get("DIVcontent").innerHTML="<h1>Please wait to be redirected to the main Barts &amp; The London website</h1>";
	setTimeout("bartsPOP(); wp.showFrame(0)",2000);
	if(bw.ie)document.execCommand('Stop'); else window.stop();
}
function init(){
	as=document.getElementsByTagName("a"); asl=as.length;
	for(l=0;l<asl;l++){
		if(as[l].href){
			if(as[l].parentNode.tagName.match(/li/i)){
				if(as[l].href.match(/home\.html$/)){
					as[l].innerHTML="close"; as[l].onclick=new Function("wp.showFrame(0); return false");
				}else if(bw.ie){
					hr=as[l].href.match(/#(.*)$/);
					if(hr)as[l].onclick=new Function("goHref('"+hr[1]+"'); return false");
				}
			}else if(!as[l].href.match(/register\.html$/)&&as[l].className!="top")as[l].target="_blank";
		}
	}
	f=document.forms[0];
	if(f)f.onsubmit=new Function("return formCheck()");
	if(tp2)barts();
}
if(wp.showCont)window.onload=init;
else if(tp2)window.onload=barts;
