function load( session ) {
	loader()
	
	var link_nodes = document . getElementsByTagName("a") 
	var href
	for( var i = 0 ; i < link_nodes.length ; ++i ) {
		href = link_nodes[ i ] . getAttribute("href") 
		if( href . indexOf( session , 0 ) == -1 ) {
			
			if( href . indexOf( ".cgi?" , 0 ) == -1 )
				href += "/index.cgi?"
		
			href += "id=" + session + "&"
			link_nodes[ i ] . setAttribute( "href" , href ) 
		}
	}
}
var checkout
function load_form() {
	loader()
	checkout = true
}
function loader() {
	checkout = false
	if( ! not_ie() )
		ms_styles()
	var anchor_list = document.getElementsByTagName("a")
	var index
	for( index = 0 ; index < anchor_list.length ; ++index )	{
		var button = anchor_list[index]
		button.onmouseover = highlight
		button.onmouseout = normal
		button.onmousedown = navigate
		if( button.getAttribute("id") == "submit")
			button.onclick = submit_form
	}
	select_nodes = document.getElementsByTagName("select")	
	for( var i = 0 ; i < select_nodes.length ; ++i )
		select_nodes[i].onchange = selection
	
	var input_list = document.getElementsByTagName("input")
	for( index = 0 ; index < input_list.length ; ++index )	{
		var rin = input_list[index]
		rin.onkeypress = on_enter
	}
	
}
function selection() {
	if( ! checkout )
		window.location.assign( this.value )
}
function highlight(event) {
	var img_src = "/buttons/" + this.getAttribute("id") + "_hover.gif"
	this.getElementsByTagName("img")[0].setAttribute("src" , img_src )		
}
function normal(event) {
	var img_src = "/buttons/" + this.getAttribute("id") + ".gif"
	this.getElementsByTagName("img")[0].setAttribute("src" , img_src )		
}
function navigate(event) {
	var img_src = "/buttons/" + this.getAttribute("id") + "_click.gif"
	this.getElementsByTagName("img")[0].setAttribute("src" , img_src )		
}
function submit_form() {
	document.getElementsByTagName("form")[0].submit()
}
function on_enter(event) {
	if (event.which == 13)
		submit_form()
}
function not_ie() {
	if(window.ActiveXObject)
		return false
	return true
}
function ms_styles() {
	var css_list = document . getElementsByTagName( "link" ) 
	var index
	for( index = 0 ; index < css_list.length ; ++index ) {
		var css_src = css_list[ index ] . getAttribute("href")
		var trunc = css_src . length - 4
		css_src = css_src . substr( 0 , trunc ) + "_ms.css"
		css_list[ index ] . setAttribute("href" , css_src )
	}
}
