//GENERAL JAVASCRIPT INCLUDE FILE

var img_number = 1;
var over_image = 0;
var oldcolor = '#FFF';

var NAV = 0;
	
//determine browser
function preload(){
	NAV = (navigator.appName == 'Netscape');
}


function popupfull(url,wide,high){
		fullWin = window.open(url,'popupWin1','toolbar=0,location=1,directories=0,status="Burnside GIS",menubar=1,scrollbars=1,resizeable=1,width='+wide+',height='+high+'');
		fullWin.focus();		
}

function popup(url,wide,high){
		var winl = (screen.width - wide) / 2;
		var wint = (screen.height - high) / 2;
		smallWin = window.open(url,'popupWin','toolbar=0,location=0,directories=0,status="Burnside GIS",menubar=0,scrollbars=1,resizeable=1,width='+wide+',height='+high+',top='+wint+',left='+winl+'');
		smallWin.focus();		
}

function popup2(url,wide,high){
		var winl = (screen.width - wide) / 2;
		var wint = (screen.height - high) / 2;
		smallWin = window.open(url,'popupWin2','toolbar=0,location=0,directories=0,status="Burnside GIS",menubar=0,scrollbars=1,resizeable=1,width='+wide+',height='+high+',top='+wint+',left='+winl+'');
		smallWin.focus();		
}


//roll over images
function over(name,source){


	if (NAV) {
		document[name].src=source;
	} else {
		document.all[name].src=source;
	}

}

//roll out images
function out(name,source){

	if (NAV) {
		document[name].src=source;
	} else {
		document.all[name].src=source;
	}
}


function changeInputActive(id,styleclass){
	if (document.getElementById(id).value=="<username>") {
		document.getElementById(id).className=styleclass;
		document.getElementById(id).value="";
	}
}

function defaultInputs(){
	document.getElementById('HeaderControl_txtLUUsername').value="username";
}


function hideLayer(whichLayer)
{
if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = "none";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = "none";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = "none";
	}
}

function changeLayerColor(element, color) { 

	//var element;

	//element = returnLayer (id); 
	oldcolor = element.style.backgroundColor; 
	element.style.backgroundColor = color; 
}

function changeLayerColorBack(element) {

	//var element = returnLayer (id); 
	element.style.background = oldcolor; 
}


function returnLayer (id) {


	if (document.getElementById)
	{
		// this is the way the standards work
		var element = document.getElementById(id);
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var element = document.all[id];
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var element = document.layers[id];
	}

	return element;

}

function showByCheckbox(whichLayer, Layer2)
{
	var style2, chkBox;
	
	if (document.getElementById)
	{
		// this is the way the standards work
		style2 = document.getElementById(whichLayer).style;
		chkBox  = document.getElementByID(Layer2).checked;
		style2.display = chkBox?"none":"";

	}
	else if (document.all)
	{
		// this is the way old msie versions work
		style2 = document.all[whichLayer].style;
		chkBox  = document.all[Layer2].checked;
		style2.display = chkBox?"none":"";

	}
	else if (document.layers)
	{
		// this is the way nn4 works
		style2 = document.layers[whichLayer].style;
		chkBox  = document.all[Layer2].checked;
		style2.display = chkBox?"none":"";

	}
}


function toggleLayer(whichLayer)
{	
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"none";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"none";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"none";
	}
	
}

function returnLayerDisplay(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		return style2.display;
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		return style2.display;
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		return style2.display;
	}
}


function setFocus(whichLayer)
{

	if (document.getElementById)
		document.getElementById(whichLayer).focus();
	else if (document.all)
		document.all[whichLayer].focus();
	else if (document.all)
		document.layers[whichLayer].focus();

}
