var NS6 = false;
var IE4 = (document.all)? true:false
var NS4 = (document.layers)? true:false
var NS6 = (document.getElementById)? true:false
var yesMac = false;
if (navigator.userAgent.indexOf("Mac")!=-1) yesMac = true;

var pageScroll = false;
var moveit = false;
var scrolldir = 0;

var screenAdj = 0
if (IE4) screenAdj = 8;
if (NS4&!NS6) screenAdj = 8;
if (yesMac&&IE4) screenAdj = 0;

var menuViz = new Array("blank")
for (i = 1; i<11; i++){
        menuViz[i]="false";
	}

if (NS4) {
     var origWidth = window.innerWidth;
     var origHeight = window.innerHeight;
   }
if (IE4||NS6) {
     var origWidth = window.offsetWidth;
     var origHeight = window.offsetHeight
}

function rollover(button,axtn){
	if (document.images){document.images[button].src="/graphics/"+button+axtn+".gif";	}
}

function rolloverPS(button,axtn){
	if (document.images){document.images[button].src="/images/"+axtn+".gif";	}
}

function popup(newurl,winWidth,winHeight){

	w = screen.availWidth;
   	h = screen.availHeight;

	if (IE4||NS6) {
	   w = document.body.clientWidth;
	   h = document.body.clientHeight;
	   t = window.screenTop;
	   l = window.screenLeft;
	}
	
	var leftPos = ((w-winWidth)/2)+l, topPos = ((h-winHeight)/2)+t-25;
	
	starttext = "toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizeable=no,";
	featuretext = starttext + "width="+winWidth+",height="+winHeight+",left="+leftPos+",top="+topPos;
	mainView = window.open(newurl,'ImagePreview',featuretext);
	mainView.focus();
}

function xLink(whereto){
	newLoc = "xlink.asp?nL=" + whereto
	popup(newLoc,440,275)
	}
	
function resetTimer(){
	turnoffLayers();
	setupLayers();
	if (pageScroll) scroller();
 	setTimeout('resetTimer()',100);	
}

function scroller(){

	// get height
	if (NS4&&!NS6) var height = document.layers.textframe.document.layers.textblock.document.height
	else if (IE4) var height = document.all.textblock.scrollHeight
	else if (NS6) var height = document.getElementById("textblock").offsetHeight

	height = (height*-1) + 140 
	
	      if (moveit){
		   		if (NS6) {
		   			var thelayer = document.getElementById("textblock")
	                      y1 = parseInt(thelayer.style.top);
	                      y1 = y1 + scrolldir;
					if (y1>1){y1=0;}
					if (y1<height){y1=height}
					ny = y1 + "px"
	                      thelayer.style.top = ny;
	                     }
	             if (NS4&&!NS6) {
	                      y1 = parseInt(document.textframe.document.textblock.top);
	                      y1 = y1 + scrolldir;
	                      if (y1>1){y1=0;}
						  if (y1<height){y1=height}
	                      document.textframe.document.textblock.top = y1;
	                      }
	             if (IE4) {
	                      y1=parseInt(textblock.style.top);
	                      y1 = y1 + scrolldir;
	                      if (y1>1){y1=0;}
					if (y1<height){y1=height;}
	                      textblock.style.top = y1;
	                     }
					
	      }
}