// Standard Javascript functions for www.weyrich.com web pages.
// 
// Supports Internet Explorer 4.0 and higher ONLY.
//
// Copyright (C) 2001 Orville R. Weyrich, Jr.
//
// $Id

var prevWidth = 0;	// supports title_resize

// Setup function to be invoked at the END of the HTML BODY
function weyrich() {
	if ( navigator.appName.indexOf("Microsoft") != -1
	&&   parseInt(navigator.appVersion) >= 4 ) {
		// this event does not seem to fire in 
		// IE 5.5 so do it the hard way
		//window.onresize = title_resize;
		setInterval("title_resize()", 1000);
		// this event works as expected
		window.onload = title_resize;
	}
}

function title_resize() {
	var maxHeight = 120;
	var curWidth;

	if ( navigator.appName.indexOf("Microsoft") != -1
	&&   parseInt(navigator.appVersion) >= 4 
	&&   document 
	&&   document.all 
	&&   document.all.title 
	&&   document.all.title.offsetWidth 
	&&   document.all.title.offsetHeight ) {

	curWidth = document.all.title.offsetWidth;
	if (curWidth != prevWidth) {
		document.all.title.style.fontSize = 20 ; // default size
			var i = 0;
			while ( document.all.title.offsetHeight > maxHeight 
			&&      i < 11 ) {
				document.all.title.style.fontSize
				= parseInt(document.all.title.style.fontSize) 
					- 1;
				i++;
			}
			prevWidth = document.all.title.offsetWidth;
		}
	}
}

function menu_onmouseover(n) {
	if ( navigator.appName.indexOf("Microsoft") != -1
	&&   parseInt(navigator.appVersion) >= 4 ) {
		eval( "menu"+n+".style.background = '#E4F0F0';" );
		//title_resize();	
	}
}

function menu_onmouseout(n) {
	if ( navigator.appName.indexOf("Microsoft") != -1
	&&   parseInt(navigator.appVersion) >= 4 ) {
		eval( "menu"+n+".style.background = '#E4D3C9';" );
	}
}

