var tt = new Array(

['',''],
['Areas Served','areas'],
['Stores','stores'],
['Dive Trips','charters'],
['Equipment','equipment'],
['Fills','fills'],
['Scuba Training','instruction'],
['Lodging','travel'],
['News','news'],
['Dive Sites','sites'],
['Contact','contact']
);


var dd_areas = new Array(
['/areas_served/singer_island_florida.shtml','Singer Island'],
['/areas_served/north_palm_beach_florida.shtml','North Palm Beach'],
['/areas_served/riviera_beach_florida.shtml','Riviera Beach'],
['/areas_served/palm_beach_florida.shtml','Palm Beach'],
['/areas_served/west_palm_beach_florida.shtml','West Palm Beach'],
['/areas_served/delray_beach_florida.shtml','Delray Beach'],
['/areas_served/boca_raton_florida.shtml','Boca Raton'],
['/areas_served/deerfield_beach_florida.shtml','Deerfield Beach'],
['/areas_served/pompano_beach_florida.shtml','Pompano Beach'],
['/areas_served/fort_lauderdale_beach_florida.shtml','Ft. Lauderdale Beach'],
['/areas_served/south_florida_florida.shtml','South Florida']
);

var dd_stores = new Array(
['/stores/singer_island_scuba_center.shtml','Singer Island'],
['/stores/riviera_beach_scuba_center.shtml','Riviera Beach'],
['/stores/palm_beach_scuba_center.shtml','Palm Beach'],
['/stores/west_palm_beach_scuba_center.shtml','West Palm Beach'],
['/stores/boca_raton_scuba_center.shtml','Boca Raton'],
['/stores/pompano_beach_scuba_center.shtml','Pompano Beach'],
['/stores/fort_lauderdale_scuba_center.shtml','Fort Lauderdale'],
['/stores/south_florida_scuba_center.shtml','South Florida']
);

var dd_charters = new Array(
['/boats/riviera_beach_boat_charters.shtml','Riviera Beach'],
['/boats/west_palm_beach_boat_charters.shtml','West Palm Beach'],
['/boats/boynton_beach_boat_charters.shtml','Boynton Beach'],
['/boats/boca_and_delray_beach_boat_charters.shtml','Boca Raton'],
['/boats/deerfield_beach_boat_charters.shtml','Deerfield Beach'],
['/boats/pompano_beach_boat_charters.shtml','Pompano Beach'],
['/boats/ft.lauderdale_boat_charters.shtml','Ft. Lauderdale']
);

var dd_equipment = new Array(
['/equipment/rental_gear.shtml','Rentals'],
['/equipment/equipment_brands.shtml','Brands'],
['/equipment/equipment_sales.shtml','Sales'],
['/equipment/equipment_service.shtml','Service']
);

var dd_fills = new Array(
['/fills/air.shtml','Air'],
['/fills/air.shtml','Nitrox']
);

var dd_instruction = new Array(
['/instruction/instruction.shtml','1st Step - Scuba Lessons'],
['/instruction/online.shtml','Online Academics'],
['/instruction/referral.shtml','Referrals to Complete'],
['/instruction/dive_today.shtml','Go Diving Today'],
['/instruction/refresher.shtml','Refresher Course'],
['/instruction/advancedOW.shtml','Advanced Open Water '],
['/instruction/nitrox.shtml','Nitrox Diver'],
['/instruction/special_interest.shtml','Special Interest Training'],
['/instruction/leadership.shtml','Leadership Training'],
['/instruction/technical.shtml','Technical Training'],
<!--['/instruction/agencies.shtml','SSI-PADI-SDI-NAUI-YMCA'],-->
['/instruction/history.shtml','History of Scuba Diving']
);

var dd_travel = new Array(
['/travel/travel.shtml','Delray to Deerfield Beach'],
['/travel/travel_PB.shtml','N Palm Beach to W Palm Beach'],
['/travel/travel_pompano.shtml','Pompano Beach to Ft. Lauderdale']
);

var dd_news = new Array(
['/news/news.shtml','News']
);

var dd_sites = new Array(
['/dive_sites/beach_diving_sites/beach_diving_sites.shtml','Beach Dive Sites'],
['/dive_sites/boat_diving_sites/boat_diving_sites.shtml','Boat Dive Sites'],
['/dive_sites/wreck_diving_sites/wreck_diving_sites.shtml','Wreck Dive Sites'],
['/dive_sites/boat_diving_sites/bimini.shtml','Bimini']
);
   
var dd_contact = new Array(
['/contact_us/contact_us.shtml','Contact Us']
);

// ------------------------------------------------------------------
// DO NOT CHANGE BELOW THIS LINE (unless you know what you are doing)
// ------------------------------------------------------------------

var IE = (document.all) ? 1 : 0;
var DOM = ((document.getElementById)&&(!IE)) ? 1 : 0;
var NS4 = (document.layers) ? 1 : 0;
var isOver = false;
var timer = null;
var cmTop = 0;
var cmLeft = 0;

// NS4 redraw on resize
if (NS4) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	}

function reDo() {
	if (innerWidth != origWidth || innerHeight != origHeight) {
		location.reload();
		}
	}

if (NS4) onresize = reDo;

document.write("<div id=\"gnddhome\"></div>");
	
//build dropdowns
for ( i = 1 ; i < tt.length ; i++ ) {	// runs it threw the loop
	var ff = eval("dd_" + tt[i][1]);	// runs threw and sets the dd_ array # and the first variable in the array.	
	var divNum = "gndd" + tt[i][1];		// runs threw and sets the dd_ array # and the Second variable in the array.	
	var strDiv = "<div class=\"dropdowndiv\" id=\"" + divNum + "\" onMouseOver=\"OverLayer();\" onMouseOut=\"OutLayer('"+ divNum + "');\">";
	strDiv = strDiv + "<table cellspacing=1 cellpadding=1 bgcolor=black border=0><tr valign=top><td nowrap class=dropdown width=180>";	
	strDiv = strDiv + "&nbsp\;&nbsp\;&nbsp\;<b>" +tt[i][0] +"</b><br>"
	for ( j = 0 ; j < ff.length ; j++ ) {   // runs it threw the loop
		var linkString = new String(ff[j][0]);  // Url String going threw the loop starting at 0 
		if (linkString.indexOf('http:') == -1) ff[j][0] = "" + ff[j][0];  //******
		strDiv = strDiv +'&nbsp\;&nbsp\;&nbsp\;<a href=\"'  +ff[j][0] +'\">' + ff[j][1] + '</a><br>'; // writes out the actual links.
	}
	strDiv = strDiv + "<div class=spacer5>&nbsp\;</div></td></tr></table></div>\n";	// makes the ending of the table.
	document.write(strDiv);
}
// end dropdowns

	
function InitObj() {
	for (i = 1; i < tt.length; i++) { 
		whichEl = "gndd" + tt[i][1];
		if (DOM) {whichEl = document.getElementById(whichEl);}
		else {whichEl = (NS4) ? document.layers[whichEl] : document.all[whichEl].style;} 
		whichEl.onmouseover = OverLayer;
		whichEl.onmouseout = OutLayer;
		}
	}

InitObj();

function ShowLayer(showEl,event) {
	if (showEl == "gnddhome") return;
	clearTimeout(timer);
	HideAllLayers();
	
	if (DOM) {var whichEl = document.getElementById(showEl);}
	else {var whichEl = (NS4) ? document.layers[showEl] : document.all[showEl].style;}
	
//POSITIONING OF DIVS	
	whichAnchor = showEl + "A";	  //this area set the div into position.  showEl is the name ex. gnddnfl + A =  gnddnflA
	if (DOM){
		if (document.anchors[whichAnchor]){
			var myObject = document.anchors[whichAnchor];
			while (myObject.offsetParent) {
				cmTop  = cmTop  + myObject.offsetTop;
				cmLeft = cmLeft + myObject.offsetLeft;
				myObject = myObject.offsetParent
				}
			}
		}
	else if (IE) {										// if you are IE the do this
		if (document.all[whichAnchor]){	// is whichAnchor, which is showEl at the point of show 
			cmTop = findy(document.all[whichAnchor]) + 20;   //then go ahead and set it 20 from top 
			cmLeft = findx(document.all[whichAnchor]) - 20;   
			}
		}
	else if (NS4) {
		if (document.anchors[whichAnchor]) {
			cmTop = document.anchors[whichAnchor].y + 20;
			cmLeft = document.anchors[whichAnchor].x - 20;
			}
		}

	if (DOM) {
		whichEl.style.visibility = "visible";
		whichEl.style.top = cmTop + 20;
		if (showEl != 'gnddmore' && showEl) {
			if (cmLeft > 550) cmLeft = 587;
			}
		whichEl.style.left = cmLeft;		
		}
	else {	
		whichEl.visibility = "visible";
		whichEl.top = cmTop;
		if (showEl != 'gnddmore' && showEl) {
			if (cmLeft > 550) cmLeft = 587;
			}
		whichEl.left = cmLeft;
		} 	
	cmTop = 0; cmLeft = 0;
	}

function findy(item) {
	if (item.offsetParent) {return item.offsetTop + findy(item.offsetParent);}
	else {return item.offsetTop;}
	}

function findx(item) {
	if (item.offsetParent) {
		return item.offsetLeft + findx(item.offsetParent);
	}
	else {
		return item.offsetLeft;
	}
}

//End of POSITIONING

function HideAllLayers() {
	if (DOM) {
		var divTemp = document.getElementsByTagName('div');
		for (i = 0; i < divTemp.length; i++) { 
			var divString = new String(divTemp[i].id);
			if (divString.indexOf('gndd') != -1) divTemp[i].style.visibility = "hidden";
			}
		return;
		}	
	else if (IE) {
		var divTemp = document.all.tags("div");
		for (i = 0; i < divTemp.length; i++) { 
			var divString = new String(divTemp[i].id);
			if (divString.indexOf('gndd') != -1) divTemp[i].style.visibility = "hidden";
			}
		return;
		}
	else if (NS4) {
		for (i = 0; i < document.layers.length; i++) { 
			var divString = new String(document.layers[i].name);
			if (divString.indexOf('gndd') != -1) document.layers[i].visibility = "hidden";
			}
		return;
		}
	}

function OverLayer() {
	clearTimeout(timer); 
	isOver = true;
	}

function OutLayer() {  // so  when the mouse is off the SPOT, then set time out make variable isOver set False and set time to execute 
	clearTimeout(timer);   //function HideAllLayers  in 300 microseconds.
	isOver = false; 
	timer = setTimeout("HideAllLayers()",300);
	}