// browser sniffing
var agent 	= navigator.userAgent.toLowerCase ();
var isWinIE = (agent.indexOf ("msie") > -1) && (agent.indexOf ("mac") == -1);

function resizeTopFrame()
{
	try {
		var actualHeight = 0;
		
		// within I2O_MainFrame ?
		if (window.parent.frames["navBar"]!=null)
		{
			var h1 = window.parent.frames["navBar"].document.body.offsetHeight;
			var h2 = window.parent.frames["Large"].document.body.offsetHeight;
			
			// top vs left/right nav ?
			actualHeight = (h1>100) ? Math.max(h1,h2) : h1+h2;
		} else
		{
			actualHeight = document.body.offsetHeight;			
		}		
		onPageLoaded(actualHeight);
	} catch(e) {} //older browsers do not support scrollHeight
}

function shrinkTopFrame()
{
//	if (!isWinIE)
//		onPageLoaded(1); // force the smallest size allowed		
}

function scrollToTop()
{
	try { document.body.scrollTop = 0; } catch(e) {}; 
	try { document.documentElement.scrollTop = 0; } catch(e) {};
	try { window.scrollTo(0,0); } catch(e) {}; 
	try { window.top.I2O_scrollToTop(); } catch(e) {};
}

function onPageLoaded(actualHeight)
{
	try {
		window.top.I2O_pageLoaded(actualHeight); //function may not exist
	} catch(e) {}
}

function onMouseWheel(noScroll)
{
	if (window.event) // ie only
	{
		try {	
			var e = window.event;
			if ( noScroll == true) 
				e.cancelBubble = true; // no page scrolling
			else
				window.top.scrollPage(e.wheelDelta); // function may not exist
		} catch(ex) {}
	}
}

if(document.attachEvent)
	document.attachEvent("onmousewheel", onMouseWheel);



