// index.js 2008-03-19 JBR

var isMSIE;
var a_About;
var a_Contact;
var b_About;
var b_Contact;
var dirty = false;

	function body_onLoad() {
		
		//return;
		
			// globals
		isMSIE = ( navigator.appName == "Microsoft Internet Explorer" );
		a_About = document.getElementById( "A_About" );
		a_Contact = document.getElementById( "A_Contact" );
		b_About = document.getElementById( "B_About" );
		b_Contact = document.getElementById( "B_Contact" );
			// locals
		var col_left = document.getElementById( "col_left" );
		var col_main = document.getElementById( "col_main" );
		document.body.width = ( getWidth() - 32 ) + 'px';
		col_left.style.height = ( getHeight() - 10 ) + 'px';
		col_left.style.overflow = "hidden";
		col_main.style.height = ( getHeight() - 184 ) + 'px';
		col_main.style.overflow = "auto";
		if	( isMSIE ) {
			if	( b_About )
				b_About.style.top = "113px";
			if	( b_Contact )
				b_Contact.style.top = "278px";
			col_left.style.height = ( getHeight() - 16 ) + 'px';
			col_main.style.height = ( getHeight() - 184 ) + 'px';
		}
		if	( b_About )
			b_About.removeChild( a_About );
		if	( b_Contact )
			b_Contact.removeChild( a_Contact );
	}

	function getHeight() {
		if	( typeof( window.innerHeight ) == 'number' ) {
			//Non-IE
			return window.innerHeight;
		} else if ( document.documentElement && document.documentElement.clientHeight ) {
			//IE 6+ in 'standards compliant mode'
			return document.documentElement.clientHeight;
		} else if ( document.body && document.body.clientHeight ) {
			//IE 4 compatible
			return document.body.clientHeight;
		}
		return 0;
	}

	function getWidth() {
		if	( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			return window.innerWidth;
		} else if ( document.documentElement && document.documentElement.clientWidth ) {
			//IE 6+ in 'standards compliant mode'
			return document.documentElement.clientWidth;
		} else if ( document.body && document.body.clientWidth ) {
			//IE 4 compatible
			return document.body.clientWidth;
		}
		return 0;
	}

	function hideAllA() {	// hide only the blue drop down submenus & panhandles
		if	( false ) {/*
			var a = document.getElementsByTagName( "table" );
			for ( var i = 0; i < a.length; i++ ) { 
				var x = a[ i ];		// div obj
				if	( x.id.substr( 0, 2 ) == 'A_' ) {
					x.style.visibility = "hidden";
					x.style.zIndex = "-1";
				}
			}
			var a = document.getElementsByTagName( "div" );
			for ( var i = 0; i < a.length; i++ ) { 
				var x = a[ i ];		// div obj
				if	( x.id.substr( 0, 2 ) == 'A_' ) {
					x.style.visibility = "hidden";
				}
			}
		*/} else {
			if	( a_About ) {
				a_About.style.visibility = "hidden";
				a_About.style.zIndex = "-1";
				if	( a_About.parentElement ) {
					b_About.removeChild( a_About );
				}
			}
			if	( a_Contact ) {
				a_Contact.style.visibility = "hidden";
				a_Contact.style.zIndex = "-1";
				if	( a_Contact.parentElement ) {
					b_Contact.removeChild( a_Contact );
				}
			}
		}
	}
	function Aover( ele ) {
		ele.style.color = "#006";
		ele.style.textDecoration = "underline";
		hideAllA();
		if	( ele.id == 'About' ) {
			if	( false ) {/*
				var x = document.getElementById( "A_About" );
				x.style.visibility = "visible";
				x.style.zIndex = "2";
			*/} else if ( b_About ) {
				b_About.appendChild( a_About );
				a_About.style.visibility = "visible";
				a_About.style.zIndex = "2";
				dirty = true;
			}
		}
		if ( ele.id == 'Contact' ) {
			if	( false ) {/*
				var x = document.getElementById( "A_Contact" );
				x.style.visibility = "visible";
				x.style.zIndex = "2";
			*/} else if ( b_About ) {
				b_Contact.appendChild( a_Contact );
				a_Contact.style.visibility = "visible";
				a_Contact.style.zIndex = "2";
				dirty = true;
			}
		}
//		var t = setTimeout( 'hideAllA();', 3333 );	// 2009-04-09
		var t = setTimeout( 'hideAllA();', 12000 );	// 2009-06-03
	}
	function Aout( ele ) {
		ele.style.color = "#222";
		ele.style.textDecoration = "none";
	}
	
/*	function Aclick( ele ) {	// main menu click
		hideAllB();		// hide B_ items e.g. contact
		hideAllC();		// hide subordinate C_ items e.g. officers
		var estring = 'B_' + ele.id;
		var e = document.getElementById( estring );
		if	( e )		// if corresponding B_ item exists
			e.style.visibility = "visible";
	}*/
	function hideAllB() {	// hide B_About, B_Search, B_Join, etc.
		var a = document.getElementsByTagName( "div" );
		for ( var i = 0; i < a.length; i++ ) { 
			var x = a[ i ];		// div obj
			if	( x.id.substr( 0, 2 ) == 'B_' )
				x.style.visibility = "hidden";
		}
	}
	function Bover( ele ) {
		ele.style.color = "#006";
		ele.style.textDecoration = "underline";
	}
	function Bout( ele ) {
		ele.style.color = "#222";
		ele.style.textDecoration = "none";
	}
	function Cout( ele ) {
		if	( dirty
		&&	! isMSIE )
			history.go( 0 );		// for Firefox, must reload page from cache
	}
/*	function Bclick( ele ) {
		hideAllA();
		hideAllB();
		hideAllC();
		var estring = 'C_' + ele.id;
		var e = document.getElementById( estring );
		if	( e )
			e.style.visibility = "visible";
	}*/
	function hideAllC() {	// hide C_ items subordinate to B_About, B_Contact
		var a = document.getElementsByTagName( "div" );
		for ( var i = 0; i < a.length; i++ ) { 
			var x = a[ i ];		// div obj
			if	( x.id.substr( 0, 2 ) == 'C_' )
				x.style.visibility = "hidden";
		}
	}
