
// Nav4 is super fun
function handleResize() {
	if (isNav4) {
		location.reload();	
	} else {
		initPage();	
	}
}

//set window status
function display(str) {  
  window.status = str;
  return true;}

//open a new window
function NewWindow(mypage, myname, w, h, scroll) {
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;  winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
  win = window.open(mypage, myname, winprops)
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// DHTML object positioning API for cross platform positioning
// Set global variables for browser detection and reference building
var isNav, isNav4, isNav6, isIE;
var coll ="";
var styleObj ="";
if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
		isNav = true;
	isNav4 =true;
        if ( document.getElementById && parseInt(navigator.appVersion) >= 5  ) {
		     isNav6 = true;
		     isNav4 = false;
        }
	} else {
		isIE = true;
		coll = "all.";
		styleObj = ".style";
	}
}

// Convert object name string or object reference into a valid object reference
function getObject(obj) {
 var theObj
 if (typeof obj == "string") {
   if ( isNav6 ) { theObj = document.getElementById(obj); }
   else          { theObj = eval("document." + coll + obj + styleObj); }
 } else {
 theObj = obj
 }
 return theObj
}

//show div
function show(obj) {
 var theObj = getObject(obj)
 if ( isNav6 ) {  theObj.style.visibility = "visible"; } else { theObj.visibility = "visible"; }
}
//change div z-index
function setZIndex(obj, zOrder) {
 var theObj = getObject(obj)
 theObj.zIndex =zOrder
}
//hide div
function hide(obj) {
var theObj =getObject(obj)
theObj.visibility = "hidden"
}

// CSS Function

// Copyright (C) 1999 Dan Steinman
// Distributed under the terms of the GNU Library General Public License
// Available at http://www.dansteinman.com/dynapi/

function css(id,left,top,width,height,color,vis,z,other) {
	if (id=="START") return '<STYLE TYPE="text/css">\n'
	else if (id=="END") return '</STYLE>'
	var str = (left!=null && top!=null)? '#'+id+' {position:absolute; left:'+left+'px; top:'+top+'px;' : '#'+id+' {position:relative;'
	if (arguments.length>=4 && width!=null) str += ' width:'+width+'px;'
	if (arguments.length>=5 && height!=null) {
		str += ' height:'+height+'px;'
		if (arguments.length<9 || other.indexOf('clip')==-1) str += ' clip:rect(0px '+width+'px '+height+'px 0px);'
	}
	if (arguments.length>=6 && color!=null) str += (document.layers)? ' layer-background-color:'+color+';' : ' background-color:'+color+';'
	if (arguments.length>=7 && vis!=null) str += ' visibility:'+vis+';'
	if (arguments.length>=8 && z!=null) str += ' z-index:'+z+';'
	if (arguments.length==9 && other!=null) str += ' '+other
	str += '}\n'
	return str
}

function writeCSS(str,showAlert) {
	str = css('START')+str+css('END')
	document.write(str)
	if (showAlert) alert(str)
}

function submitPassword() {
var location
var password
password=this.document.loginForm.loginEntry.value
location=password + ".html"
go(location);
}

function go(location) {
document.location.href = location;

}


//rollover functions
var last_image;
var last_name;
var subnav_stay = subnav_stay;
var nav_stay = new Array();
var counter = 0;
function roll(img_name, roll_to, no_restore) {
	if (document.images) {
		for (var i=0; i<nav_stay.length; i++) {
			if (img_name == nav_stay[i]) {
				return;
			}
		}
		var rollObj = eval('document.' + img_name);
		if ( !no_restore ) {
		 last_image = rollObj.src;
		 last_name = img_name;
		}
		rollObj.src = roll_to;
	}
}
function roll_restore() {
	if (last_image) {
		var flip_back = eval('document.' + last_name);
		flip_back.src = last_image;
	}
}


function showPassword() {
var password = ''
password=prompt('Please enter your password:','');
if (password != null) {
location.href= password + ".html";
}
}
