/**********************************************************************************   
PopupDescriptions 
*   Copyright (C) 2001 <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a>
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a> 
*********************************************************************************/

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6||this.ie7
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()



/***************************************************************************************
Variables to set:
***************************************************************************************/
messages=new Array()
messages[0] = '<div class="puCaption">African Continent</div><br>Angola<BR>Cape Verde, Rep. of<BR>Egypt, Arab Rep. of<BR>Kenya<BR>Mauritania<BR>Morocco<BR>Namibia, Rep. of<BR>Nigeria<BR>South Africa<BR>Tunisia</div>'
messages[1] = '<div class="puCaption">Americas incl. Caribbean</div><br>Antigua & Barbuda<BR>Argentina<BR>Bahamas<BR>Barbados<BR>Belize<BR>Bermuda<BR>Brazil<BR>Canada<BR>Cayman Islands<BR>Chile<BR>Columbia<BR>Cuba<BR>Dominican Rep.<BR>Ecuador<BR>Falkland Islands<BR>Guyana<BR>Jamaica<BR>Mexico<BR>Netherlands Antilles<BR>Panama<BR>Peru<BR>Saint Kitts & Nevis<BR>St. Vincent & Grenadines<BR>Trinidad & Tobago<BR>United States of America<BR>Venezuela<BR>Virgin Islands (British)</div>'
messages[2] = '<div class="puCaption">Eastern Europe & Central Asia</div><br>Azerbaijan, Rep. of<BR>Georgia<BR>Kazakhstan<BR>Latvia<BR>Russian Federation<BR>Ukraine</div>'
messages[3] = '<div class="puCaption">Far East</div><br>China, People’s Rep. of<BR>Hong Kong<BR>Indonesia<BR>Japan<BR>Malaysia<BR>Philippines<BR>Singapore, Rep. of<BR>Taiwan<BR>Thailand<BR>Vietnam</div>'
messages[4] = '<div class="puCaption">Indian Sub-Continent</div><br>Bangladesh<BR>India<BR>Maldives, Rep. of<BR>Sri Lanka</div>'
messages[5] = '<div class="puCaption">Middle East</div><br>Iran<BR>Israel<BR>Jordan<BR>Lebanon<BR>Saudi Arabia<BR>Syria<BR>United Arab Emirates</div>'
messages[6] = '<div class="puCaption">Northern Europe</div><br>Belgium<BR>France<BR>Germany<BR>Ireland, Rep. of<BR>Isle of Man<BR>Netherlands<BR>Switzerland<BR>United Kingdom</div>'
messages[7] = '<div class="puCaption">Pacific Ocean incl. Australasia</div><br>Australia<BR>Fiji<BR>French Polynesia<BR>Marshall Islands<BR>New Caledonia<BR>New Zealand<BR>Samoa<BR>Tonga</div>'
messages[8] = '<div class="puCaption">Scandinavia</div><br>Denmark<br>Iceland<br>Norway<br>Sweden</div>'
messages[9] = '<div class="puCaption">Southern Europe</div><br>Bulgaria<BR>Croatia, Rep. of<BR>Cyprus<BR>Gibraltar<BR>Greece<BR>Italy<BR>Malta<BR>Monaco<BR>Montenegro<BR>Portugal<BR>Romania<BR>Spain<BR>Turkey</div>'

messages[10] = '<div class="puCaption">Barge</div><br>Dry Barge<BR>Crane Barge<BR>Hopper Barge<BR>Tank Barge</div>'
messages[11] = '<div class="puCaption">Bulk Carrier</div><br> </div>'
messages[12] = '<div class="puCaption">Container</div><br> </div>'
messages[13] = '<div class="puCaption">Fishing</div><br>Beamer/Dredger<BR>Fishing<BR>Potter<BR>Trawler</div>'
messages[14] = '<div class="puCaption">General Cargo</div><br>General Cargo<BR>Combination Carriers<BR>Cargo/RoRo</div>'
messages[15] = '<div class="puCaption">Miscellaneous</div><br>Beamer/Dredger<BR>Buoy<BR>Cable<BR>Crane Ship<BR>Depot<BR>Diving Support<BR>Dredger<BR>Drilling<BR>Exhibition<BR>Floating Crane<BR>Icebreaker<BR>Landing Craft<BR>Lighthouse/Tender<BR>Livestock<BR>Maintenance<BR>Mining<BR>Offshore<BR>Patrol<BR>Pilot<BR>Pipe Carrier<BR>Pipe Layer<BR>Pontoon<BR>Research<BR>Semi-Submersible Pontoon<BR>Sludge Carrier<BR>Standby Safety Vessel<BR>Storage Barge<BR>Supply<BR>Support<BR>Tender<BR>Training Ship<BR>Vehicle<BR>Work Ship</div>'
messages[16] = '<div class="puCaption">Passenger</div><br>Ferry<BR>Hydrofoil<BR>Passenger<BR>Passenger/RoRo</div>'
messages[17] = '<div class="puCaption">Smoothwater</div><br>Barge<BR>Bulk/Oil<BR>Cargo/RoRo<BR>Cement Tanker<BR>Chemical Tanker<BR>Container Vessel<BR>Crane Vessel<BR>Dredger<BR>Dry Motor<BR>Dumb Dry<BR>Dumb Tank<BR>Ferry<BR>General Cargo<BR>Hopper<BR>Molasses Tanker<BR>Passenger<BR>Pipe Layer<BR>Pontoon<BR>Pusher Tug<BR>Sport Fishing<BR>Tank Motor<BR>Tender<BR>Tug</div>'
messages[18] = '<div class="puCaption">Tanker</div><br>Gas Carrier<BR>Tanker<BR>Tank Barge</div>'
messages[19] = '<div class="puCaption">Tug</div><br> </div>'
messages[20] = '<div class="puCaption">Yacht</div><br> </div>'

fromX = 50 //How much from the actual mouse X should the description box appear?
fromY = -20 //How much from the actual mouse Y should the description box appear?

//Makes crossbrowser object.
function makeObj(obj){								
   	this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
	if(!this.evnt) return false
	this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;	
   	this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;		
	this.writeIt=b_writeIt;																
	return this
}

// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

function b_writeIt(text){
	if (bw.ns4){this.wref.write(text);this.wref.close()}
	else this.wref.innerHTML = text
}

//Capturing mousemove
var descx = 0
var descy = 0
function popmousemove(e){descx=bw.ns4||bw.ns6?e.pageX:event.x; descy=bw.ns4||bw.ns6?e.pageY:event.y}

var oDesc;
//Shows the messages
function popup(num){
    if(oDesc){
		oDesc.writeIt('<div class="puDescription">'+messages[num]+'</div>')
		if(bw.ie5||bw.ie6||bw.ie7) descy = descy+document.body.scrollTop
		oDesc.css.left = (descx+fromX)+px
		oDesc.css.top = (descy+fromY)+px
		oDesc.css.visibility = "visible"
    }
}
//Hides it
function popout(){
	if(oDesc) oDesc.css.visibility = "hidden"
}
function setPopup(){
   	if(bw.ns4)document.captureEvents(Event.MOUSEMOVE)
    document.onmousemove = popmousemove;
	oDesc = new makeObj('divDescription')
}

