function BrowserInfo()
{
  this.name = navigator.appName;
  this.codename = navigator.appCodeName;
  this.version = navigator.appVersion.substring(0,4);
  this.ieVersion = navigator.appVersion.substring(22,25) * 1;
  this.platform = navigator.platform;
  this.javaEnabled = navigator.javaEnabled();
  this.screenWidth = screen.width;
  this.screenHeight = screen.height;
}
myBrowser = new BrowserInfo();
function patchIe5Style() {
	if (myBrowser.name=="Microsoft Internet Explorer" && myBrowser.ieVersion < 6) {
		document.writeln("<link href='css/ie5.css' rel='stylesheet' type='text/css'>"); 
	}
}
// -----------------------------------------------------------------------------------------
// Choose header: Randomly returns  one of two header graphics (east or west)
function chooseHeader() {
	var ran_num = Math.floor(Math.random()*100);
	//St. Luke East Header Graphic
	if (ran_num < 51) return("<img src='http://www.health-alliance.com/stLuke/images/top_sle.jpg' width='270' height='121'>");
	else return("<img src='http://www.health-alliance.com/stLuke/images/top_slw.jpg' width='270' height='121'>");
}
// -----------------------------------------------------------------------------------------
// Horizontal Nav Background swap
function hNavBgSwap ( cellId ){
	var classOff = "hNav";
	var classOn = "hNavRo";
	if (document.getElementById(cellId).className == classOff) switchClass( cellId, classOn );
	else switchClass(cellId, classOff);
}
function switchClass( whatID, whatClass ) {
	document.getElementById(whatID).className = whatClass;
}

// -----------------------------------------------------------------------------------------
txtSize = 76;  //Original text size (percentage). Could be loaded from a cookie.

// initTxtSize: reads in saved text size from a cookie. applies to the page
function initTxtSize() {
		if ( readCookie( "txtSize" ) != "" ) txtSize = readCookie( "txtSize" ) * 1; // load txtSize and convert to number
		document.body.style.fontSize = txtSize + "%"; // apply txtSize to the page
}

// txtResize function: changes global text size in a page
// optional parameters are direction (up or down) and amount (in percentage points)
function txtResize( direction, amount ) {
	
	var isUp = true;
	var defaultIncrement = 5;
	var maxSize = 110;
	var minSize = 60;
	
	if (amount == null) amount = defaultIncrement;
	amount = parseFloat(amount);
	
	if ( direction != "Down" && direction != "down" ) isUp = true;
	else isUp = false;
	if (!isUp) amount = 0 - amount;
	
	if (txtSize + amount < maxSize && txtSize + amount > minSize) {
		txtSize = txtSize + amount
		document.body.style.fontSize = txtSize + "%"
	
		//save the text size to a cookie, to be loaded for the rest of the site
		writeCookie( "txtSize", txtSize )
	}
}

// -----------------------------------------------------------------------------------------
// Submit Search Form (in left nav)
function submitStLukeSearch() {
	document.stLukeSearch.submit();
}

// -----------------------------------------------------------------------------------------
//Macromedia Scripts
<!--
// ***  DreamWeaver DIV / Layer scripts  
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_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_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; }
}
//-->
<!--
// Rollover Image Swap
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_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_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 THA_swapImage() { //v3.0
  var i,j=0,x,a=THA_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_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

// - - - - - Begin Macromedia Cookie Scripts - - - - - //
function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}

function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}
//-----------------------------------------------------------------------------------------
// Open Women's Heart Advantage as popup
function openWomensHeart() {
	GenericWin = window.open("http://www.besthearthealth.com/womensheart/","thegenericwindow","width=635,height=450,scrollbars=yes,toolbar=no,status=no,resizable=no,menubar=no,left=100,top=10");
}
function openFlorenceFreedom() {
	GenericWin = window.open('http://www.health-alliance.com/stluke/florenceFreedom.html','thegenericwindow','width=600,height=450,scrollbars=yes,toolbar=no,status=no,resizable=no,menubar=no,left=100,top=10');
}

//-----------------------------------------------------------------------------------------
// Print Page Functions
function openPrint() {
	window.open('/stluke/_printerFriendly.html','printerWin','width=675,height=550,scrollbars=yes,toolbar=yes,status=yes,resizable=yes,menubar=yes')
}
function getHeader() {
	var myString = window.opener.document.getElementById('contentHeader').innerHTML;
	document.write( myString );
}
function getContent() {
	var myString = window.opener.document.getElementById('contentArea').innerHTML;
	document.write( myString );
}
function getCopyright() {
	var myString = window.opener.document.getElementById('copyright').innerHTML
	document.write( myString );
}
function printPage() {
	window.print();
}
//-----------------------------------------------------------------------------------------