<!--
function pageChanger(url)
{
	if (url != ' ')
	{
		document.location = url;
	}
}
function popupwindow(url,width,height)
{
		mywindow = window.open(url, 'JohnMuir', 'status=yes,toolbar=yes,location=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+width+',height='+height);
		mywindow.location = url;
}
function pop1(url)
{
		mywindow = window.open(url, 'JohnMuirCareers', 'status=yes,toolbar=yes,location=yes,menubar=yes,scrollbars=yes,resizable=yes,width=640,height=480');
		mywindow.location = url;
}

function popupaboutus(url)
{
		mywindow = window.open(url, 'JohnMuir', 'status=no,toolbar=no,location=no,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=500');
		mywindow.location = url;
}

function newspop(url)
{
		mywindow = window.open(url, 'JohnMuir', 'status=yes,toolbar=yes,location=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=400');
		mywindow.location = url;
}

function weightpop(url)
{
		mywindow = window.open(url, 'JohnMuir', 'status=no,toolbar=no,location=no,menubar=no,scrollbars=no,resizable=yes,width=800,height=600');
		mywindow.location = url;
}

function locationspop(url)
{
		mywindow = window.open(url, 'JohnMuir', 'status=yes,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600');
		mywindow.location = url;
}
function popbarewindow(url,width,height)
{
		mywindow = window.open(url, 'JohnMuir', 'status=no,toolbar=no,location=no,menubar=no,scrollbars=no,resizable=yes,width='+width+',height='+height);
		mywindow.location = url;
}
function popscrollwindow(url,width,height)
{
		mywindow = window.open(url, 'JohnMuir', 'status=no,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height);
		mywindow.location = url;
}

/*
WM_setCookie(), WM_readCookie(), WM_killCookie()
A set of functions that eases the pain of using cookies.

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Author Email: nadav@wired.com
*/


// This next little bit of code tests whether the user accepts cookies.
var WM_acceptsCookies = false;
if(document.cookie == '') {
    document.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie.
    if(document.cookie.indexOf('WM_acceptsCookies=yes') != -1) {
	WM_acceptsCookies = true;
    }// If it succeeds, set variable
} else { // there was already a cookie
  WM_acceptsCookies = true;
}


function WM_setCookie (name, value, hours, path, domain, secure) {
    if (WM_acceptsCookies) { // Don't waste your time if the browser doesn't accept cookies.
	var not_NN2 = (navigator && navigator.appName
		       && (navigator.appName == 'Netscape')
		       && navigator.appVersion
		       && (parseInt(navigator.appVersion) == 2))?false:true;

	if(hours && not_NN2) { // NN2 cannot handle Dates, so skip this part
	    if ( (typeof(hours) == 'string') && Date.parse(hours) ) { // already a Date string
		var numHours = hours;
	    } else if (typeof(hours) == 'number') { // calculate Date from number of hours
		var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
	    }
	}
	document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'') + ((secure && (secure == true))?'; secure':''); // Set the cookie, adding any parameters that were specified.
    }
} // WM_setCookie


function WM_readCookie(name) {
    if(document.cookie == '') { // there's no cookie, so go no further
	return false;
    } else { // there is a cookie
	var firstChar, lastChar;
	var theBigCookie = document.cookie;
	firstChar = theBigCookie.indexOf(name);	// find the start of 'name'
	var NN2Hack = firstChar + name.length;
	if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie
	    firstChar += name.length + 1; // skip 'name' and '='
	    lastChar = theBigCookie.indexOf(';', firstChar); // Find the end of the value string (i.e. the next ';').
	    if(lastChar == -1) lastChar = theBigCookie.length;
	    return unescape(theBigCookie.substring(firstChar, lastChar));
	} else { // If there was no cookie of that name, return false.
	    return false;
	}
    }
} // WM_readCookie

function WM_killCookie(name, path, domain) {
  var theValue = WM_readCookie(name); // We need the value to kill the cookie
  if(theValue) {
      document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:''); // set an already-expired cookie
  }
} // WM_killCookie


//set a font scaling and then update the stylesheet
function increaseTextSize(factor)
{
	fontScaling = WM_readCookie('fontScaling');

	//if we've never chosen a font scaling factor, start at 1
	if(!fontScaling)
	{
		fontScaling = 1;
	}

	//scale by given factor
	fontScaling = fontScaling * factor;

	//save new factor in the cookie
	WM_setCookie('fontScaling', fontScaling, (60 * 60 * 24 * 365));

	//update sizes of all fonts
	updateStyleSheet(factor);
}

function updateStyleSheet(factor)
{
	//Interactively, we go bigger or smaller by 10%,
	//but when the page is first loaded, we use the
	//stored factor.
	if(factor == 0)
	{
		factor = WM_readCookie('fontScaling');

		//if we don't have the cookie, then
		//don't bother
		if(!factor)
		{
			return true;
		}
	}

	if(document.styleSheets[0].rules)
	{
		var styleRules = document.styleSheets[0].rules;
	}
	else
	{
		var styleRules = document.styleSheets[0].cssRules;
	}

	for(i=0; i<styleRules.length; i++)
	{
		var rule = styleRules[i];
		if(rule.style.fontSize)
		{
			var newSize = Math.round(parseInt(rule.style.fontSize) * factor);
			if(newSize < 8)
			{
				newSize = 8;
			}
			if(newSize > 32)
			{
				newSize = 32;
			}
			rule.style.fontSize = newSize + 'px';
		}
	}
}

function resetTextSize()
{
	WM_killCookie('fontScaling');
	window.location.reload();
}

function enableField(fieldName, fieldKey)
{
	var myForm=document.forms[document.forms.length - 1];
	var myField=myForm.elements[fieldName];
	if(fieldKey)
	{
		myField = myField[fieldKey];
	}
	myField.disabled = false;
}

function disableAndSetRadio(fieldName, setValue)
{
	var myForm=document.forms[document.forms.length - 1];
	var myField=myForm.elements[fieldName];
	myField[setValue].checked = true;
	for(i=0; i<myField.length; i++)
	{
		if(i != setValue)
		{
			myField[i].disabled = true;
		}
	}
}

//This global variable keeps track of the current field
var downStrokeField;

//Call this function for each field that need auto-jumping.
function autojump(fieldName, nextFieldName, maxLength)
{
	var myForm=document.forms[document.forms.length - 1];
	var myField=myForm.elements[fieldName];
	myField.nextField=myForm.elements[nextFieldName];
	if(myField.maxLength == null)
	{
		myField.maxLength=maxLength;
	}
	myField.onkeydown=autojump_keyDown;
	myField.onkeyup=autojump_keyUp;
}

function autojump_keyDown()
{
	this.beforeLength=this.value.length;
	downStrokeField=this;
}

function autojump_keyUp()
{
	if(
	 (this == downStrokeField) &&
	 (this.value.length > this.beforeLength) &&
	 (this.value.length >= this.maxLength)
	 )
	{
		this.nextField.focus();
		downStrokeField=null;
	}
}

function focusOnField(fieldName)
{
	var myForm=document.forms[document.forms.length - 1];
	var myField=myForm.elements[fieldName];
	myField.focus();
	myField.select();
}


function pauseExecution(milliseconds)
{
	d1 = new Date();
	while(true)
	{
		d2=new Date();
		if((d2-d1) > milliseconds)
		{
			break;
		}
	}
}

function confirmDialog(text)
{
	var reply = confirm(text);
	return(reply);
}

function changeLocation(url)
{
		window.location = url;
}


function increaseFontSize()
{
	var min=12;
	var max=16;
	var p = document.getElementsByTagName('p');
	var td = document.getElementsByTagName('td');
	var div = document.getElementsByTagName('div');
	for(i=0;i<p.length;i++)
	{
		if(p[i].style.fontSize)
		{
			var s = parseInt(p[i].style.fontSize.replace("px",""));
		}
		else
		{
			var s = 12;
		}
		if(s != max)
		{
			s = max;
		}
		else
		{
			s = min;
		}
		p[i].style.fontSize = s+"px"
	}

	for(i=0;i<td.length;i++)
	{
		if(td[i].style.fontSize)
		{
			var s = parseInt(td[i].style.fontSize.replace("px",""));
		}
		else
		{
			var s = 12;
		}
		if(s != max)
		{
			s = max;
		}
		else
		{
			s = min;
		}
		td[i].style.fontSize = s+"px"
	}
	for(i=0;i<div.length;i++)
	{
		if(div[i].style.fontSize)
		{
			var s = parseInt(div[i].style.fontSize.replace("px",""));
		}
		else
		{
			var s = 12;
		}
		if(s != max)
		{
			s = max;
		}
		else
		{
			s = min;
		}
		div[i].style.fontSize = s+"px"
	}
//	var e = document.getElementById('textSize');
//		alert (e.style.background);
//		if(e.style.background == 'url(../images/typesize.gif) no-repeat 0pt 0pt')
//		e.style.background = 'url(../images/typesize.gif) no-repeat 0pt -13px';
//		else
//		e.style.background = 'url(../images/typesize.gif) no-repeat 0pt 0pt';
}


//Email the page to a friend
function emailthisPage()
{
    if (document.getElementById)
	{
		item1 = document.getElementById("sendbyemailForm");

		// Visible
		if (item1.style.display == "none")
		{
			item1.style.display = "";
			//item2.style.display ="none";
		}
		else
		{
			// Hide
			item1.style.display = "none";
			//item2.style.display ="";
		}
	}
}


// toggle visibility
function show(id1)
{
	if (document.getElementById)
	{
		item1 = document.getElementById(id1);
		item1.style.display = "block";
		if(id1 != 'ddinfo' && id1 != 'ddphysician' && id1 != 'ddcareers')
		{
			if(document.getElementById('hier-nav-selected-item'))
			{
				item2 = document.getElementById('hier-nav-selected-item');
				item2.style.opacity = "0";
			}


			if(document.getElementById('right_block'))
			{
				item2 = document.getElementById('right_block');
				item2.style.overflow = "visible";
			}
		}
	}
}

// toggle visibility
function hide(id1)
{
	if (document.getElementById)
	{
		item1 = document.getElementById(id1);
		item1.style.display = "none";
		if(id1 != 'ddinfo' && id1 != 'ddphysician' && id1 != 'ddcareers')
		{
			if(document.getElementById('hier-nav-selected-item'))
			{
				item2 = document.getElementById('hier-nav-selected-item');
				item2.style.opacity = "1";
			}

			if(document.getElementById('right_block'))
			{
				item2 = document.getElementById('right_block');
				item2.style.overflow = "hidden";
			}
		}
	}
}

/*
toggleCollapsable:
This is simular to "toggle" but this function uses CSS classes from site.css and
controls two divs (collapsable and collapser). This is used in send-page
functionality and other collapsable content.
*/
function toggleCollapsable(collapsable,collapser)
{
	collapsableElement = document.getElementById(collapsable);
	collapserElement = document.getElementById(collapser);

	if(collapsableElement.className == 'collapsable-open')
	{
		collapsableElement.className = "collapsable-closed";
		collapserElement.className = "collapser-closed";
	}
	else
	{
		collapsableElement.className = "collapsable-open";
		collapserElement.className = "collapser-open";
	}
}

<!-- Hide div -->

function hide_visibility(id) {
	for (var i = 0; i < id.length; i++) {
		var e = document.getElementById(id[i]);
	e.style.display = 'none';
	} 
	}

<!-- Show div -->

function show_visibility(id) {
	for (var i = 0; i < id.length; i++) {
		var e = document.getElementById(id[i]);
	e.style.display = 'block';
	} 
	}
	
function textCounter(field,cntfield,maxlimit) {
	if (field.value.length > maxlimit) // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
	// otherwise, update 'characters left' counter
	else
		cntfield.value = maxlimit - field.value.length;
}

// -->