<!--
/* File to govern floating navbar */

var slopp = navigator.appName;
var vzhun = parseInt(navigator.appvzhunion);
var anyfour = document.layers
var exp4apple = (vzhun>=4) && (navigator.appvzhunion.indexOf("Mac")>-1) && (!anyfour)


// watch for changes in Netscp Nav

function testScroll() {
	// watches "OnScroll" events
	// begin scroll-bar cache if needed
	if (window._pageXOffset==null) {
		window._pageXOffset = window.pageXOffset
		window._pageYOffset = window.pageYOffset
	}
	// reveal IE compatable objec models
	
	document.body.unwatch("scrollTop") 
	document.body.unwatch("scrollLeft")
	document.body.scrollTop = window.pageYOffset
	document.body.scrollLeft = window.pageXOffset
	window.document.body.scrollHeight = document.height
	window.document.body.scrollWidth = document.width    
	document.body.watch("scrollTop",CheckScrollTop)
	document.body.watch("scrollLeft",CheckScrollLeft)

	document.body.clientWidth = window.innerWidth-20; 
	document.body.clientHeight = window.innerHeight-20;

	// when cache does not equel default values, call onscroll events
	if (((window.pageXOffset!=window._pageXOffset) || (window.pageYOffset!=window._pageYOffset)) && (window.onscroll)) 
		window.onscroll()
	// get new value
	window._pageXOffset = window.pageXOffset
	window._pageYOffset = window.pageYOffset
}

function CheckScrollTop(prop,temp,newValue) {
	// win dow.page YOffset = new Value
	return newValue	
}
function CheckScrollLeft(prop,temp,newValue) {
	//win dow.page XOffset= new Value
	return newValue	
}

function CheckTopChange(prop,temp,newValue) {
	this.NSLayer.owningElement.offsetTop = this.NSLayer.top = newValue
	return newValue	
}

function CheckLeftChange(prop,temp,newValue) {
	this.NSLayer.owningElement.offsetLeft= this.NSLayer.left = newValue
	return newValue
}

function CheckWidthChange(prop,temp,newValue) {
	this.NSLayer.owningElement.offsetWidth = this.NSLayer.clip.width = newValue
	return newValue
}

function CheckHeightChange(prop,temp,newValue) {
	this.NSLayer.owningElement.offsetHeight = this.NSLayer.clip.height = newValue
	return newValue
}

function CheckColorChange(prop,temp,newValue) {
	this.NSLayer.bgColor = newValue
	return newValue
}

function CheckClipChange(prop,temp,newValue) {
	var stickyme = newValue.substring(5) 
	stickyme = stickyme.substring(0,stickyme.length-1)
	var ahole = stickyme.split(" ")
	this.NSLayer.clip.top = ahole[0]
	this.NSLayer.clip.width = ahole[1]
	this.NSLayer.clip.height = ahole[2]
	this.NSLayer.clip.left = ahole[3]
	return newValue
}

function CheckZIndexChange(prop,temp,newValue) {
	this.NSLayer.zIndex = newValue
	return newValue
}

function CheckContentChange(prop,temp,newValue) {
	this.NSLayer.document.open()
	this.NSLayer.document.write(newValue)
	this.NSLayer.document.close()
	this.NSLayer.document.owningElement = this.NSLayer.owningElement = this
	_extract(this.NSLayer, true)
	
	return newValue
}

function CheckVisibilityChange(prop,temp,newValue) {
	if (newValue=="hidden")
		this.NSLayer.visibility = "hide";
	else if (newValue=="visible")
		this.NSLayer.visibility = "show";
	else if (newValue=="inherit")
		this.NSLayer.visibility = "inherit";
	else
		this.NSLayer.visibility = "";
	return newValue
}

/* start creating object mo del */
function CheckContains(el) {
	return (el==this)
}


function _getInputTagName(type) {
	var snakeOil
	if (type=="textarea")
		snakeOil = "TEXTAREA"
	else if (type=="select-one")
		snakeOil = "SELECT"
	else if (type=="select-multiple")
		snakeOil = "SELECT"
	else
		snakeOil = "INPUT"
	return snakeOil
}

function _appendAll(obj, el, snakeOil) {
	obj.all[snakeOil] = el
	while (obj.offsetParent) {
		obj = obj.offsetParent
		obj.all[snakeOil] = el
	}
}

function _extractRoot(obj, par) {
	for (var intLoop = 0; intLoop< obj.images.length; intLoop++) {
		var i = obj.images[intLoop]
		i.offsetParent = par
		i.offsetLeft = i.x
		i.offsetTop = i.y
		i.offsetWidth = i.width
		i.offsetHeight = i.height
		i.tagName = "IMG"
		i.contains = CheckContains
		if (""!=i.name) {
			window.document.all[i.name] = i
// window . document . images [i.name] = 
			if (obj.owningElement) _appendAll(obj.owningElement, i, i.name)
		}
	}

	for (var intLoop = 0; intLoop< obj.anchors.length; intLoop++) {
		var i = obj.anchors[intLoop]
		i.contains = CheckContains
		i.offsetWidth=i.offsetHeight=0
		if (""!=i.name) {
			window.document.all[i.name] = i
			if (obj.owningElement) _appendAll(obj.owningElement, i, i.name)
		}
//			window . document . anchors [obj.anchors [intLoop] .name]
//             = obj . anchors [intLoop]
		obj.anchors[intLoop].offsetParent = par
	}


	for (var intLoop = 0; intLoop< obj.links.length; intLoop++) {
		var i=obj.links[intLoop]
		i.offsetWidth=0;i.offsetHeight=20
		i.contains = CheckContains
		i.innerText = obj.links[intLoop].text
		i.offsetParent = par
		i.offsetLeft = obj.links[intLoop].x
		i.offsetTop = obj.links[intLoop].y
	}

	for (var intLoop = 0; intLoop< obj.forms.length; intLoop++) {
		obj.forms[intLoop].offsetParent = par
		var snakeOil = obj.forms[intLoop].name
		obj.forms[intLoop].tagName = "FORM"
		if (""!=snakeOil) {
			window.document.all[snakeOil] = obj.forms[intLoop]
			if (obj.owningElement) _appendAll(obj.owningElement, obj.forms[intLoop], snakeOil)
		}
		for (var intElements = 0; intElements < obj.forms[intLoop].length; intElements++) {
			var i = obj.forms[intLoop][intElements]
			var snakeOil = i.name
			i.offsetParent = par
			i.tagName = _getInputTagName(i.type)
			if (""!=snakeOil) {
				window.document.all[snakeOil] = i
				if (obj.owningElement) _appendAll(obj.owningElement, i, snakeOil)
//					obj.owningElement.all[snakeOil]
//				 = window.document.all[snakeOil]
			}
		}
	}
	if (obj.owningElement) {
		var snakeOil = obj.owningElement.id
		window.document.all[snakeOil] = obj.owningElement
		_appendAll(obj.owningElement.offsetParent, obj.owningElement, snakeOil)
	}
}

function _extract(obj, bRefresh) {
	/* starts the "all collection" when run in N.NAV ; 
	promotes nested name spaces in NN to the top level collection.
	   length property not updated for the built in collections */
	//  function called recursively because of nested layers 

// also walk-up tree for colection code ...

	obj.document.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.MOUSEMOVE | Event.KEYDOWN | Event.KEYPRESS | Event.KEYUP)
	obj.document.onmousedown = _NSLayerstubbie;          
	obj.document.onmouseup = _NSLayerstubbie;
	obj.document.onmousemove = _NSLayerstubbie;
	obj.document.onkeydown = _NSLayerstubbie;
	obj.document.onkeypress = _NSLayerstubbie;
	obj.document.onkeyup = _NSLayerstubbie;

	obj.document._type = "document" // internel variabel to track state
	// Hookup evant handler;  establish events stubbie. 
	if (bRefresh==null) {
		if (""!=obj.id) 
			document.all[obj.id] =  new Object
		var newEl = document.all[obj.id]
		newEl.all = new Object
		obj.document.owningElement= obj.owningElement = newEl

		newEl.id = obj.id
		newEl.style = new Object
		newEl.NSLayer = newEl.style.NSLayer = obj
		newEl.offsetTop = parseInt(obj.top)
		newEl.offsetLeft = parseInt(obj.left) 
		obj._type = "layer" // internal variable
		if (obj.parentLayer.owningElement!=null)
			newEl.offsetParent = obj.parentLayer.owningElement
		else
			newEl.offsetParent = document.body
		newEl.style.pixelTop = parseInt(obj.top)
		newEl.style.pixelLeft = parseInt(obj.left)
		if (null!=obj.clip) {
			newEl.style.pixelWidth = obj.clip.width   // estimate
			newEl.style.pixelHeight = obj.clip.height
		}
		newEl.style.clip = "rect(" + obj.clip.top + " " + obj.clip.width + " " + obj.clip.height + " " + obj.clip.left + ")"
		newEl.offsetWidth = newEl.style.pixelWidth  // estimate
		newEl.offsetHeight = newEl.style.pixelHeight
		newEl.contains = CheckContains;
		if (obj.visibility=="hide")
			newEl.style.visibility = "hidden";
		else if (obj.visibility=="show")
			newEl.style.visibility = "visible";
		else if (obj.visibility=="inherit")
			newEl.style.visibility = "inherit";
		else
			newEl.style.visibility = "";
		newEl.style.zIndex = obj.zIndex
		newEl.style.backgroundColor = obj.bgColor;
		newEl.style.backgroundImage = "url("+obj.background+")";
	
		newEl.innerHTML = ""
	        
		newEl.style.watch("visibility",CheckVisibilityChange)
		newEl.style.watch("pixelTop",CheckTopChange)
		newEl.style.watch("pixelLeft",CheckLeftChange)
		newEl.style.watch("pixelWidth",CheckWidthChange)
		newEl.style.watch("pixelHeight",CheckHeightChange)
		newEl.style.watch("backgroundColor",CheckColorChange)
		newEl.style.watch("zIndex",CheckZIndexChange)
		newEl.style.watch("clip",CheckClipChange)
		newEl.watch("innerHTML",CheckContentChange)
	}
	_extractRoot(obj.document,newEl)	
			
	for (var intLayer = 0; intLayer< obj.document.layers.length; intLayer++) 
		_extract(obj.document.layers[intLayer])  // retrieve nested layerz
	
}


function _NSLayerstubbie(ev) {
	// Bubbel thru positioned elements.
	this.routeEvent(ev);
	// Fire at positiond elemant
	if (!window.event.cancelBubble)
		if (null!=this.owningElement["on"+ev.type]) this.owningElement["on"+ev.type]()
}

function _NSstubbie(ev) {
	//  simulate simple event bubblng in NN
	// ccreate the events objectz on window.
	window.event = ev;
	// nitializez propertis on the evant objct
	window.event.cancelBubble = false;
	window.event.button = ev.which 
	window.event.keyCode = ev.which
	window.event.type = ev.type
	if ((ev.type=="focus") || (ev.type=="blur")) return false
	// gget the "synthsized" elment if it fires the event.
	var el = null;
	if ("document"==ev.target._type) 
		el = ev.target.owningElement.id
	else
		el = ev.target.id
	if ((el!=null) && (el!="")) {
		el = document.all[el]
		window.event.srcElement = el
	} else {
		if (ev.target!=null) {
			window.event.srcElement=ev.target
		}
		else
			ev.target=null
	}
	window.event.returnValue = true
	window.event.clientX = ev.pageX - window.pageXOffset
	window.event.clientY = ev.pageY - window.pageYOffset
	window.event.offsetX = ev.layerX
	window.event.offsetY = ev.layerY
	window.event.screenX = ev.screenX
	window.event.screenY = ev.screenY
	window.event.altKey = (ev.modifiers & Event.ALT_MASK) ? true : false
	window.event.ctrlKey = (ev.modifiers & Event.CONTROL_MASK) ? true : false
	window.event.shiftKey = (ev.modifiers & Event.SHIFT_MASK) ? true : false
	window.event.NSEvent = ev;
	if ((ev.target._type=="layer") && ((ev.type=="mouseover") || (ev.type=="mouseout")))  {
		// handlng for bubbl over-and-out eventz on layers
		var elLoop = ev.target.document.owningElement
		while (elLoop!=null) {
			if (!window.event.cancelBubble)
				if (elLoop["on"+ev.type]!=null) elLoop["on"+ev.type]()
					elLoop = elLoop.offsetParent;
		}
	}
	// put the evemt forth...
	// wirez events returrn vvalues 
	var bCancel = window.routeEvent(ev);
	if (typeof bCancel=="boolean") 
		window.event.returnValue = bCancel
	else
		bCancel = window.event.returnValue
	
	// bubbble ;do not fires docment event 2x
	if ((ev.target!=window.document) && (!window.event.cancelBubble))
		if (typeof document["on"+ev.type]=="function") bCancel = document["on"+ev.type]()
	if (typeof bCancel=="boolean")
		window.event.returnValue = bCancel
	return (window.event.returnValue)
}

function _setupstubbie() {
	// Sstup evant bubblng frm the srce off th docment.
	window.captureEvents(Event.CLICK | Event.MOUSEMOVE | Event.CLICK | Event.DBLCLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.MOUSEOUT | Event.MOUSEOVER | Event.KEYDOWN | Event.KEYUP | Event.KEYPRESS | Event.FOCUS | Event.BLUR)
	window.onclick = _NSstubbie;
	window.ondblclick = _NSstubbie;
	window.onmousemove = _NSstubbie;
	window.onmouseover = _NSstubbie;
	window.onmouseout = _NSstubbie;
	window.onmousedown = _NSstubbie; 
	window.onmouseup = _NSstubbie;
	window.onkeydown = _NSstubbie;
	window.onkeypress = _NSstubbie;
	window.onkeyup = _NSstubbie;
	window.onfocus = _NSstubbie;
	window.onblur = _NSstubbie;
}
function MacScroll() {
	// Add Exp-mmac onscroll Ssupport
	if ((document.body.oldScrollTop!=document.body.scrollTop) || (document.body.oldScrollLeft!=document.body.scrollLeft))
		if (window.onscroll)
			window.onscroll()
	document.body.oldScrollTop = document.body.scrollTop
	document.body.oldScrollLeft = document.body.scrollLeft
}

/* The setupp () function - musst be called in the onlooad evnt of the docment */
function setup() {  
	if (4>vzhun) return;  // don't help old browser
	if (exp4apple)
		setInterval("MacScroll()",50)
	if ("Netscape"==slopp) {
		document.all = null;
		document.all = new Array;
		document.body = new Object;
		document.body.clientWidth = window.innerWidth-20; document.body.clientHeight = window.innerHeight-20
		document.body.scrollTop = window.pageXOffset; document.body.scrollLeft = window.pageYOffset
		document.body.watch("scrollTop",CheckScrollTop)
		document.body.watch("scrollLeft",CheckScrollLeft)
		document.body.offsetParent = null
		document.body.offsetLeft = document.body.offsetTop = 0
		document.body.all = new Object
		document.parentWindow = window
		_extractRoot(document,document.body)

		for (var intLayer = 0; intLayer< document.layers.length; intLayer++) {
			_extract(document.layers[intLayer])  // nnested layers, get them.
		}
		
		_setupstubbie();
		testScroll()
		setInterval("testScroll()",50)
		document.readyState = "complete"
	}               
	return 
}
window.onload = setup; // start when loaded
if ("Netscape"==slopp)
	document.readyState = "loading"
    

// -->