
/*
	The INT3R.workingz

	Written by Senior Designer
		- Seth Van Booven [svanbooven@sacbee.com]
		
	Copyright © The Sacramento Bee
	Created: March 17, 2003 (sv)  /  Last update: 03/17/03 (sv)
	
	****************************************************
		IF YOU DON'T KNOW WHAT YOU ARE DOING
		THEN YOU DON'T BELONG HERE.
		.........................CLOSE IMMEDIATELY!
	****************************************************
------------------------------------------------------------*/

/*
	Init layers for 4+ Browsers
----------------------------------------*/

var d = document;
var agt = navigator.userAgent.toLowerCase();
var w3c = (d.getElementById) ? true : false;
var xxx = ((agt.indexOf('opera') != -1) || (agt.indexOf('webtv') != -1) || (agt.indexOf('omniweb') != -1)) ? true : false;

var ieX = ((agt.indexOf('msie')  != -1) && w3c && !xxx) ? true : false;
var ie4 = ((agt.indexOf('msie')  != -1) && (d.all) && !w3c && !xxx) ? true : false;
var ns6 = ((agt.indexOf('gecko') != -1) && w3c && !xxx) ? true : false;
var ns4 = (d.layers && !w3c && !xxx) ? true : false;

var isWin = (navigator.appVersion.indexOf('Windows') != -1) ? true : false;

/*
	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);
}

function popGallery(n, s, ss, p) {
	var qs = '';
	if (n != null) qs += "&n=" + n;
	if (s != null) qs += "&s=" + s;
	if (ss != null) qs += "&ss=" + ss;
	if (p != null) qs += "&p=" + p;
	popWin('interactive.html?' + qs, '', 720, 450, 1);
}

/*
	Misc Functions
----------------------------------------*/

function togAudio() {
		var elm = document.getElementById ? document.getElementById('a2') : document.all ? document.all('a2') : null;
		if (elm != null) {
			elm.style.display = (elm.style.display == 'block') ? 'none' : 'block';
		}
		var elm2 = document.getElementById ? document.getElementById('al1') : document.all ? document.all('al1') : null;
		if (elm2 != null) {
			elm2.innerHTML = (elm2.innerHTML == 'View transcript') ? 'x - Close transcript' : 'View transcript';
		}
}

function bookmark(url, title) {
	if (ieX && isWin) {
		window.external.AddFavorite(url, title);
	}
	else {
		alert('To bookmark the ' + title + ' site, press the CTRL (or Command) and D keys.');
	} 
}

function getTextVer() {
	var u = location.href;
	var f = u.substring(u.lastIndexOf('/') + 1, u.lastIndexOf('.'));
	location.href = 'text.html#' + f;
}

function backToTop() {
	window.scrollTo(0, 0);
}

function toggleInput(o, elm) {
	o.className = (o.className == elm) ? elm + 'On' : elm;
}

function togClass(o, elm) { 
	o.className = elm; 
}

function nixErr() { 
	return true; 
}

//window.onerror = nixErr;

/*
	Netscape Resize CSS Fix 
----------------------------------------*/

if (d.layers) {
	origSelfWidth  = innerWidth;
	origSelfHeight = innerHeight;
	onresize = function() { if (innerWidth != origSelfWidth || innerHeight != origSelfHeight) location.reload() };
}


/*
	Global Initialize
		- Anything that uses an 
			onload event needs to be 
			defined here.
----------------------------------------*/

function initialize() {
	
}

//window.onload = initialize; // global onload
