//	This script generates an optimal frameset for different browsers.
//	The resulting frameset is exactly (Microsoft) or close to (Netscape) the following:
//
//	<frameset rows='105,*' framespacing=0 frameborder='NO' BORDER='0'>
//		<frame src='[your top frame source as defined in index.html]' frameborder=0 name='navigation_top' marginwidth=0 marginheight=0 scrolling='no'>
//		<frame src='[your content frame source as defined in index.html]' name='content' frameborder=0 marginwidth=0 marginheight=0 noresize scrolling='auto'>
//		<frame src='[your bottom frame source as defined in index.html]' frameborder=0 name='navigation_bottom' marginwidth=0 marginheight=0 scrolling='no'>
//	</frameset>
//
//	NOTE:
//
//	top frame's name is "navigation_top" 
//	content frame's name is "content" 
//	bottom frame's name is "navigation_bottom"


//--BEGIN minimal top frame height, do not edit   --//
var topFrameMinimum = 136;	// actually 102, Netscape crops one more px here
//--END minimal top frame height, do not edit   --//

//--BEGIN minimal bottom frame height, do not edit   --//
var bottomFrameMinimum = 1;	// actually 20, Netscape crops one more px here
//--END minimal bottom frame height, do not edit   --//

//--BEGIN basic variables for Netscape workaround, do not edit   --//
var theHeight = window.innerHeight;
var thePercent = (theHeight/100);
var currentWidth = window.innerWidth;
var currentHeight = window.innerHeight;
var tmpTop = 0;
var tmpBottom = 0;
var allDefined = 0;
var checkTopHeight = true;
var checkBottomHeight = true;
var iAgent = window.navigator.userAgent;
//--END basic variables for Netscape workaround, do not edit   --//

//--BEGIN basic functions for Netscape workaround, do not edit   --//
function IsIE()
	{//	get browser type
	return iAgent.indexOf("MSIE") > 0;
	}
function checkForResize()
	{//	Netscape workaround if window gets resized
	if ((window.innerWidth != currentWidth) || (window.innerHeight != currentHeight))
		window.location.href = frameset_url;
	//else
	//	setTimeout('checkForResize()',1000);
	}
//--END basic functions for Netscape workaround, do not edit   --//

//--BEGIN Netscape workaround, do not edit   --//
if (!IsIE())
	{//--BEGIN frameset definition for Netscape
	for (i = 1; i < 100; i++)
		{
		if (checkTopHeight)
			if (Math.floor(thePercent*i) >= topFrameMinimum)
				{
				tmpTop = i;
				checkTopHeight = false;
				allDefined++;
				}
		if (checkBottomHeight)
			if (Math.floor(thePercent*i) >= bottomFrameMinimum)
				{
				tmpBottom = i;
				checkBottomHeight = false;
				allDefined++;
				}
		if (allDefined == 2)
			{
			//document.writeln("<frameset rows='" + tmpTop + "%,*,49' framespacing=0 frameborder='NO' BORDER='0'>");
			document.writeln("<frameset rows='123,*,20' framespacing=0 frameborder='NO' BORDER='0'>");
			document.writeln("<frame src='" + topFrameSource + "' frameborder=0 name='top_navigation' marginwidth=0 marginheight=0 SCROLLING='NO'>");
			document.writeln("<frame src='" + contentFrameSource + "' name='content' frameborder=0 marginwidth=0 marginheight=0 noresize SCROLLING='AUTO'>");
			document.writeln("<frame src='" + bottomFrameSource + "' frameborder=0 name='bottom_navigation' marginwidth=0 marginheight=0 SCROLLING='NO'>");
			document.writeln("<\/frameset>");
			i = 100;
			}
		//setTimeout('checkForResize()',1000);
		}
	}//--END frameset definition for Netscape
else
	{//--BEGIN frameset definition for MS Internet Explorer
			document.writeln("<frameset rows='123,*,20' framespacing=0 frameborder='NO' BORDER='0'>");
			document.writeln("<frame src='" + topFrameSource + "' frameborder=0 name='top_navigation' marginwidth=0 marginheight=0 SCROLLING='NO'>");
			document.writeln("<frame src='" + contentFrameSource + "' name='content' frameborder=0 marginwidth=0 marginheight=0 noresize SCROLLING='AUTO'>");
			document.writeln("<frame src='" + bottomFrameSource + "' frameborder=0 name='bottom_navigation' marginwidth=0 marginheight=0 SCROLLING='NO'>");
			document.writeln("<\/frameset>");
	}//--END frameset definition for MS Internet Explorer
//--END Netscape workaround, do not edit   --//

                    
					
					
