
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  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_preloadImages() { //v3.0
  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_findObj(n, d) { //v4.01
  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() { //v3.0
  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];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function qsearch()
{
	var searchpath = "http://www.bjsph.org/";
	if (location.hostname.indexOf('webmgmt') >= 0)
		searchpath='';
	if (document.forms["search"].query.value != "") {
		top.location.href=searchpath + 'bjsph_search.aspx?col=BJSPH&q=' + document.forms["search"].query.value;
		document.forms["search"].action = searchpath + 'bjsph_search.aspx?col=BJSPH&q=' + document.forms["search"].query.value;
	}	
	return false;
}

function simpleToBoolean()
{
	query = document.forms["avsearch"].q;
	queryString = query.value;
	if ((queryString.length > 0) && (queryString.indexOf(" ") > -1))
	{
		while (queryString != queryString.replace(/^ /,""))
			queryString = queryString.replace(/^ /,"");
		while (queryString != queryString.replace(/ $/,""))
			queryString = queryString.replace(/ $/,"");
		while (queryString != queryString.replace(/  /," "))
			queryString = queryString.replace(/  /," ");
		newQueryString = "";
		pos = 0;
		while (pos < queryString.length)
		{
			switch (queryString.charAt(pos))
			{
				case "'":
					if (queryString.indexOf("'",pos+1) > -1)
					{
						pos2 = queryString.indexOf("'",pos+1)
						newQueryString = newQueryString + queryString.substr(pos, pos2-pos+1);
						pos = pos2 + 1;
					}
					else
					{
						newQueryString = newQueryString + queryString.charAt(pos);
						pos = pos + 1;
					}
					break;
				case '"':
					if (queryString.indexOf('"',pos+1) > -1)
					{
						pos2 = queryString.indexOf('"',pos+1)
						newQueryString = newQueryString + queryString.substr(pos, pos2-pos+1);
						pos = pos2 + 1;
					}
					else
					{
						newQueryString = newQueryString + queryString.charAt(pos);
						pos = pos + 1;
					}
					break;
				case " ":
					newQueryString = newQueryString + " or ";
					pos = pos + 1;
					break;
				default:
					newQueryString = newQueryString + queryString.charAt(pos);
					pos = pos + 1;
			}
		}
		query.value = newQueryString;
	}
	document.forms["avsearch"].pg.value='aq'; 
	document.forms["avsearch"].submit();
}

function openPrintWin(url)
{
	winPrint = window.open(url,"","width=800,height=650,location=no,menubar=no,resizable=yes,scrollbars=yes");
	return false;
}

function FontResize()
	{
	// setDefaults arguments: size unit, default size, minimum, maximum
	// optional array of elements or selectors to apply these defaults to
	dw_fontSizerDX.setDefaults('px', 13, 9, 17, ['body', 'td', 'div', 'p', 'a', 'li', 'font', 'span'],'fontSize_bjsph');
	dw_fontSizerDX.set(12, 12, 12, ['div#sizer'] );
	dw_fontSizerDX.set(11, 11, 11, ['.sizer_small'] );
	dw_fontSizerDX.set(13, 13, 13, ['.sizer_medium'] );
	dw_fontSizerDX.set(15, 15, 15, ['.sizer_large'] );
	dw_fontSizerDX.init();
	}


<!-- Begin
if (document.layers) {navigator.family = "nn4"}
if (document.all) {navigator.family = "ie4"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {navigator.family = "gecko"}

//  popup text 
descarray = new Array(
"<block><a href='http://www.bjsph.org/bjsph_content.aspx?ID=2587'>Anti-Coagulation Clinic</a><br><a href='http://www.bjsph.org/bjsph_content.aspx?ID=2588'>Cardiac Diagnostic Lab</a><br><a href='http://www.bjsph.org/bjsph_content.aspx?ID=2589'>Cardiac Rehabilitation</a><br><a href='http://www.bjsph.org/bjsph_content.aspx?ID=2590'>Vascular Interventional Lab</a>"
);

overdiv="0";
function popLayer(a){
if(!descarray[a]){descarray[a]="<font color=red>This popup (#"+a+") isn't setup correctly - needs description";}
if (navigator.family == "gecko") {pad="0"; bord="1 bordercolor=black";}
else {pad="1"; bord="0";}
desc = 	  "<table cellspacing=0 width=80% cellpadding="+pad+" border="+bord+" ><tr><td>\n"
	+"<table cellspacing=0 cellpadding=3 border=0 width=100%><tr><td>\n"
	+descarray[a]
	+"\n</td></tr></table>\n"
	+"</td></tr></table>";if(navigator.family =="nn4") {
	document.object1.document.write(desc);
	document.object1.document.close();
	document.object1.left=x+15;
	document.object1.top=y-5;
	}
else if(navigator.family =="ie4"){
	object1.innerHTML=desc;
	object1.style.pixelLeft=x+15;
	object1.style.pixelTop=y-5;
	}
else if(navigator.family =="gecko"){
	document.getElementById("object1").innerHTML=desc;
	document.getElementById("object1").style.left=x+15;
	document.getElementById("object1").style.top=y-5;
	}
}
function hideLayer(){
if (overdiv == "0") {
	if(navigator.family =="nn4") {eval(document.object1.top="-500");}
	else if(navigator.family =="ie4"){object1.innerHTML="";}
	else if(navigator.family =="gecko") {document.getElementById("object1").style.top="-500";}
	}
}

var isNav = (navigator.appName.indexOf("Netscape") !=-1);
function handlerMM(e){
x = (isNav) ? e.pageX : event.clientX + document.body.scrollLeft;
y = (isNav) ? e.pageY : event.clientY + document.body.scrollTop;
}
if (isNav){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;

//For left manu nav extendedMenu (hide/display)
var HiddenMenu = null;
var TimeOutId = null;

function menuOver(MenuId){
  if((document.getElementById)&&(document.getElementById(MenuId)!=null)){
    if(HiddenMenu==document.getElementById(MenuId)){
        
      clearTimeout(TimeOutId );
    }
    else{
       
      if(HiddenMenu!=null){
        clearTimeout(TimeOutId );
        hideNow();
      }
    }
    HiddenMenu = document.getElementById(MenuId);

    if((HiddenMenu.style)&&(HiddenMenu.style.display!=null)){
		HiddenMenu.style.display = "block";
    }
  }
}

function stayOpen(MenuId) {
    if ( (HiddenMenu==null) || ( (HiddenMenu.style) && (HiddenMenu.style.display) && (HiddenMenu.style.display=='none') ) ) 
    {
        
        return;
    }
        
    else menuOver(MenuId);
}

function menuOut(MenuId) {
    if ( (document.getElementById) && (document.getElementById(MenuId) != null) ) {
        HiddenMenu = document.getElementById(MenuId);
        TimeOutId = window.setTimeout('hideNow();', 150);
    }
}

function hideNow() {
    if( (HiddenMenu.style) && (HiddenMenu.style.display) ) {
        MM_swapImgRestore();
        HiddenMenu.style.display = 'none';
         
    }
}

function fOpenQTMovie(QTMovFile) 
{ 
    var strFile = "http://mediaweb.bjc.org/bjsph/" + QTMovFile;
window.open(strFile,'jav','width=500,height=450,resizable=yes'); 
} 