/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

messages = new Array();
messages[0] = new Array('Wiggins Airport', 'http://www.wunderground.com/US/MS/Wiggins.html', 30.847410, -89.161763);
messages[1] = new Array('MS Gulf Coast College', 'http://weather.weatherbug.com/MS/Gulfport-weather.html?zcode=z6286&stat=WIGGN', 30.779615, -89.144015);
messages[2] = new Array('Airey Lookout Tower', 'unavailable.htm', 30.689386, -89.063915);
messages[3] = new Array('FS Experiment Station', 'unavailable.htm', 30.627824, -89.054616);
messages[4] = new Array('West Wortham Elementary School', 'http://dcnet.atdd.noaa.gov/GraphSite.php?SiteID=DC016&Submit=Get+Site+Data', 30.5667800, -89.1807940);
messages[5] = new Array('Harrison Central High School', 'http://dcnet.atdd.noaa.gov/GraphSite.php?SiteID=DC017&Submit=Get+Site+Data', 30.5150170, -89.1027090);
messages[6] = new Array('KGPT', 'http://weather.weatherbug.com/MS/Gulfport-weather.html?zcode=z6286&stat=KGPT', 30.409345, -89.079580);
messages[7] = new Array('GLPPC-AWS', 'http://weather.weatherbug.com/MS/Gulfport-weather.html?zcode=z6286&stat=GLFPC', 30.409544, -89.093426);
messages[8] = new Array('GLPPR-AWS', 'http://weather.weatherbug.com/MS/Gulfport-weather.html?zcode=z6286&stat=GLFPR', 30.369816, -89.082857);
messages[9] = new Array('GWPM6-NOS', 'http://www.ndbc.noaa.gov/station_page.php?station=gwpm6', 30.348, -89.087);
messages[10] = new Array('GPOM6-NOS', 'http://www.ndbc.noaa.gov/station_page.php?station=gpom6', 30.230, -88.982);
messages[11] = new Array('Harrison County', 'http://co.harrison.ms.us/weather/', 30.40, -89.10);
messages[12] = new Array('West Saucier', 'http://co.harrison.ms.us/weather/saucier/', 30.6297, -89.1625);

/***********************************************
* Wiggins Airport (KM24, 30.847410 N -89.161763 W, no web page)
* Mississippi Gulf Coast College (MGCCC, 30.779615 N -89.144015 W, http://weather.weatherbug.com/MS/Gulfport-weather.html?zcode=z6286&stat=WIGGN) 
* Airey Lookout Tower (ALT, 30.689386 N -89.063915 W, no web page)
* FS Experimetn Station (FSES, 30.627824 N -89.054616 W, no web page)
* West Wortham Elementary School (DCNET016, 30.5667800 N -89.1807940 W, http://dcnet.atdd.noaa.gov/GraphSite.php?SiteID=DC016&Submit=Get+Site+Data)
* Harrison Central High School (DCNET017, 30.5150170 N -89.1027090 W, http://dcnet.atdd.noaa.gov/GraphSite.php?SiteID=DC017&Submit=Get+Site+Data) 
* Gulfport Regional Airport (KGPT 30.409345 N -89.079580 W, http://weather.weatherbug.com/MS/Gulfport-weather.html?zcode=z6286&stat=KGPT)
* Gulfport Fire & Police Communications (GLPPC-AWS 30.409544 N -89.093426 W, http://weather.weatherbug.com/MS/Gulfport-weather.html?zcode=z6286&stat=GLFPC)
* Gulfport Fire Department (GLPPR-AWS 30.369816 N -89.082857 W, http://weather.weatherbug.com/MS/Gulfport-weather.html?zcode=z6286&stat=GLFPR)
* Gulport West Pier (GWPM6-NOS 30.348 N 89.087 W, http://www.ndbc.noaa.gov/station_page.php?station=gwpm6) 
* Gulfport Outer Range (GPOM6-NOS 30.230 N 88.982 W, http://www.ndbc.noaa.gov/station_page.php?station=gpom6)
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="images/arrow2.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip