/*findDOM*/
var myURL="";
var domStyle="";
var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;
var browserVersion = "";

if (document.getElementById) {
		isID = 1; isDHTML = 1;//Mozilla
	}else{
	if (document.all) {
			isAll = 1; isDHTML = 1;//Every other DHTML compliant browser
		}else{
			browserVersion = parseInt(navigator.appVersion);
			if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}//OLD browsers
	}
}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }//Mozilla
		else { 
			if (isAll) { return (document.all[objectID].style); } // IE
		else {
			if (isLayers) { return (document.layers[objectID]); }//Netscape pre 6
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else { 
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
	return "";
}


//extra global functions

function displayWindow(url, width, height) {
        var Win = window.open(url,"_blank",'width=' + width +
',height=' + height + ',resizable=0,scrollbars=1');
}

function displayWindow2(url, width, height) {
        var Win = window.open(url,"_blank",'width=' + width +
',height=' + height + ',resizable=0,scrollbars=1');
}

 
function displayWindowResizable(url, width, height) {
        var Win = window.open(url,"openWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=1');
}



function setClass(objectID,newClass) {
	var dom = findDOM(objectID,0);
	dom.className = newClass;
}

function getMyClass(objectID) {
	var dom = findDOM(objectID,0);
	return	dom.className ;
}

function getDisplay(objectID) {
if (isAll || isID) {
	var domStyle = findDOM(objectID,1);
	return	domStyle.display;
	}
}

function revealDiv(objectID) {
	if (isAll || isID) {
		domStyle = findDOM(objectID,1);
		domStyle.display='block';
	}
	return;
}

function concealDiv(objectID) {
	if (isAll || isID) {
		domStyle = findDOM(objectID,1);
		domStyle.display='none';
	}
	return;
}

function checkTAComments(thisObject,initialText){
		if (thisObject.value==initialText){
		thisObject.value="";
		setClass(thisObject.id,'normalTA');
	}
}

/*Son of Suckerfish. Used for funky dropdown menus*/
sfHover = function() {
	var sfEls = document.getElementById("nav123").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



/*URL Mining*/
var sURL = (location.pathname.indexOf('?') != -1) ? location.pathname.substring(0, location.pathname.indexOf('?')) : location.pathname;
sURL = (location.pathname.charAt(0) == '/') ? location.pathname.substring(1) : location.pathname;
var aURL = sURL.split('/');




function visi(nr)//toggles visibility of an id: http://www.quirksmode.org/js/blockinvi.html
{
	if (document.layers)
	{
		vista = (document.layers[nr].visibility == 'hide') ? 'show' : 'hide'
		document.layers[nr].visibility = vista;
	}
	else if (document.all)
	{
		vista = (document.all[nr].style.visibility == 'hidden') ? 'visible'	: 'hidden';
		document.all[nr].style.visibility = vista;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.visibility == 'hidden') ? 'visible' : 'hidden';
		document.getElementById(nr).style.visibility = vista;

	}
}


function blocking(nr)//toggles display of an id: http://www.quirksmode.org/js/blockinvi.html
{
	if (document.layers)
	{
		current = (document.layers[nr].display == 'none') ? 'block' : 'none';
		document.layers[nr].display = current;
	}
	else if (document.all)
	{
		current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
		document.all[nr].style.display = current;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
		document.getElementById(nr).style.display = vista;
	}
}
