
// used by includes/topBanner.php & headerTop.php <body onResize...>

function scaleTopBannerFont()
{
	var w=((window && window.innerWidth)
			? window.innerWidth
		: ((document && document.body && document.body.clientWidth)
			? document.body.clientWidth
		: ((document && document.documentElement && document.documentElement.clientWidth)
			? document.documentElement.clientWidth
		: ((screen && screen.availWidth)
			? screen.availWidth
		: 800))));

	var t=150+70;					// space taken by #topTextLeftSpace & #topTextRightSpace
	var s=(w-t)/(800-t);			// scale relative to window size, allowing for constant space taken by images
	var r=(s>1) ? 1+(s-1)/4 : s;	// relative font size to use

	// class "topTextLarge" sets font size, and this changes the font size
	// of element id "topTextLarge" within it to a size relative to that
	document.getElementById("topTextLarge").style.fontSize=r*100+"%";

	// reset word spacing for new font size
	s=(navigator.appName=="Microsoft Internet Explorer") ? .4*r : .4;
	document.getElementById("topTextLarge").style.wordSpacing="-"+s+"em";
}
