//	START DEFINE CLIENT BROWSER & VARIABLES
var isIE4 	= 	(document.all && !document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 4.0') != -1) ? true : false;
var isIE5 	= 	(document.all && document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 5.0') != -1) ? true : false;
var isIE55 	= 	(document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 5.5') != -1) ? true : false;
var isIE6 	= 	(document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 6.') != -1) ? true : false;
var isIE	=	(isIE4 || isIE5 || isIE55 || isIE6)
var isGecko = 	(!document.all && document.getElementById) ? true : false;
var isOP=(
		  (navigator.appName.indexOf('Opera') != -1)
		  ||(navigator.plugins.length>0 && navigator.appName.indexOf('Microsoft') != -1)
		  ||(!navigator.product && navigator.appName.indexOf('Netscape') != -1)
		  )
var  xVal=295,amount=20,horz,vert,docStyle,styleDoc,innerW,innerH,offsetX,offsetY,$leftMenu,$rightMenu;
var doTimer=null;
//	END DEFINE CLIENT BROWSER & VARIABLES


function setVariables(whichSite) {
if(whichSite==1)xVal=295;
if(whichSite==2)xVal=345;
if (navigator.appName == "Netscape" && navigator.userAgent.indexOf("Gecko")<=1 ) {
	amount=10;
	horz=".left";
	vert=".top";
	docStyle="document.";
	styleDoc="";
	innerW="window.innerWidth";
	innerH="window.innerHeight";
	offsetX="window.pageXOffset";
	offsetY="window.pageYOffset";
	$leftMenu="leftMenu";
	$rightMenu="rightMenu";
	}
if (document.all) {
	amount=10;
	horz=".pixelLeft";
	vert=".pixelTop";
	docStyle="";
	styleDoc=".style";
	innerW="document.body.clientWidth";
	innerH="document.body.clientHeight";
	offsetX="document.body.scrollLeft";
	offsetY="document.body.scrollTop";
	$leftMenu="leftMenu";
	$rightMenu="rightMenu";
   document.styleSheets[0].addRule("#navcontainer1 a" , "width : 100%");
	if(isIE4)
		{
		document.styleSheets[0].addRule("#navcontainer1 li" , "background-color : #DEF2F0");
		document.styleSheets[0].addRule("#navcontainer1 a" , "padding : 5px");
		}	
   }
if (navigator.userAgent.indexOf("Gecko")>0) {
	amount=20;
	horz=".left";
	vert=".top";
	docStyle="document.getElementById";
	styleDoc=".style";
	innerW="window.innerWidth";
	innerH="window.innerHeight";
	offsetX="window.pageXOffset";
	offsetY="window.pageYOffset";
	$leftMenu="leftMenu";
	$rightMenu="rightMenu";
	}
}

function checkLocation() {
clearTimeout(doTimer);

y=offsetY;
thisLeftMenu=MM_findObj("leftMenu");
thisRightMenu=MM_findObj("rightMenu");
if(thisLeftMenu && thisRightMenu)
	{
	if(parseInt(thisLeftMenu.style.top)<parseInt(eval(y)-xVal)){
		if(parseInt(eval(y))>xVal) {
			if ((thisLeftMenu.clientHeight + thisLeftMenu.offsetTop + thisLeftMenu.offsetParent.offsetTop) < (document.all.tbl1.clientHeight - 35))
			{
				thisLeftMenu.style.top=parseInt(thisLeftMenu.style.top)+amount;
			}
			if ((thisRightMenu.clientHeight + thisRightMenu.offsetTop + thisRightMenu.offsetParent.offsetTop) < (document.all.tbl1.clientHeight - 35))
			{
				thisRightMenu.style.top=parseInt(thisRightMenu.style.top)+amount;
			}
		}
	}
	if(parseInt(thisLeftMenu.style.top)>parseInt(eval(y)-xVal)){
		if(parseInt(thisLeftMenu.style.top)-(amount) >parseInt(eval(y)-xVal)){ 
			if(parseInt(eval(y))>xVal){
				thisLeftMenu.style.top=parseInt(thisLeftMenu.style.top)-amount;
				thisRightMenu.style.top=parseInt(thisRightMenu.style.top)-amount;
				}
			}else{
				if(eval(y)==0 || eval(y)<xVal ) {
					thisLeftMenu.style.top=0;
					thisRightMenu.style.top=0;
					}
				}
		}
	if(parseInt(thisLeftMenu.style.top)==(0) || eval(y)==0 || eval(y)<xVal){
		thisLeftMenu.style.top=0;
		thisRightMenu.style.top=0;
		}
	}
	//document.all.xy.innerHTML = thisRightMenu.clientHeight + thisRightMenu.offsetTop + thisRightMenu.offsetParent.offsetTop + ", " + thisRightMenu.offsetTop + "<BR>"
	//document.all.xy.innerHTML += document.body.offsetHeight + thisRightMenu.style.top + ", " + thisRightMenu.offsetParent.offsetTop + "," + thisRightMenu.clientHeight + ", " + document.body.clientHeight;
	//document.all.xy.innerHTML += "<BR>" + document.body.offsetHeight + ", " + thisRightMenu.style.top + ", " + thisRightMenu.offsetParent.offsetTop + ", " + document.all.tbl1.clientHeight   + ", " + thisLeftMenu.style.top;
doTimer=setTimeout("checkLocation()",1);	
//setTimeout("checkLocation()",1);
}

function checkLocationLeftOnly() {
clearTimeout(doTimer);
y=offsetY;
thisLeftMenu=MM_findObj("leftMenu");
if(thisLeftMenu)
	{
	if(parseInt(thisLeftMenu.style.top)<parseInt(eval(y)-xVal)){
		if(parseInt(eval(y))>xVal) {
			thisLeftMenu.style.top=parseInt(thisLeftMenu.style.top)+amount;
			}
		}
	if(parseInt(thisLeftMenu.style.top)>parseInt(eval(y)-xVal)){
		if(parseInt(thisLeftMenu.style.top)-(amount) >parseInt(eval(y)-xVal)){ 
			if(parseInt(eval(y))>xVal){
				thisLeftMenu.style.top=parseInt(thisLeftMenu.style.top)-amount;
				}
			}else{
				if(eval(y)==0 || eval(y)<xVal ) {
					thisLeftMenu.style.top=0;
					}
				}
		}
	if(parseInt(thisLeftMenu.style.top)==(0) || eval(y)==0 || eval(y)<xVal){
		thisLeftMenu.style.top=0;
		}
	}


doTimer=setTimeout("checkLocation()",1);	
//setTimeout("checkLocation()",1);
}

function BP(p,d)
{
	if(p>=pix.length)p=0;
	if(d>2)d=0;
	var c=C0;
	if(1==d)c=C1;
	else if(2==d)c=C2;
	if(! isIE4 && !isIE5) c.filters(0).apply();
	var im=pix[p]?pix[p]:"none";
	c.style.backgroundImage='url('+im+')';
	if(! isIE4 && !isIE5) c.filters(0).play();
	if(! isIE4 && !isIE5) G0.filters(0).apply();
	if(C0.style.backgroundImage!='url(none)' || C1.style.backgroundImage!='url(none)')G0.style.backgroundColor="#FFFFFF"; else G0.style.backgroundColor=''; 
	if(! isIE4 && !isIE5) G0.filters(0).play();
	if(! isIE4 && !isIE5) G1.filters(0).apply();
	if(C1.style.backgroundImage!='url(none)' || C2.style.backgroundImage!='url(none)')G1.style.backgroundColor="#FFFFFF"; else G1.style.backgroundColor=''; 
	if(! isIE4 && !isIE5) G1.filters(0).play();
	p++;d++;setTimeout("BP("+p+","+d+")",4000);
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}

/*******************************************************************************
	REX Dynamic Menus
	Nigel Francois
	http://www.intronet.me.uk
*******************************************************************************/	
//	AFRICA
function africaMenu(level)
{
if(level==1)$prefix='';
if(level==2)$prefix='../';
if(level==3)$prefix='../../';

menuTxt=""+
"<div id='kenya' style='position:absolute; width:252; height:54; z-index:999; visibility: hidden;'> "+
"  <table width='252' style='height:54px' border='0' cellpadding='0' cellspacing='0'> "+
"    <tr> "+
"      <td class='ddlinkTop'><a href='"+($prefix)+"_mombasa/index.html' class='topnav'>Mombasa</a><\/td> "+
"    <\/tr> "+
"    <tr> "+
"      <td class='ddlink'><a href='"+($prefix)+"_nairobi/index.html' class='topnav'>Nairobi</a><\/td> "+
"    <\/tr> "+
"  <\/table> "+
"<\/div> "+
"<div id='tanzania' style='position:absolute; width:252; height:54; z-index:999; visibility: hidden;'> "+
"  <table width='252' style='height:54px' border='0' cellpadding='0' cellspacing='0'> "+
"    <tr> "+
"      <td class='ddlinkTop'><a href='"+($prefix)+"_ntanzania/index.html' class='topnav'>Northern Tanzania</a><\/td> "+
"    <\/tr> "+
"    <tr> "+
"      <td class='ddlink'><a href='"+($prefix)+"_stanzania/index.html' class='topnav'>Southern Tanzania</a><\/td> "+
"    <\/tr> "+
"  <\/table> "+
"<\/div> "+
"";
document.write(menuTxt);
}

function doMenu(level)
{
if(level==1)$prefix='';
if(level==2)$prefix='../';
if(level==3)$prefix='../../';
if(level==4)
{
$prefix='../_caribbean/';
writeResortMenu('antigua',level,$prefix,2);writeResortMenu('barbados',level,$prefix,2);writeResortMenu('grenada',level,$prefix,2);writeResortMenu('stlucia',level,$prefix,2);writeResortMenu('tobago',level,$prefix,2);
return;
}

writeMenu('antigua',level,$prefix);writeResortMenu('antigua',level,$prefix,1);writeInfoMenu('antigua',level,$prefix)
writeMenu('barbados',level,$prefix);writeResortMenu('barbados',level,$prefix,1);writeInfoMenu('barbados',level,$prefix)
writeMenu('grenada',level,$prefix);writeResortMenu('grenada',level,$prefix,1);writeInfoMenu('grenada',level,$prefix)
writeMenu('stlucia',level,$prefix);writeResortMenu('stlucia',level,$prefix,1);writeInfoMenu('stlucia',level,$prefix)
writeMenu('tobago',level,$prefix);writeResortMenu('tobago',level,$prefix,1);writeInfoMenu('tobago',level,$prefix)
}

function writeMenu(area,level,$prefix)
{
$leftPos=125;
if(area=='tobago')$leftPos=-125;
menuTxt=""+
"<div id='"+(area)+"Menu' style='border:solid 1px #666666; border-top:none;border-bottom:none;position:absolute; width:126px; height:50px; z-index:999; visibility: hidden;'>"+
"<table class='divTable' border='0' cellpadding='0' cellspacing='0'>"+
"<tr>"+
"<td class='divlink'><a href='#' class='topnav' onMouseOver=\"dmxFLG1('"+(area)+"SubMenu',1,1,'"+(area)+"Menu',2,'"+(area)+"Menu',0,"+($leftPos)+",0,0,0,0,0,0,0,0,0,0,0)\">resorts<\/a><\/td>"+
"<\/tr>"+
"<tr>"+
"<td class='divlink'><a href='#' class='topnav' onMouseOver=\"dmxFLG1('"+(area)+"SubMenuInfo',1,1,'"+(area)+"Menu',2,'"+(area)+"Menu',0,"+($leftPos)+",24,0,0,0,0,0,0,0,0,0,0)\">island info<\/a><\/td>"+
"<\/tr>"+
"<\/table>"+
"<\/div>"+
"";
document.write(menuTxt);
}

function writeInfoMenu(area,level,$prefix)
{
infoMenuTxt=""+
"<div id='"+(area)+"SubMenuInfo' style='border:solid 1px #666666; border-top:none;border-bottom:none;position:absolute; width:126px; height:50px; z-index:999; visibility: hidden;'>"+
"<table class='divTable' border='0' cellpadding='0' cellspacing='0'>"+
"<tr>"+
"<td class='divlink'><a href='"+($prefix)+"_"+(area)+"/index.html' class='topnav'>overview<\/a><\/td>"+
"<\/tr>"+
"<tr>"+
"<td class='divlink'><a href='"+($prefix)+"_"+(area)+"/things_to_do.html' class='topnav'>things to see<\/a><\/td>"+
"<\/tr>"+
"<\/table>"+
"<\/div>";
document.write(infoMenuTxt);
}

function writeResortMenu(area,level,$prefix,$filename)
{
if($filename==1){$filename='index'}else{$filename='weddings'}
//Blue Heron is to be closed for a year (today=24/02/2009); set $divHeight=75 if is to be re-included
if(area=='antigua')$divHeight=50;
if(area=='barbados')$divHeight=25;
if(area=='grenada')$divHeight=25;
if(area=='stlucia')$divHeight=50;
if(area=='tobago')$divHeight=25;

resortMenuTxt=""+
"<div id='"+(area)+"SubMenu' style='border:solid 1px #666666; border-top:none;border-bottom:none;position:absolute; width:126px; height:"+($divHeight)+"px; z-index:999; visibility: hidden;'>"+
"<table class='divTable' border='0' cellpadding='0' cellspacing='0'>";

if(area=='antigua')
{
resortMenuTxt+=""+
"<tr>"+
"<td class='divlink'><a href='"+($prefix)+"_"+(area)+"/_halcyon_cove/"+($filename)+".html' class='topnav'>halcyon cove<\/a><\/td>"+
"<\/tr>"+
"<tr>"+
"<td class='divlink'><a href='"+($prefix)+"_"+(area)+"/_hawksbill_beach/"+($filename)+".html' class='topnav'>hawksbill<\/a><\/td>"+
//Blue Heron is to be closed for a year (today=24/02/2009); re-instate these lines if is to be re-included
//"<\/tr>"+
//"<tr>"+
//"<td class='divlink'><a href='"+($prefix)+"_"+(area)+"/_blue_heron/"+($filename)+".html' class='topnav'>blue heron<\/a><\/td>"+
"<\/tr>";
}

if(area=='barbados')
{
resortMenuTxt+=""+
"<tr>"+
"<td class='divlink'><a href='"+($prefix)+"_"+(area)+"/_discovery_bay/"+($filename)+".html' class='topnav'>discovery bay<\/a><\/td>"+
"<\/tr>";
}

if(area=='grenada')
{
resortMenuTxt+=""+
"<tr>"+
"<td class='divlink'><a href='"+($prefix)+"_"+(area)+"/_grenadian/"+($filename)+".html' class='topnav'>grenadian<\/a><\/td>"+
"<\/tr>";
}

if(area=='stlucia')
{
resortMenuTxt+=""+
"<tr>"+
"<td class='divlink'><a href='"+($prefix)+"_"+(area)+"/_royal/"+($filename)+".html' class='topnav'>royal<\/a><\/td>"+
"<\/tr>"+
"<tr>"+
"<td class='divlink'><a href='"+($prefix)+"_"+(area)+"/_stlucian/"+($filename)+".html' class='topnav'>st lucian<\/a><\/td>"+
"<\/tr>";
}

if(area=='tobago')
{
resortMenuTxt+=""+
"<tr>"+
"<td class='divlink'><a href='"+($prefix)+"_"+(area)+"/_turtle_beach/"+($filename)+".html' class='topnav'>turtle beach<\/a><\/td>"+
"<\/tr>";
}

resortMenuTxt+=""+
"<\/table>"+
"<\/div>";
document.write(resortMenuTxt);
}