	//*************************************************************************************
	//Let's create a browser sniff:
	var isDHTML = 0;
	var isLayers = 0;
	var isAll = 0;
	var isID = 0;
	if (document.all) {
		isAll = 1;
		isDHTML = 1;
	} else {
		if (document.getElementById) {
			isID = 1;
			isDHTML = 1;
		} else {
			browserVersion = parseInt(navigator.appVersion);
			if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {
				isLayers = 1;
				isDHTML = 1;
			}
		}
	}
	//*****************************************************************************************
	
	//*****************************************************************************************
	//Function to get the DOM info for a given browser	
	function findDOM(objectID,withStyle) {
		if (withStyle == 1) {
			if (isID) { 
				return (document.getElementById(objectID).style) ; 
			} else {
				if (isAll) {
					return (document.all[objectID].style) ;
				} else {
					if (isLayers) {
						return (document.layers[objectID]);
					}
				}
			}
		} else {
			if (isID) {
				return (document.getElementById(objectID)) ;
			} else {
				if (isAll) {
					return (document.all[objectID]);
				} else {
					if (isLayers) {
						return (document.layers[objectID]);
					}
				}
			}
		}
	}
	
	//**********************************************************************************************
	
	//**********************************************************************************************
	//captures the location of the mouse anytime it is on the image
	var x = 0;
	var y = 0;

	function Move(evt){
	    var e = evt ? evt : event;
		if (e.x) x = e.x;
		if (e.pageX) x = e.pageX;
	    if (e.y) y = e.y;
		if (e.pageY) y = e.pageY;
	}
	if (document.layers) document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove = Move;

	//we need this information to overcome a problem with NS6 where the DIVs that show the school's
	//name move further and further out each time their dot is moused over.
	if (isID) {
		var divTop;
		var divLeft;
	}
	
	//sets the position for the div we are about to show
	function setTop(objectID, xPos, yPos) {
		//assign the dom and style objects to global variables
		var domStyle = findDOM(objectID,1);
		var dom = findDOM(objectID,0);
		var height = 0;		

		//first get the x-y location of the top corner of the image if using NS6.x+
		if (isID || isAll) {
			var imgY = getY('AWSMap');
			var imgX = getX('AWSMap');
			var imgWidth = getWidth('AWSMap');
		}
		//get the height and width of the div
		if (domStyle.clip.height)	{
			height = domStyle.clip.height;
			width = domStyle.clip.width;
		} else if (dom.offsetHeight != null)	{
			height = dom.offsetHeight;
			width = dom.offsetWidth;
		}
				
		//we need to know how far away from the rendered x-y coords the image now is
		if (window.pageYOffset != null)	
			offset = window.pageYOffset;
		else if (document.body.scrollTop != null)
			offset = document.body.scrollTop;
		
		if (xPos >= imgWidth / 2) {
			xPos = xPos - width;
			
		}
		if (isID) {
			domStyle.top = yPos;
			domStyle.left = xPos;
			
		} else {
			if (isAll) {
//				alert(yPos + ' + ' + imgY + ' = ' + (yPos + imgY));
				domStyle.pixelTop = yPos + offset;
				domStyle.pixelLeft = xPos// + imgX;
			} else {
				if (dom.offsetTop) {
					dom.offsetTop = yPos + offset;
					dom.offsetLeft = xPos;
				}
			}
		}
		return(null);
	}

	//show the name of the station we are mousing over
	function showName(objectID,state) {
		setTop(objectID,x,y);
		var domStyle = findDOM(objectID,1);
		domStyle.visibility = state;
	}


		//It gets y coordinate of the image
	function getY(ImgElem) {
		tempEl = findDOM(ImgElem,0);
		var the_y = tempEl.offsetTop;
		while ((tempEl = tempEl.offsetParent) != null) {
			the_y += tempEl.offsetTop;
		}
		return the_y;
	}

	//It gets x coordinate of the image
	function getX(ImgElem) {
		tempEl = findDOM(ImgElem,0);
		var the_x = tempEl.offsetLeft;
		while ((tempEl = tempEl.offsetParent) != null) {
			the_x += tempEl.offsetLeft;
		}
		return the_x;
	}
	
	//It gets width of the image
	function getWidth(ImgElem) {
		tempEl = findDOM(ImgElem,0);
		tempElStyle = findDOM(ImgElem,1);
		if (tempElStyle.clip.width)	{
			the_width = tempElStyle.clip.width;
		} else if (tempEl.offsetWidth != null)	{
			the_width = tempEl.offsetWidth;
		}
		return the_width;
	}
	
	//*****************************************************************************************************
	
	
	//*****************************************************************************************************
	//the following code handles the fading of the observation data on the front page
	var c1 = 15;
	var c2 = 15;
	var f1 = 15;
	var f2 = 15;
	var chars = new Array (0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f');
	var direction = 'fade_in';
	
	function fade()
	{
		var c3 = "" + chars[c1] + chars[c2];
		var c4 = c3 + c3 + c3;
		var domStyle = findDOM('fadeText',1);
		domStyle.color = c4;
		if (direction == 'fade_in') {
			if (c2 == 15) changeText();
			c1--;
			c2--;
		} else {
			c1++;
			c2++;
		}
		
		//this holds the text visible for 3 seconds before it fades it again
		if (c2 == 0) {
			direction = 'fade_out';
			setTimeout("fade()",1500); 
		//otherwise we cycle through the fade-out and fade-in
		} else{
			if (c2 == 15)
				direction = 'fade_in';
			setTimeout("fade()",75); 
		}
	}
	
	function flashWarning(flashDirection) {
		var dom = findDOM('warningText',0);
		if (flashDirection) {
			dom.innerHTML = '';
			setTimeout("flashWarning(0)",400); 
		} else {
			dom.innerHTML = '* * Weather Alert * *';
			setTimeout("flashWarning(1)",800); 
		}
	}

	function flashSPWarning(flashDirection) {
		var dom = findDOM('warningText',0);
		if (flashDirection) {
			dom.innerHTML = '';
			setTimeout("flashSPWarning(0)",400); 
		} else {
			dom.innerHTML = '* * Alertas * *';
			setTimeout("flashSPWarning(1)",800); 
		}
	}

	function changeText () {
		obsArrayIndex++;
		if (obsArrayIndex == obsArray.length) obsArrayIndex = 0;
		var dom = findDOM('fadeText',0);
		if (isAll || isID)
			dom.innerHTML = obsArray[obsArrayIndex];
		return;
	}
	
	function getOffsetLeft (elem) {
		el = findDOM(elem,0)
		var ol = el.offsetLeft;
		while ((el = el.offsetParent) != null)
			ol += el.offsetLeft;
		return ol;
	}
	
	function moveElement(elem, x, y, vis) {
	elStyle = findDOM(elem,1);
	
	elStyle.top = y;
	elStyle.left = x;
	if (vis == 0)
		elStyle.visibility = 'hidden';
	else
		elStyle.visibility = 'visible';
}

function check3Sites(frm) {
	return false;
	var checkedCount = 0;
	for (i=0;i<frm.elements['siteListStations'].length;i++)
		alert(frm.elements['siteListStations'][i].checked)
		
		if (frm.elements['siteListStations'][i].checked == true) {
			checkedCount += 1;
			alert(i);
		}
			
	if (checkedCount >= 3)
		el.checked = false;
}

//********************************************************************
//the following functions are for the /user/livemap.asp java map configuration page

function checkAll() {
	elem = document.forms[0].elements['liveMapStations'];
	for (i=0;i<elem.length;i++){ 
		elem[i].checked = true;
	}
}

function unCheckAll() {
	elem = document.forms[0].elements['liveMapStations'];
	for (i=0;i<elem.length;i++){ 
		elem[i].checked = false;
	}
}

