<!--
/* ***************************************************
ui.js - Contains User Interface behavior methods.  

public rollOver(imgName,trueFalse)
Public goTo(sLocArg)
Public popUp(sLocArg,iHeight,iWidth, bScroll)
public getQueryStrValue(sVarArg)

**************************************************** */

//Rollover buttons. Pass name of image and a boolean indicating
//if the rollOver state of the button should be shown or not.
function rollOver(imgName,trueFalse) {

	if (document.images && trueFalse==true) {
    	document[imgName].src = eval(imgName + "on.src");
    }else if (document.images && trueFalse==false) {
    	document[imgName].src = eval(imgName + "off.src");
	}
}

function getBrowser() {
//returns browser name (eg Netscape, Explorer, Opera)

	sRaw 	= navigator.userAgent.toLowerCase();
	sType 	= "unknown";

	if (sRaw.indexOf("mozilla") !=-1) {sType="Netscape"}
	if (sRaw.indexOf("msie") !=-1) {sType="Explorer"}
	if (sRaw.indexOf("opera") !=-1) {sType="Opera"}
	if (sRaw.indexOf("safari") !=-1) {sType="Safari"}

	return(sType);
}

//Redirects to a different location	
function goTo(sLocArg){
    window.href.location=sLocArg;	
}	

//Open a child window. Defualt size is 550x550.	
function popUp(sLocArg,iHeight,iWidth,bScrolling,windowName) {
    if (iHeight==null) {iHeight=550}
    if (iWidth==null) {iWidth=550}	
    if (bScrolling=='false' || bScrolling==false) {sScroll="no"}	
    else{sScroll="yes"}
	if (windowName==null){windowName='info'}
    sProps = "height="+iHeight+",width="+iWidth+",scrollbars="+sScroll;
    window.open(sLocArg,windowName,sProps);
}

function getQueryStrValue(sVarArg) {
//Pass in a queryString keyName and recieve back it's value.

	qs = new String(location.search);
	qs=qs.substr(1,qs.length).split("&");
	qsKeys = new Array();
	qsVals = new Array();
	myValue = "";
	
	//Parse values into 2 arrays for search
	for (i=0;i<qs.length;i++){
	   qsElem=qs[i].split("=");
	   key=qsElem[0]; value=qsElem[1];
	   qsKeys=qsKeys.concat(key);
	   qsVals=qsVals.concat(value);
 	}
	
	//Search for key that matches request
	for (i=0;i<qsKeys.length;i++){
	   if (qsKeys[i].valueOf() == sVarArg) {
		myValue=qsVals[i].valueOf(); break;	   		
	   } 
	} 
	return(myValue);
}	

//Change the content of the frame.
function content(sPage){
	document.getElementById("content").src="content/"+sPage;	
}

//-->		