var ns6 = "";
var ie = "";
var ns4 = "";
var opera = "";

if (navigator.appName == "Microsoft Internet Explorer")	ie = 1;
if (navigator.appName == "Netscape") {
	ns6 = 1;
		if(navigator.appVersion < 5.0) {
			ns4 = "1";
			ns6 = "";
		}
	}
if (navigator.appName == "Opera")	opera = 1;

	if(ns6) var topOffset = 99;
	if(ie) var topOffset = 99;
	if(ns4) var topOffset = 99;

function scroll() {
 if(ie) {
	var bodyoffheight = document.body.offsetHeight;
	var navigationoffheight = document.all.navigation.offsetHeight;
	var bodyscrolltop = document.body.scrollTop;
	var navigationstyletop = parseInt(document.all.navigation.style.top);
	

   if(bodyoffheight > navigationoffheight) {
   if(bodyscrolltop >= topOffset || navigationstyletop >= topOffset) {	
   		if(navigationstyletop  + 50 <  bodyscrolltop) 
     		document.all.navigation.style.top = navigationstyletop + 5;  
   		else if(navigationstyletop  < bodyscrolltop) 
     		document.all.navigation.style.top = navigationstyletop + 1;
   		else if(navigationstyletop  - 50 > bodyscrolltop) 
     		document.all.navigation.style.top = navigationstyletop - 5;
   		else if(navigationstyletop  > bodyscrolltop) 
     		document.all.navigation.style.top = navigationstyletop - 1; 
   	 }
  }
}
  else if(ns6 || opera) {

   if(window.pageYOffset >= topOffset || parseInt(document.getElementById("navigation").style.top) > topOffset) {
	
   if(parseInt(document.getElementById("navigation").style.top)  + 50< window.pageYOffset) 
     document.getElementById("navigation").style.top = (parseInt(document.getElementById("navigation").style.top) + 5);
     
   else if(parseInt(document.getElementById("navigation").style.top)  < window.pageYOffset) 
     document.getElementById("navigation").style.top = (parseInt(document.getElementById("navigation").style.top) + 1);

   else if(parseInt(document.getElementById("navigation").style.top)  - 50 > window.pageYOffset ) 
     document.getElementById("navigation").style.top = parseInt(document.getElementById("navigation").style.top) - 5;

   else if(parseInt(document.getElementById("navigation").style.top)  > window.pageYOffset) 
     document.getElementById("navigation").style.top = parseInt(document.getElementById("navigation").style.top) - 1; 
    }
 }
     
}

function doLoad() {
window.setInterval("scroll()",10)
}


function open_window(url,name,w,h)
{
    var win;
    win = window.open(url,name,'width='+w+',height='+h+',scrollbars=1,resizable=1,top=10,left=10');
    win.focus();
    return win;
}

function opgoto( url ) {
   window.opener.location.href=url;
   return(false);
}
