
/*
	Don't Call it a Comeback.

	Written by Design Technologist
		- Seth Van Booven [svanbooven@sacbee.com]
		
	Copyright © The Sacramento Bee
	Created by the New Media Department
	Created: March 01, 2001 (sv)  /  Last update: 11/29/01 (sv)
	
	****************************************************
		IF YOU DON'T KNOW WHAT YOU ARE DOING
		THEN YOU DON'T BELONG HERE.
		.........................CLOSE IMMEDIATELY!
	****************************************************
------------------------------------------------------------*/

/*
	Init layers for 4+ Browsers
----------------------------------------*/

agt = navigator.userAgent.toLowerCase();
w3c = (document.getElementById) ? true : false;
xxx = ((agt.indexOf('opera') != -1) || (agt.indexOf('webtv') != -1) || (agt.indexOf('omniweb') != -1)) ? true : false;

ieX = ((agt.indexOf('msie')  != -1) && w3c && !xxx) ? true : false;
ie4 = ((agt.indexOf('msie')  != -1) && (document.all) && !w3c && !xxx) ? true : false;
ns6 = ((agt.indexOf('gecko') != -1) && w3c && !xxx) ? true : false;
ns4 = (document.layers && !w3c && !xxx) ? true : false;


/*
	Dynamic Browser Specific CSS
----------------------------------------*/

if      (ieX) document.write('<link rel="stylesheet" type="text/css" href="css/ieX.css" />');
else if (ie4) document.write('<link rel="stylesheet" type="text/css" href="css/ie4.css" />');
else if (ns6) document.write('<link rel="stylesheet" type="text/css" href="css/ns6.css" />');
else if (ns4) document.write('<link rel="stylesheet" type="text/css" href="css/ns4.css" />');
else 		  document.write('<link rel="stylesheet" type="text/css" href="css/ie4.css" />');


/*
	Function to Show Layers
----------------------------------------*/

function show(id) 
{
	if (document.getElementById) document.getElementById(id).style.visibility = 'visible';
	else if (document.all) document.all[id].style.visibility = 'visible';
	else if (document.layers) document.layers[id].visibility = 'show';
	else return;
}


/*
	Function to Hide Layers
----------------------------------------*/

function hide(id) 
{
	if (document.getElementById) document.getElementById(id).style.visibility = 'hidden';
	else if (document.all) document.all[id].style.visibility = 'hidden';
	else if (document.layers) document.layers[id].visibility = 'hide';
	else return;
}


/*
	Function to Highlight Images
----------------------------------------*/

function rollOn(img)
{
	if (document.images) document[img].src = eval(img + 'On.src');
	else return;
}


/*
	Function to UnHighlight Images
----------------------------------------*/

function rollOff(img)
{
	if (document.images) document[img].src = eval(img + 'Off.src');
	else return;
}


/*
	Function to Display Tabs 
----------------------------------------*/

tabs  = new Array ('tab01H', 'tab02H', 'tab03H');
datas = new Array ('data01', 'data02', 'data03');

function display(id) 
{
	for (var i = 0; i < tabs.length; i++) 
	{
		if (tabs[i] == id) 
		{
			show(tabs[i]);
			show(datas[i]);
		}
		else 
		{
			hide(tabs[i]);
			hide(datas[i]);
		}
	}
}


/*
	Pop Up Window
----------------------------------------*/

function popWin(url, winName, w, h, scroll) 
{
	if (agt.indexOf('mac') != -1) h += 17;
	var sw = screen.width;
	var sh = screen.height;
	var cx = ( .5 * sw ) - ( w * .5 );
	var cy = ( .5 * sh ) - ( h * .5 );
	var values = 'toolbar=no,status=yes,menubar=no,scrollbars=' + scroll + ',resizable=yes,screenX=' + cx + ',screenY=' + cy + ',left=' + cx + ',top=' + cy + ',width=' + w + ',height=' + h + '';
	child = window.open(url, winName, values);
}


/*----------------------------------------
	Netscape Resize Css Fix 
	- thanx to the 
	  supa fresh Dan Steinman
----------------------------------------*/

function CSSfix() 
{
	if (document.self.CSSfix.initWindowWidth != window.innerWidth || document.self.CSSfix.initWindowHeight != window.innerHeight) 
	{
		document.location = document.location;
	}
}

function CSSfixCheckIn() 
{
	if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) 
	{
		if (typeof document.self == 'undefined') 
		{
			document.self = new Object;
		}
		if (typeof document.self.self_scaleFont == 'undefined') 
		{
			document.self.CSSfix = new Object;
			document.self.CSSfix.initWindowWidth = window.innerWidth;
			document.self.CSSfix.initWindowHeight = window.innerHeight;
		}
		window.onresize = CSSfix;
	}
}

CSSfixCheckIn()


/*
	Global Initialize
		- Anything that uses an 
			onload event needs to be 
			defined here.
----------------------------------------*/

ABPopUnder = null;	// Sets a null value if Ticker is not present

function initialize() 
{
	if (ABPopUnder != null) loadPopUnder();
}

window.onload = initialize;
