// GetHeight, sets left bar to proper height
  var d = document;

  function getHeight(){
    var box = new Array("mainpageleftside","mainpagerightside","mainpagecontent"); //list of DIV ids
    for(x=0;x<box.length;x++){ //determine the tallest div
      h = d.getElementById(box[x]).offsetHeight;
      for(y=0;y<box.length;y++){
        test_h = d.getElementById(box[y]).offsetHeight;
        if(h<test_h) h = test_h;

      }  
    }
   // for(x=0;x<box.length;x++) d.getElementById(box[x]).style.height = h +"px"; //set the height of all divs to the tallest
    d.getElementById("mainpageleftside").style.height = h +"px";
  }


function StJohnInitPage()
	{
	init();
	MM_preloadImages('/images/RealMedicine/find_physician_on.gif','/images/RealMedicine/locations_on.gif','/images/RealMedicine/conditions_on.gif','/images/RealMedicine/health_info_on.gif','/images/RealMedicine/about_on.gif','/images/RealMedicine/CarePages_on.gif','/images/RealMedicine/search_on.gif','/images/RealMedicine/login_on.gif','/images/RealMedicine/more_on.gif');
	wo();
	}

function StJohnInitPage2007()
	{
	MM_preloadImages('/images/PassionForHealing/Redesign/nav/button_find_physician_on.gif','/images/PassionForHealing/Redesign/nav/button_find_service_on.gif','/images/PassionForHealing/Redesign/nav/button_about_stjohn_on.gif','/images/PassionForHealing/Redesign/nav/button_locations_on.gif','/images/PassionForHealing/Redesign/nav/button_job_openings_on.gif');
	MM_preloadImages('/images/PassionForHealing/Redesign/nav/button_for_patients_on.gif','/images/PassionForHealing/Redesign/search_on.gif','/images/PassionForHealing/Redesign/button_moreservices_on.gif','/images/PassionForHealing/Redesign/promos/promobox_right_learnmore_on.gif');
	init();
	}


function StJohnPharmacyInitPage()
	{
	init();
	MM_preloadImages('/images/PharmacyTemplate/our_store_on.gif','/images/PharmacyTemplate/our_catalog_on.gif','/images/PharmacyTemplate/order_prescrip_on.gif','/images/PharmacyTemplate/my_account_on.gif');
	wo();
	}
	
	
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_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 sjOpener(PageName, Width,Height)
{
	x=window.open(PageName, 'messageWindow', 'width='+Width+',height='+Height+',resizable=0,scrollbars=no,menubar=no,status=no,left=200,top=100');
}

function sjOpener_Scroll(PageName, Width,Height)
{
	x=window.open(PageName, 'messageWindow', 'width='+Width+',height='+Height+',resizable=0,scrollbars=1,menubar=no,status=no,left=200,top=100');
}

var agt = navigator.userAgent.toLowerCase();

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) history.go(0);
}
MM_reloadPage(true);

function P7_OpResizeFix(a) { //v1.1 by PVII
if(!window.opera){return;}if(!document.p7oprX){
 document.p7oprY=window.innerWidth;document.p7oprX=window.innerHeight;
 document.onmousemove=P7_OpResizeFix;
 }else{if(document.p7oprX){
  var k=document.p7oprX-window.innerHeight;
  var j=document.p7oprY - window.innerWidth;
  if(k>1 || j>1 || k<-1 || j<-1){
  document.p7oprY=window.innerWidth;document.p7oprX=window.innerHeight;
  location.reload();}}}
}
P7_OpResizeFix();

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 clearText(thefield) {
	if (thefield.defaultValue==thefield.value)
	thefield.value = ""
} 

// toggle visibility
function toggle( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  	}
}


var JS_LINK="javascript";
function openwin(url)
	{
	if(url.indexOf("donateonline.asp")>0)
		{
		 //myString = new String(url)
		//rExp = 'http:';
		//url = myString.replace(rExp, "https:")

		 //window.open(url,'_blank','height=480,width=650,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes')
		 window.open('https://www.stjohn.org/Foundation/donateonline.asp','_blank','height=480,width=650,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes')
		}
	else 
	{
	
	if(url.indexOf("make_appointment.asp")>0||url=="make_appointment.asp")
		{
		 window.open('https://www.stjohn.org/MakeAppt/make_appointment.asp','_blank','height=480,width=650,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes')
		}
	else 
		{
		window.open('https://vanelslandercancercenter.org/'+url,'_blank','height=480,width=650,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes')
		}
	}	
	}
	
function openwin2(url)
	{
	window.open(url,'_blank','height=650,width=600,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes');
	}


function wo()
{
  where = "_blank";
 
  for (var i=0; i<=(document.links.length-1); i++)
  {
    if(document.links[i].href.indexOf(THIS_SITE)<0 && document.links[i].href.indexOf(JS_LINK)<0)
		{
		 document.links[i].target=where;
		}
	if(document.links[i].href.indexOf("donateonline.asp")>0)
		{
		 document.links[i].href="javascript:openwin('"+document.links[i].href+"');";
		}

	if(document.links[i].href.indexOf("make_appointment.asp")>0)
		{
		 document.links[i].href="javascript:openwin('make_appointment.asp');";		
		}

	if(document.links[i].href.indexOf("make_appointment.asp")>0)
		{
		 document.links[i].href="javascript:openwin('make_appointment.asp');";		
		}

	if(document.links[i].href.indexOf("calculators.healthgate.com")>0)
		{
		 document.links[i].href="javascript:openwin2('"+document.links[i].href+"');";
		 document.links[i].target="";
		}
  }
}

function InfoForLinksSubmit(InfoForSelectList)
{
	var index=InfoForSelectList.selectedIndex;
	if (InfoForSelectList.options[index].value != "0") 
	{
		if (InfoForSelectList.options[index].value=="http://healthweb.stjohn.org/")
		{
			window.open(InfoForSelectList.options[index].value,'_blank','height=700,width=750,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes');
		}
		else
		{
			top.location=InfoForSelectList.options[index].value;
		}
	}
	return false;
}



//***************************************************
// OLD ITEMS - Eliminate After New Launch
//sjBookMarkPromo Items
	var sjBookMarkPromoTotal	= 0;
	var sjBookMarkPromoCurrent  = 0;
	var sjNextBookMark =0;
	var sjBookmarkAuto =false;

	function sjBookMarkPrevious()
		{
			sjBookmarkAuto=false;
			// If on first promo, goto last promo in list
			if (sjBookMarkPromoCurrent ==0)
				{
				sjNextBookMark =sjBookMarkPromoTotal;
				}
			else
				{
				sjNextBookMark = sjBookMarkPromoCurrent -1;
				}
			sjBookMarkFade();
		}

	function sjBookMarkNext()
		{
			sjBookmarkAuto=false;
			sjBookmarkNextPromo();
		}

	function sjBookmarkNextPromo()
	{
			// If on last promo, goto first promo in list
			if (sjBookMarkPromoCurrent ==sjBookMarkPromoTotal)
				{
				sjNextBookMark =0;
				}
			else
				{
				sjNextBookMark = sjBookMarkPromoCurrent +1;
				}
			sjBookMarkFade();
	}


	function sjBookMarkFade()
		{
			var curBP = document.getElementById("BookMarkSlideShowContainer_"+sjBookMarkPromoCurrent);
			var nextBP = document.getElementById("BookMarkSlideShowContainer_"+sjNextBookMark);
			if (curBP!=null && nextBP!=null)
			{
				curBP.style.display	="none";
				nextBP.style.display="block";
				sjBookMarkPromoCurrent = sjNextBookMark;
			}
		}

	function sjBookmarkAutoRotate()
	{
		if (sjBookmarkAuto)
		{
			self.setTimeout("sjBookmarkAutoRotate()", 10000);
			sjBookmarkNextPromo();
		}
	}

// end sjBookMarkPromo function
//***************************************************



//***************************************************
// OLD ITEMS - Eliminate After New Launch
//sjMainImagePromo Items
	var sjMainImagePromoTotal	= 0;
	var sjMainImagePromoCurrent  = 0;
	var sjNextMainImage =0;
	var sjMainImageAuto =false;

	function sjMainImagePrevious()
		{
			sjMainImageAuto=false;
			sjMainImagePause();
			// If on first promo, goto last promo in list
			if (sjMainImagePromoCurrent ==0)
				{
				sjNextMainImage =sjMainImagePromoTotal;
				}
			else
				{
				sjNextMainImage = sjMainImagePromoCurrent -1;
				}
			sjMainImageFade();
		}

	function sjMainImageNext()
		{
			sjMainImagePause();
			sjMainImageAuto=false;
			sjMainImageNextPromo();
		}

	function sjMainImageNextPromo()
	{
			// If on last promo, goto first promo in list
			
			if (sjMainImagePromoCurrent ==sjMainImagePromoTotal)
				{
				sjNextMainImage =0;
				}
			else
				{
				sjNextMainImage = sjMainImagePromoCurrent +1;
				}
			sjMainImageFade();
	}


	function sjMainImageFade()
		{
			var curBP = document.getElementById("MainImageSlideShowContainer_"+sjMainImagePromoCurrent);
			var nextBP = document.getElementById("MainImageSlideShowContainer_"+sjNextMainImage);
			if (curBP!=null && nextBP!=null)
			{
				curBP.style.display	="none";
				nextBP.style.display="block";
				sjMainImagePromoCurrent = sjNextMainImage;
			}
		}

	function sjMainImageAutoRotate()
	{
		if (sjMainImageAuto)
		{
			self.setTimeout("sjMainImageAutoRotate()", 10000);
			sjMainImageNextPromo();
		}
	}

function sjMainImagePlay()
	{
		
		var pause = document.getElementById("MainPromoPauseLink");
		var play= document.getElementById("MainPromoPlayLink");

		if (play!=null && pause!=null)
		{
			pause.style.display	="block";
			play.style.display="none";
		}
		sjMainImageAuto=true;
		sjMainImageAutoRotate();
	}
	
function sjMainImagePause()
	{

		
		var pause = document.getElementById("MainPromoPauseLink");
		var play= document.getElementById("MainPromoPlayLink");
		if (play!=null && pause!=null)
		{
			play.style.display	="block";
			pause.style.display="none";
		}
		sjMainImageAuto=false;
	}
	
// end sjMainImagePromo function
//***************************************************



		function MoreInformationToggleCurrent(curLinkType)
		{
		var moreInfoLink_Phys		= document.getElementById("MoreInformationLink_PHYS");
		var moreInfoLink_Press		= document.getElementById("MoreInformationLink_PRESS");
		var moreInfoLink_Classes	= document.getElementById("MoreInformationLink_CLASSES");
		var moreInfoLink_News		= document.getElementById("MoreInformationLink_NEWS");
		var moreInfoLink_Rel		= document.getElementById("MoreInformationLink_REL");

 		var moreInfoDet_Phys		= document.getElementById("MoreInformationDet_PHYS");
		var moreInfoDet_Press		= document.getElementById("MoreInformationDet_PRESS");
		var moreInfoDet_Classes		= document.getElementById("MoreInformationDet_CLASS");
		var moreInfoDet_News		= document.getElementById("MoreInformationDet_NEWS");
		var moreInfoDet_Rel			= document.getElementById("MoreInformationDet_REL");
 

			if (moreInfoLink_Phys!=null)				moreInfoLink_Phys.style.fontWeight="normal";
			if (moreInfoLink_Press!=null)				moreInfoLink_Press.style.fontWeight="normal";		
			if (moreInfoLink_Classes!=null)				moreInfoLink_Classes.style.fontWeight="normal";
			if (moreInfoLink_News!=null)				moreInfoLink_News.style.fontWeight="normal";
			if (moreInfoLink_Rel!=null)					moreInfoLink_Rel.style.fontWeight="normal";

			if (moreInfoDet_Phys!=null)					moreInfoDet_Phys.style.display="none";		
			if (moreInfoDet_Press!=null)				moreInfoDet_Press.style.display="none";
			if (moreInfoDet_Classes!=null)				moreInfoDet_Classes.style.display="none";
			if (moreInfoLink_News!=null)				moreInfoDet_News.style.display="none";
			if (moreInfoLink_Rel!=null)					moreInfoDet_Rel.style.display="none";


			if (curLinkType=="Phys")
			{
				moreInfoLink_Phys.style.fontWeight="bold";
				moreInfoDet_Phys.style.display="block";
			}
			else if (curLinkType=="Press")
			{
				moreInfoLink_Press.style.fontWeight="bold";
				moreInfoDet_Press.style.display="block";
			}
			else if (curLinkType=="Classes")
			{
				moreInfoLink_Classes.style.fontWeight="bold";
				moreInfoDet_Classes.style.display="block";
			}
			else if (curLinkType=="News")
			{
				moreInfoLink_News.style.fontWeight="bold";
				moreInfoDet_News.style.display="block";
			}
			else if (curLinkType=="Rel")
			{
				moreInfoLink_Rel.style.fontWeight="bold";
				moreInfoDet_Rel.style.display="block";
			}
		}


	function ShowFullServiceListing()
	{
		var fullSvcList = document.getElementById("FullServicesListing");	var smallSvcList= document.getElementById("SmallServicesListing");
		if (fullSvcList!=null && smallSvcList!=null)	{
			smallSvcList.style.display	="none";	
			fullSvcList.style.display="inline";	
			}
	}

	function ShowSmallServiceListing()
	{
		var fullSvcList = document.getElementById("FullServicesListing");	var smallSvcList= document.getElementById("SmallServicesListing");
		if (fullSvcList!=null && smallSvcList!=null)	{
			fullSvcList.style.display	="none";	
			smallSvcList.style.display="block";			
			}
	}