function showTab(showtab) {
	var hidetab = (showtab == "physicians") ? "patients" : "physicians";
	document.getElementById("masthead_home_text_"+showtab).style.display = "block";
	document.getElementById("masthead_home_text_"+hidetab).style.display = "none";
	document.getElementById("tab_img_"+showtab).src = "/img/tab_"+showtab+"_on.gif";
	document.getElementById("tab_img_"+hidetab).src = "/img/tab_"+hidetab+".gif";
}

function printPage()
{
   if (window.print)
   {
      window.print()
   }
   else
   {
      alert("Sorry, your browser doesn't support this feature.\n" +
            "Please use your browser's print button");
   }
}

function popImg(theImg, w, h, pgTitle)
{
   var window_top = 80;
   var window_left = 80;
   var params = 'title='+pgTitle+',resizable=yes,location=no,status=no,scrollbars=no,menubar=yes,WIDTH='+w+',HEIGHT='+h+',top='+window_top+',left='+window_left;

   theOpenWin = window.open('/wi/imagePopper.php?title='+pgTitle+'&img='+theImg,'openedwin',params);
   theOpenWin.focus();
}

function close_div (divid) {
		document.getElementById(divid).innerHTML = "";
		document.getElementById(divid).style.display = "none";
}

// ----------------------------------------------------------------------

var browser=navigator.appName;

function toggleVideo(show, hide, videoinfo) {	
		var x;
		var y;
		var viddata = videoinfo.split("|");

		if (hide != "") {
			hide = hide.split(",");
			for (x in hide) {
				if (hide[x] != show) {
					document.getElementById(hide[x]).style.display = "none";
				}
			}
		}

		if (show != "") {
		  _center = window.center();
		
			show = show.split(",");
			for (y in show) {
				if (show[y] != hide) {				  
					document.getElementById(show[y]).style.display = "block";
					document.getElementById(show[y]).style.top = (_center.y - 250) + "px";
					document.getElementById(show[y]).style.left = (_center.x - 250) + "px";

					document.getElementById(show[y]).innerHTML = "";
					html = "<embed width=\"473\" height=\"400\" flashvars=\"div_container=" + show[y] + "\" allowscriptaccess=\"always\" wmode=\"transparent\" quality=\"high\" bgcolor=\"#000000\" src=\"/swf/flv_player.swf?div_container=" + show[y] + "&videoName=" + viddata[0] + "&videoTitle=" + viddata[1] + "&divName=" + show[y] + "\" type=\"application/x-shockwave-flash\"/>";
					document.getElementById(show[y]).innerHTML = html;
				}
			}
		}
		
}

/* 
   borrowed wholesale from http://www.geekdaily.net/2007/07/04/javascript-cross-browser-window-size-and-centering/
 */
function toggleIntVideo(show, hide, videoinfo) {
		var x;
		var y;
		var viddata = videoinfo.split("|");
				
		if (hide != "") {
			hide = hide.split(",");
			for (x in hide) {
				if (hide[x] != show) {
					document.getElementById(hide[x]).style.display = "none";
				}
			}
		}
		
		if (show != "") {
		  _center = window.center();
		
			show = show.split(",");
			for (y in show) {
				if (show[y] != hide) {
					document.getElementById(show[y]).style.display = "block";
					document.getElementById(show[y]).style.top = (_center.y - 250) + "px";
					document.getElementById(show[y]).style.left = (_center.x - 250) + "px";

					document.getElementById(show[y]).innerHTML = "";
					html = "<embed width=\"473\" height=\"400\" flashvars=\"div_container=" + show[y] + "\" allowscriptaccess=\"always\" wmode=\"transparent\" quality=\"high\" bgcolor=\"#000000\" src=\"/swf/flv_player_international.swf?div_container=" + show[y] + "&videoName=" + viddata[0] + "&videoTitle=" + viddata[1] + "&divName=" + show[y] + "\" type=\"application/x-shockwave-flash\"/>";
					document.getElementById(show[y]).innerHTML = html;
				}
			}
		}
		
}

/* borrowed wholesale from http://www.geekdaily.net/2007/07/04/javascript-cross-browser-window-size-and-centering/ */

window.size = function()
{
	var w = 0;
	var h = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
	return {width:w,height:h};
}

window.center = function()
{
	var hWnd = (arguments[0] != null) ? arguments[0] : {width:0,height:0};

	var _x = 0;
	var _y = 0;
	var offsetX = 0;
	var offsetY = 0;

	//IE
	if(!window.pageYOffset)
	{
		//strict mode
		if(!(document.documentElement.scrollTop == 0))
		{
			offsetY = document.documentElement.scrollTop;
			offsetX = document.documentElement.scrollLeft;
		}
		//quirks mode
		else
		{
			offsetY = document.body.scrollTop;
			offsetX = document.body.scrollLeft;
		}
	}
	//w3c
	else
	{
		offsetX = window.pageXOffset;
		offsetY = window.pageYOffset;
	}

	_x = ((this.size().width-hWnd.width)/2)+offsetX;
	_y = ((this.size().height-hWnd.height)/2)+offsetY;

	return{x:_x,y:_y};
}
/* // */

