// EDIT THESE VARIABLES TO CHANGE MENUS AND TICKER ITEMS


	
// create option arrays, format is: option = new Array("Displayed Text","style","target page");
// style is either "menu", "sub", or "hot"; 
	var op1 = new Array("Accommodations","menu","accom/accom.html"); 
	var op2 = new Array("Powerboat Charters","menu","power/index.html");
	var op3 = new Array("Fishing Charters","menu","fish/fish_menu.html");
	var op4 = new Array("Sailing Charters","menu","sail/index.html");
	var op5 = new Array("BVI Charters","menu","bvi/index.html");
	var op6 = new Array("SCUBA Charters","menu","scuba/scuba_menu.html");
	var op7 = new Array("Watersports","menu","watersports/watersports_menu.html");
	var op8 = new Array("Eco Activities","menu","eco/eco_menu.html");
	var op9 = new Array("Restaurants","menu","restaurants/index.html");
	var op10 = new Array("Shopping &amp; Duty Free","menu","shopping/index.html");
	var op11 = new Array("Transportation","menu","transportation/index.html");
	var op12 = new Array("Weddings","menu","weddings/wedding_menu.html");
	var op13 = new Array("Real Estate","menu","realestate/realestatemenu.html");
	var op14 = new Array("Term Charters","menu","termcharters/index.html");
	var op15 = new Array("Maps","menu","maps/stjohn.html");
	var op16 = new Array("Feedback","menu","feedback/index.html");
	
// how many options are there?
	var opnum = 16;
	
// how many cells in a row for horizontal menus?
	var breakat = 4;


///////// ================= DO NOT EDIT BELOW THIS LINE! ====================
	
///////// ------------------------------------- MENU WRITERS

  ns4 = (document.layers)? true:false
  ie4 = (document.all)? true:false
	
// function writes local specials

function writespecials() {
	for (var i = 1 ; i <= specials ; i++) {
		temp = eval("special" + i);
		document.write('<tr><td class="special" colspan="' + breakat + '">' + temp + '</td></tr>');
	}
}


// function writes vertical menus
function writemenu() {
// code blocks
	var c1 = "&gt; ";

	// write options
	for (var i = 1 ; i<= opnum ; i++) {
		thisop = eval("op" + i);
		//alert(thisop);
			document.write('<tr><td class="' + thisop[1] + '">' + c1 + '<a href="../' + thisop[2] + '">' + thisop[0] + '</td></tr>');	
	}
}


// function writes horizontal menus
function hmenu() {
// code blocks
	var c1 = "&gt; ";
	//c1=" ";
	cells = 0;
	blanks = 0;
	if (opnum%breakat != 0) {
		blanks = ((Math.floor(opnum/breakat) + 1) * breakat) - opnum;
	}
	// write row
	document.write('<tr>');
	// write cells for each menu item
	for (var i = 1 ; i<= opnum ; i++) {
		thisop = eval("op" + i);
		document.write('<td class="' + thisop[1] + '">' + c1 + '<a href="../' + thisop[2] + '">' + thisop[0] + '</td>');	
		cells += 1;
		if (cells%breakat == 0 && cells != opnum) {
			document.write('</tr><tr>');
		} else if (cells%breakat == 0 && cells == opnum){
			document.write('</tr>');
		}
	}
	// write blank cells necessary to complete rows
	if (blanks > 0 ) {
		for (var i = 1 ; i<= blanks; i++) {
			document.write('<td class="menu">&nbsp;</td>');
			cells += 1;
			if (cells%breakat == 0) {
				document.write('</tr>');
			}	
		}
	}
	// write special offers (separate function now...)
	
}



// Function for style display visibility toggling of named div elements
function cview(listID) {
		// find object in document
		if (document.layers) {
			myobj = document.layers[listID];
		} else if (document.all) {
			myobj = listID;
		}
		// toggle visibility
		if (myobj.style.display=="none") {
            myobj.style.display="";
        } else {
            myobj.style.display="none";
        }
}

///////// ------------------------------------- TICKER


topedge = 25;  // location of news box from top of page
leftedge = 200;  // location of news box from left edge
boxheight = 60;  // height of news box
boxwidth = 350;  // width of news box
scrollwidth = 500; // total width of all data to be scrolled: this will change as text is added or deleted >> DEPRECATED, see below


function tick(clipleft) {
if (document.layers) {
newsDiv = document.ticker;
newsDiv.clip.top = 0;
newsDiv.clip.bottom = boxheight;
newsDiv.clip.left = 0;
newsDiv.clip.right = boxwidth + leftedge;
newsDiv.left = leftedge - clipleft;
newsDiv.top = topedge;
}
else {
newsDiv = ticker.style;
newsDiv.clip = "rect(" + 0 + "px " + (boxwidth + clipleft) + "px " + boxheight + "px " + clipleft + "px)";
newsDiv.pixelLeft = leftedge - clipleft;
newsDiv.pixelTop = topedge;
}
clipleft = (clipleft + 1) % (scrollwidth + boxwidth);
//newsDiv.visibility='visible';
setTimeout("tick(" + clipleft + ")",tickspeed);
}

// following code writes the ticker contents by looping through the requested number of ticker items and including them and their links in a text string
homepage = document.URL.indexOf('index.html');


tickercontents = " ................ ";
scrollwidth = 70;
for (var i = 1 ; i <= tickers ; i++) {
	temp = eval("ticker" + i);
	text = temp[0];
	link = temp[1];
	if (homepage >0) {
		link = link.substr(3);
	}
	seglength = text.length;
	scrollwidth = scrollwidth + (3.9*seglength) + 30;
	tickercontents = tickercontents + '<a href=\"' + link + '\">' +text + '</a>' +" ...... ";
}
scrollwidth = Math.round(scrollwidth);

// code for layer for ticker, including positioning variables and contents
tickdiv ='<div id=\"ticker\" style=\"position:absolute; top:' + topedge + 'px; left:' + leftedge + 'px;  border-width:0px;  z-index:1\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td nowrap class=\"ticker\">' + tickercontents +'</td> </tr> </table></div>'

// write in ticker layer
document.write(tickdiv);
//tick(0);


// ---------------------- Pop images

function popimg(tarimg) {
	tar = "photo.html?" + tarimg;
	viewer = window.open(tar,"Viewer")
}


//

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}


