﻿
	window.onerror = null;
	var bName = navigator.appName;
	var bVer = parseInt(navigator.appVersion);
	var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
	var menuActive = 0;
	var menuOn = 0;
	var onLayer;
	var timeOn = null;

	function showLayer(layerName,aa){
		var x =document.getElementById(aa);
		var tt =findPosX(x)-30; 
		var ww =findPosY(x); 

		if (timeOn != null) {
			clearTimeout(timeOn);
			hideLayer(onLayer);
		}
		if (IE4) {
			var layers = eval('document.all["'+layerName+'"].style');
			layers.left = tt;
			eval('document.all["'+layerName+'"].style.visibility="visible"');
		}
		else {
			if(document.getElementById){
				var elementRef = document.getElementById(layerName);
				if((elementRef.style)&& (elementRef.style.visibility!=null)){
					elementRef.style.visibility = 'visible';
					elementRef.style.left = tt;
					elementRef.style.top = ww;
				}
			}
		}
		onLayer = layerName
	}

	function hideLayer(layerName){
		if (menuActive == 0){
			if (IE4){
				eval('document.all["'+layerName+'"].style.visibility="hidden"');
			} 
			else{
				if(document.getElementById){
					var elementRef = document.getElementById(layerName);
					if((elementRef.style)&& (elementRef.style.visibility!=null)){
						elementRef.style.visibility = 'hidden';
					}
				}
			}
		}
	}

	function btnTimer() {
		timeOn = setTimeout("btnOut()",600)
	}

	function btnOut(layerName){
		if (menuActive == 0){
			hideLayer(onLayer)
		}
	}

	var item;
	function menuOver(itemName,ocolor){
		item=itemName;
		itemName.style.backgroundColor = '#8FDD6A'; //background color change on mouse over 
		clearTimeout(timeOn);
		menuActive = 1
	}
	
	function menuOut(itemName,ocolor){
	if(item)
		itemName.style.backgroundColor = '#FFE495';
		menuActive = 0
		timeOn = setTimeout("hideLayer(onLayer)", 100)
	}
	
	function highLight(itemName){
		itemName.style.backgroundColor = '#8FDD6A'; //background color change on mouse over
		itemName.style.textColor = '#17375E'; 
	}

	function unHighLight(itemName){
		itemName.style.backgroundColor = '#FFE495'; //background color changed on mouse out
		itemName.style.textColor = '#17375E';
	}

	

	function findPosX(obj){
		var curleft = 0;
		if (obj.offsetParent){
			while (obj.offsetParent){
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if(obj.x)
			curleft += obj.x;
		return curleft;
	}

	function findPosY(obj){
		var curtop = 0;
		if (obj.offsetParent){
			while (obj.offsetParent){
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		}
		else if (obj.y)
		curtop += obj.y;
	return curtop;
	}
	
	function openCIS(){
		NewWindow = window.open("http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=456+SW+Washington+Ave,+Corvallis,+OR+97333&sll=37.0625,-95.677068&sspn=37.462243,93.164063&ie=UTF8&ll=44.561548,-123.264649&spn=0.008241,0.022745&z=16&iwloc=r0");
	}
	
	function openSIS(){
		NewWindow = window.open("http://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=1250+Main+St+E,+Monmouth,+OR+97361&sll=37.0625,-95.677068&sspn=45.553578,93.076172&ie=UTF8&z=14&iwloc=A&ll=44.857512,-123.218536");
	}
	

	function openLink(obj) {
		NewWindow = window.open(obj);
	}


