function eicon(str) {
	thestr = '<a href="mailto:'+str+'@orthohospital.org"><img src="images/i_mail.gif" alt="email" width="15" height="8" border="0" hspace="5"></a>';
	return thestr;
}

function eaddr(str) {
	thestr = '<a href="mailto:'+str+'@orthohospital.org">'+str+'@orthohospital.org</a>';
	return thestr;
}
function eaddr2(str) {
	thestr = '<a href="mailto:'+str+'@laoh.ucla.edu">'+str+'@laoh.ucla.edu</a>';
	return thestr;
}

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (checkIt('firefox'))
{
	browser = "Firefox";
	version = detect.charAt(8);
}
else if (checkIt('safari')) 
{
	browser = "Safari";
	version = detect.charAt(8);
}
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function init() {
  setTimeout("window.onresize = redo", 1000);
}

function redo() {
  window.location.reload();
}

if (version < 5) { 
	location='upgrade.html';
}
if (browser=="Safari") {
	//location='upgrade.html';
}
if (version==5 && browser=="Internet Explorer" && OS=="Mac") {
	//location='upgrade.html';
}
if (version < 7 && browser=="Opera") {
	location='upgrade.html';
}

function pop(width,height) {
	var args = 'width='+width+',height='+height+',resizable=yes,scrollbars=auto';
	popWindow = window.open('','popup',args);
	window.name = 'main';
	popWindow.focus();
}

function displayDiv(divToOpen) {
	var thechkbox= document.getElementById("chkListRequestType:0")
	var thediv = document.getElementById(divToOpen);
	if (thechkbox.checked){
		thediv.style.display = 'block';
	} else {
		thediv.style.display = 'none';
	}
}
function showtheDiv(divToOpen) {
	var thediv = document.getElementById(divToOpen);
	if (thediv.style.display == 'none'){
		thediv.style.display = 'block';
	} else {
		thediv.style.display = 'none';
	}
}
function divctrl(divToOpen,tgl) {
	var thediv = document.getElementById(divToOpen);
	if (tgl == 1){
		thediv.style.display = 'block';
	} else {
		thediv.style.display = 'none';
	}
}
function navon(div) {
	var thediv = document.getElementById(div);
	thediv.className = 'navon';
}
function patienttabs(tab) {
	var thepat = document.getElementById('patients');
	var thepac = document.getElementById('pacientes');
	if(tab == 1) {
		document.patienttabs.src = 'images/ptab_1.gif';
		thepac.style.display = 'none';
		if(thepat.style.display == 'block') {
			thepat.style.display = 'none';
		} else {
			thepat.style.display = 'block';
		}
	} else {
		document.patienttabs.src = 'images/ptab_2.gif';
		thepat.style.display = 'none';
		if(thepac.style.display == 'block') {
			thepac.style.display = 'none';
		} else {
			thepac.style.display = 'block';
		}
	}
}
function patienttabs2(tab) {
	var thepat = document.getElementById('patients');
	var thepac = document.getElementById('pacientes');
	if(tab == 1) {
		document.patienttabs.src = 'images/ptab_1.gif';
		thepac.style.display = 'none';
		thepat.style.display = 'block';
	} else {
		document.patienttabs.src = 'images/ptab_2.gif';
		thepat.style.display = 'none';
		thepac.style.display = 'block';
	}
}