loaded = 0;

function loadImages() {
	if (document.images) {
// Navigation
	nav_on = new Image();
	nav_on.src = "/res/img/nav.gif";
	nav_off = new Image();
	nav_off.src = "/res/img/nav.gif";
	home_on = new Image();
	home_on.src = "/res/img/navhome.gif";
	twod_on = new Image();
	twod_on.src = "/res/img/nav2d.gif";	
	threed_on = new Image();
	threed_on.src = "/res/img/nav3d.gif";
	seisearch_on = new Image();
	seisearch_on.src = "/res/img/navseisearch.gif";
	reqinfo_on = new Image();
	reqinfo_on.src = "/res/img/navreqinfo.gif";
	contact_on = new Image();
	contact_on.src = "/res/img/navcontact.gif";	
	history_on = new Image();
	history_on.src = "/res/img/navhistory.gif";
	seinet_on = new Image();
	seinet_on.src = "/res/img/navseinet.gif";
	orderstat_on = new Image();
	orderstat_on.src = "/res/img/navorderstat.gif";
	webedit_on = new Image();
	webedit_on.src = "/res/img/webediton.gif";
	webedit_off = new Image();
	webedit_off.src = "/res/img/webeditoff.gif";
	doclib_on = new Image();
	doclib_on.src = "/res/img/doclibon.gif";
	doclib_off = new Image();
	doclib_off.src = "/res/img/docliboff.gif";
	libraryadmin_on = new Image();
	libraryadmin_on.src = "/res/img/libraryadminon.gif";
	libraryadmin_off = new Image();
	libraryadmin_off.src = "/res/img/libraryadminoff.gif";	
						
	loaded = 1;
	}
}

function imageChange(imageName,newsource) {
	if (document.images && loaded==1) {
 		document.images[imageName].src = eval(newsource + ".src");
	}
}

function openAWindow( pageToLoad, winName, width, height, center) 
{
/* Opens a new window on the users desktop.
   Arguments:
    pageToLoad - The URL of a page to load in the browser window.
                 This can be a relative URL or fully qualified.
    winName - 	 Name of the new window.
    width - 	 The horizontal size of the new window.
    height - 	 The vertical size of the new window.
    center -     toggle centering on 4.0 browsers.
                  1=centered window 0=no centering

    Values in the "args" section below can all be toggled in the
    same fashion as the center toggle.  Just modify the appropriate
    value in the args section to be either 0 or 1.

    A call to this function might look like this:
    <a href="javascript:openAWindow('ice.html','ice',375,250,1)">Ice</a>

 
*/
				 
    xposition=0; yposition=0;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=1,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=1,"
    + "toolbar=0,"
    + "hotkeys=1,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    window.open( pageToLoad,winName,args );
}

function getEmployee(file)  
{
	theemployeeid = window.document.aform.employeeid[window.document.aform.employeeid.selectedIndex].value
	theurl = "http://" + window.location.host
	thebase = "/seinet/" + file
	theparam1 = "?employeeid=" + theemployeeid
	theparam2 = "chooseform=employeeform"
	window.location.href= theurl + thebase + "?refresh=1&theurl=" + theurl + "&thebase=" + thebase + "&theparam1=" + theparam1 + "&theparam2=" + theparam2;
}
function getLocation()  
{
	thelocationid = window.document.aform.locationid[window.document.aform.locationid.selectedIndex].value
	theurl = "http://" + window.location.host
	thebase = "/seinet/webedit.asp"
	theparam1 = "?locationid=" + thelocationid
	theparam2 = "chooseform=locationform"
	window.location.href= theurl + thebase + "?refresh=1&theurl=" + theurl + "&thebase=" + thebase + "&theparam1=" + theparam1 + "&theparam2=" + theparam2;
}
function getPage()  
{
	thepageid = window.document.aform.pageid[window.document.aform.pageid.selectedIndex].value
	theurl = "http://" + window.location.host
	thebase = "/seinet/webedit.asp"
	theparam1 = "?pageid=" + thepageid
	theparam2 = "chooseform=pageform"
	window.location.href= theurl + thebase + "?refresh=1&theurl=" + theurl + "&thebase=" + thebase + "&theparam1=" + theparam1 + "&theparam2=" + theparam2;
}
function getData3D(theState)  
{
	thedata3did = window.document.aform.data3did[window.document.aform.data3did.selectedIndex].value
	theurl = "http://" + window.location.host
	thebase = "/seinet/webedit.asp"
	theparam1 = "?data3did=" + thedata3did
	theparam2 = "chooseform=data3dform2"
	theparam3 = "state=" + theState
	window.location.href= theurl + thebase + "?refresh=1&theurl=" + theurl + "&thebase=" + thebase + "&theparam1=" + theparam1 + "&theparam2=" + theparam2 + "&theparam3=" + theparam3;
}
function getData3DState()  
{
	thestate = window.document.aform.state[window.document.aform.state.selectedIndex].value
	theurl = "http://" + window.location.host
	thebase = "/seinet/webedit.asp"
	theparam1 = "?state=" + thestate
	theparam2 = "chooseform=data3dform2"
	window.location.href= theurl + thebase + "?refresh=1&theurl=" + theurl + "&thebase=" + thebase + "&theparam1=" + theparam1 + "&theparam2=" + theparam2;
}
function doSelectChange(el,dest) {
	dest.value = el.options[el.selectedIndex].text
}

function lookupItem(el,dest) {
	var curValue = el.value.toLowerCase()
	var found = false
	var index = dest.selectedIndex
	var numOptions = dest.options.length
	var pos = 0
	// Repeat until found or end of list is reached
	while ((!found) && (pos < numOptions)) {
		// Do comparisons in lowercase
		found = (dest.options[pos].text.toLowerCase().indexOf(curValue)==0) 
		if (found) 
			index = pos
		pos++
	}
	if (found)  // Updated listbox
		dest.selectedIndex = index
}
function goValue(el) {
	var where
	if (el.selectedIndex>-1) { 
      		// Make sure there is a selection
      		where = el.options[el.selectedIndex].value
      		window.navigate(where)
      		return(false)
	}
	else {
		window.navigate("errorpage.asp")
	}
}