
// Copyleft cookiecrook 2002+
// Author: James Craig
// Free for re-use if proper credit is given

var sUserAgent = navigator.userAgent.toLowerCase();
var isIE = document.all?true:false;
var isNS4 = document.layers?true:false;
var isOp = (sUserAgent.indexOf('opera')!=-1)?true:false;
var isMoz = (sUserAgent.indexOf('mozilla/5')!=-1 && sUserAgent.indexOf('opera')==-1 && sUserAgent.indexOf('msie')==-1)?true:false;

// Mozilla, Netscape7, Opera, and Mac IE support fixed positioning correctly.
// Windows IE and Netscape6 do not support it correctly.
// This function fakes it for these browsers.
function positionNav(){
	if(navigator.userAgent.indexOf('Opera')!=-1){
		return;
	} else if(navigator.userAgent.indexOf('Chimera')!=-1){
		return;
	} else if(document.all && navigator.platform.indexOf('Win')!=-1){
		oDB = document.HTMLElement ? document.HTMLElement : document.body;
		oNav = document.getElementById("menu");
		iTop = oDB.scrollTop + oDB.clientHeight - oNav.offsetHeight - 15;
		oNav.style.top = iTop + 'px';
	} else if(navigator.userAgent.indexOf('Netscape6')!=-1){
		oNav = document.getElementById("menu");
		oNav.style.position = "absolute";
		oNav.style.bottom = "auto";
		iTop = window.scrollY + window.innerHeight - oNav.offsetHeight - 15;
		oNav.style.top = iTop + 'px';
	}
}
window.onscroll = positionNav;
window.onresize = positionNav;

function setOnLoad(){
	positionNav();
	if(navigator.userAgent.indexOf('Netscape6')!=-1) window.setInterval('positionNav()',50);
	if((navigator.appName=='Netscape')&&(parseFloat(navigator.appVersion)<5)&&(navigator.platform.indexOf('Mac')!=-1)){
		window.setTimeout('window.scrollTo(0,0)',50);
	}
}
window.onload = setOnLoad;

