// JavaScript Document
<!--
dom = (document.getElementById) ? true : false;
ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
ns4 = (document.layers && !dom) ? true : false;
ie4 = (document.all && !dom) ? true : false;
nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth;
  origHeight = window.innerHeight;
 }
 
function reDo() {
 if (window.innerWidth != origWidth || window.innerHeight != origHeight) 
    window.location.reload();
}
if (ns4) window.onresize = reDo; 


var winElem, wincss, cntElem, cntcss, done, curLyr;
function init(lyr) {
	curLyr = lyr;
	winElem = (ns4)? document.wndo: (ie4)? document.all['wndo']: (ie5||ns5)? document.getElementById('wndo'): null;
	wincss = (ns4)? document.wndo: (ie4)? document.all['wndo'].style: (ie5||ns5)? document.getElementById('wndo').style: null;
	done = true;	
	loadLyr(lyr);	
		getY(lyr);
}

function show(lyr) {
	var lyrcss = (ns4)? document.wndo.document.layers[lyr]: (ie4)? document.all[lyr].style: (ie5||ns5)? document.getElementById(lyr).style: null;
	lyrcss.visibility = "visible";
}

function hide(lyr) {
	var lyrcss = (ns4)? document.wndo.document.layers[lyr]: (ie4)? document.all[lyr].style: (ie5||ns5)? document.getElementById(lyr).style: null;
	lyrcss.visibility = "hidden";
}

function shiftTo(lyr,x,y) {
	var lyrcss = (ns4)? document.wndo.document.layers[lyr]: (ie4)? document.all[lyr].style: (ie5||ns5)? document.getElementById(lyr).style: null;
	if (ns4||ns5) {
		lyrcss.left = x; lyrcss.top = y;
	} else if (ie4||ie5) {
		lyrcss.pixelLeft = x; lyrcss.pixelTop = y;
	}
}

function loadLyr(lyr) {
	if (!done) return; 
	var oldLyr = curLyr;
	hide(oldLyr);
  curLyr = lyr;
	show(lyr);
	shiftTo(lyr,0,0);	
	getY(lyr);
}



var jump=100;		
var inc=4;	
var timer=30;	
var maxY;
function getY(lyr) {			
	cntElem = (ns4)? document.wndo.document.layers[lyr]: (ie4)? document.all[lyr]: (ie5||ns5)? document.getElementById(lyr): null;
	cntcss = (ns4)? document.wndo.document.layers[lyr]: (ie4)? document.all[lyr].style: (ie5||ns5)? document.getElementById(lyr).style: null;
	var winHt = (ns4)? wincss.clip.height: (ie4||ie5)? winElem.clientHeight: (ns5)? winElem.offsetHeight: 0;
	var cntHt = (ns4)? cntElem.document.height: (ie4||ie5)? cntElem.clientHeight: (ns5)? cntElem.offsetHeight: 0;
	return maxY = cntHt - winHt;
}

function getCntTop() {
	if (ns4) return cntcss.top;
	else if (ie4 || ie5) return cntcss.pixelTop;
	else if (ns5) return parseInt(cntcss.top);
}

function scrollCnt(y) {
	if (ns4) cntcss.top += y;
	else if (ie4 || ie5) cntcss.pixelTop += y;
	else if (ns5)	cntcss.top = parseInt(cntcss.top) + y;
}

var t;
function inchDown() {
	if (!done) return;
	var y = getCntTop();	
	if (y>-maxY) { 
		scrollCnt(-inc);	
		t = setTimeout("inchDown()",timer);	
	}
}

function inchUp() {
	if (!done) return;
	var y = getCntTop();		
	if (y<0) { 
		scrollCnt(inc);	
		t = setTimeout("inchUp()",timer);	
  }
}

//-->
