<!--       TIPSTER v3.0        -->
<!--     by Angus Turnbull      -->
<!--  http://www.twinhelix.com  -->
<!--   Visit for more scripts!  -->

var isDOM=document.getElementById?1:0;
var isIE=document.all?1:0;
var isNS4=navigator.appName=='Netscape'&&!isDOM?1:0;
var isOp=window.opera?1:0;
var isWin=navigator.platform.indexOf('Win')!=-1?1:0;
var isDyn=isDOM||isIE||isNS4;

function getRef(id, par)
{
 par=!par?document:(par.navigator?par.document:par);
 return isIE ? par.all[id] :
  (isDOM ? (par.getElementById?par:par.ownerDocument).getElementById(id) :
  (isNS4 ? par.layers[id] : null));
}

function getSty(id, par)
{
 var r=getRef(id, par);
 return r?(isNS4?r:r.style):null;
}

if (!window.LayerObj) var LayerObj = new Function('id', 'par',
 'this.ref=getRef(id, par); this.sty=getSty(id, par); return this');
function getLyr(id, par) { return new LayerObj(id, par) }

function LyrFn(fn, fc)
{
 LayerObj.prototype[fn] = new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px"; ' +
  'with (this) { '+fc+' }');
}
LyrFn('x','if (!isNaN(p)) sty.left=p+px; else return parseInt(sty.left)');
LyrFn('y','if (!isNaN(p)) sty.top=p+px; else return parseInt(sty.top)');
LyrFn('w','if (p) (isNS4?sty.clip:sty).width=p+px; ' +
 'else return (isNS4?ref.document.width:ref.offsetWidth)');
LyrFn('h','if (p) (isNS4?sty.clip:sty).height=p+px; ' +
 'else return (isNS4?ref.document.height:ref.offsetHeight)');
LyrFn('vis','sty.visibility=p');
LyrFn('write','if (isNS4) with (ref.document){write(p);close()} else ref.innerHTML=p');
LyrFn('alpha','var f=ref.filters,d=(p==null); if (f) {' +
 'if (!d&&sty.filter.indexOf("alpha")==-1) sty.filter+=" alpha(opacity="+p+")"; ' +
 'else if (f.length&&f.alpha) with(f.alpha){if(d)enabled=false;else{opacity=p;enabled=true}} }' +
 'else if (isDOM) sty.MozOpacity=d?"":p+"%"');

var CSSmode=document.compatMode;
CSSmode=(CSSmode&&CSSmode.indexOf('CSS')!=-1)||isDOM&&!isIE||isOp?1:0;

if (!window.page) var page = { win: window, minW: 0, minH: 0, MS: isIE&&!isOp,
 db: CSSmode?'documentElement':'body' }

page.windW=function()
 { with (this) return Math.max(minW, MS?win.document[db].clientWidth:win.innerWidth) }
page.windH=function()
 { with (this) return Math.max(minH, MS?win.document[db].clientHeight:win.innerHeight) }

page.scrollY=function()
 { with (this) return MS?win.document[db].scrollTop:win.pageYOffset }
page.scrollX=function()
 { with (this) return MS?win.document[db].scrollLeft:win.pageXOffset }

function tipTrack(evt, always) { with (this)
{
 evt=evt?evt:window.event;
 sX = page.scrollX();
 sY = page.scrollY();
 mX = isNS4 ? evt.pageX : sX + evt.clientX;
 mY = isNS4 ? evt.pageY : sY + evt.clientY;
 if (tipStick == 1) position();
}}

function tipPosition(forcePos) { with (this)
{
 if (!actTip) return;
 var wW = page.windW()-(isIE?0:15), wH = page.windH()-(isIE?0:15);
 var t=tips[actTip], tipX=eval(t[0]), tipY=eval(t[1]), tipW=div.w(), tipH=div.h(), adjY = 1;
 if (typeof(t[0])=='number') tipX += mX;
 if (typeof(t[1])=='number') tipY += mY;
 if (tipX + tipW + 10 > sX + wW) { tipX = sX + wW - tipW - 10; adjY = 2 }
 if (tipY + tipH + 10 > sY + wH) tipY = sY + wH - (adjY*tipH) - 10;
 if (tipX < sX+ 10) tipX = sX + 10;
 if (tipY < sY + 10) tipY = sY + 10;
 if ((!showTip && (doFades ? !alpha : true)) || forcePos)
 {
  xPos = tipX;
  yPos = tipY;
 }
 xPos += (tipX - xPos) * tipStick;
 yPos += (tipY - yPos) * tipStick;
 div.x(xPos);
 div.y(yPos);
}}

function tipShow(tipN) { with (this)
{
 if (!isDyn) return;
 if (tips[tipN].parentObj) tips[tipN].parentObj.show(tips[tipN].parentTip);
 if (!div) div = getLyr(myName + 'Layer');
 if (isDOM) div.sty.width = 'auto';
 if (actTip != tipN)
 {
  actTip = tipN;
  if (tipStick == 0)
  {
   if (isNS4) div.ref.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
   div.ref.onmouseover = new Function('evt', myName + '.show("' + tipN + '"); ' +
    'if (isNS4) return this.routeEvent(evt)');
   div.ref.onmouseout = new Function('evt', myName + '.hide(); ' +
   'if (isNS4) return this.routeEvent(evt)');
  }
  position(true);
  var str = template;
  for (var i=0; i<tips[tipN].length; i++) str = str.replace('%'+i+'%', tips[tipN][i]);
  div.write(str + ((document.all && !isWin) ? '<small><br></small>' : ''));
 }
 clearInterval(trackTimer);
 if (tipStick != parseInt(tipStick)) trackTimer = setInterval(myName+'.position()', 50);
 clearTimeout(fadeTimer);
 if (showDelay || isNS4)
  fadeTimer = setTimeout('with ('+myName+') { showTip = true; fade() }', showDelay + 10);
 else { showTip = true; fade() }
}}

function tipHide() { with (this)
{
 if (!isDyn || !actTip) return;
 if (isNS4 && tipStick==0 && xPos<=mX && mX<=xPos+div.w() && yPos<=mY && mY<=yPos+div.h())
  return;
 if (tips[actTip].parentObj) tips[actTip].parentObj.hide();
 clearTimeout(fadeTimer);
 fadeTimer = setTimeout('with (' + myName + ') { showTip=false; fade() }', hideDelay);
}}

function tipFade() { with (this)
{
 clearTimeout(fadeTimer);
 if (showTip)
 {
  div.vis('visible');
  if (doFades)
  {
   alpha += fadeSpeed;
   if (alpha > maxAlpha) alpha = maxAlpha;
   div.alpha(alpha);
   if (alpha < maxAlpha) fadeTimer = setTimeout(myName + '.fade()', 50);
  }
 }
 else
 {
  if (doFades && alpha > minAlpha)
  {
   alpha -= fadeSpeed;
   if (alpha < minAlpha) alpha = minAlpha;
   div.alpha(alpha);
   fadeTimer = setTimeout(myName + '.fade()', 50);
   return;
  }
  div.vis('hidden');
  actTip = '';
  clearInterval(trackTimer);
 }
}}

function TipObj(myName)
{
 this.myName = myName;
 this.tips = new Array();
 this.template = '';
 this.actTip = '';
 this.showTip = false;
 this.tipStick = 1;
 this.showDelay = 30;
 this.hideDelay = 250;
 this.xPos = this.yPos = this.sX = this.sY = this.mX = this.mY = 0;
 this.track = tipTrack;
 this.position = tipPosition;
 this.show = tipShow;
 this.hide = tipHide;
 this.fade = tipFade;
 this.div = null;
 this.trackTimer = this.fadeTimer = 0;
 this.alpha = 0;
 this.doFades = true;
 this.minAlpha = 0;
 this.maxAlpha = 100;
 this.fadeSpeed = 15;
}

var docTips = new TipObj('docTips');
with (docTips)
{

 tips.samples = new Array(5, 15, 140, '<FONT color="white" size="2"><center>This is only a sample; click for the full article</center>');
 tips.news = new Array(5, 5, 190, '<FONT color="white" size="2"><center>Or read the most recent Newsletter for up-to-date news (left Menu/News/Spring 2004)</center>');
 tips.sites= new Array(5, 5, 150, '<FONT color="white" size="2"><center>See also<br /><i>Dive Sites Description</i><br />under "The Island"<br />in the main menu</center>');
 tips.phone = new Array(5, 5, 130, '<FONT color="white" size="2"><center>That would be<br />1-877-322-9626</center>');
 tips.toll = new Array(5, 5, 130, '<FONT color="white" size="2"><center>Note: <i>Toll free</i><br />from the US only</center>');
 tips.snail = new Array(5, 5, 130, '<FONT color="white" size="2"><center>And <i>snail</i> is quite<br />an understatement...</center>');
 tips.tips = new Array(5, 5, 150, '<FONT color="white" size="2"><center>For instance these cool<br />sticky fading tooltips ;-)</center>');
 tips.faqs = new Array(5, 5, 190, '<FONT color="white" size="2"><center>Everything you always wanted<br />to know about Paradise Divers,<br />but were afraid to ask</center>');
  tips.plain = new Array(5, 5, 200, '<FONT color="white" size="2"><center>Very plain; in fact, rather boring.<br />But it works for sure ;-)</center>');
  tips.bof2 = new Array(5, 5, 150, '<FONT color="white" size="2"><center>bof</center>');
  tips.bof3 = new Array(5, 5, 150, '<FONT color="white" size="2"><center>bof</center>');

 template = '<table bgcolor="#003366" cellpadding="1" cellspacing="0" width="%2%" border="0">' +
  '<tr><td><table bgcolor="#6699CC" cellpadding="3" cellspacing="0" width="100%" border="0">' +
  '<tr><td class="tipClass">%3%</td></tr></table></td></tr></table>';
}

var docTipsx = new TipObj('docTipsx');
with (docTipsx)
{

 tips.para = new Array(5, 15, 140, '<FONT color="white" size="2"><center>In flight self-portrait taken at 7000 ft above Salt Lake :-)</center>');
 tips.orbit = new Array(5, 5, 190, '<FONT color="white" size="2"><center>View from space taken from our own diving surveillance satellite, ParaSat3, in geosync orbit above the island</center>');
 tips.format = new Array(5, 5, 150, 'That means <i>italics</i>...<br /><hr />...etc');
 template = '<table bgcolor="#003366" cellpadding="1" cellspacing="0" width="%2%" border="0">' +
  '<tr><td><table bgcolor="#6699CC" cellpadding="3" cellspacing="0" width="100%" border="0">' +
  '<tr><td class="tipClass">%3%</td></tr></table></td></tr></table>';
 maxAlpha = 80;
}

var staticTip = new TipObj('staticTip');
with (staticTip)
{
 tips.friendly = new Array('page.scrollX() + page.windW() * 0.99 - 172', '40', 158, '<FONT color="white" size="2">Imprima esta p&aacute;gina de manerea simple y r&aacute;pida');
 tips.bookmark = new Array('page.scrollX() + page.windW() * 0.99 - 172', '40', 158, '<FONT color="white" size="2">Para a&ntilde;adir nuestra p&aacute;gina a tus favoritos');
 tips.emails = new Array('page.scrollX() + page.windW() * 0.99 - 172', '40', 158,
  '<FONT color="white" size="2">Visit our <i>Contacts</i> page (left menu) for other ways to get in touch with us');

 template = '<table bgcolor="#003366" cellpadding="1" cellspacing="0" width="%2%" border="0">' +
  '<tr><td><table bgcolor="#6699CC" cellpadding="4" cellspacing="0" width="100%" border="0">' +
  '<tr><td align="center" class="tipClass">%3%</td></tr></table></td></tr></table>';

 tipStick = 0;
}

var transTip = new TipObj('transTip');
with (transTip)
{
tips.gallery = new Array('page.scrollX() + page.windW() * 0.99 - 173', '217', 158, '<a href="galleries.htm" style="text-decoration:none"><FONT color="black" size="2">Una mirada c&aacute;ndida a cinco a&ntilde;os de fotograf&iacute;a submarina alrededor de Little Caim&aacute;n - Las descripciones son en ingl&eacute;s, pero &iquest;no dicen que una foto vale 1000 palabras? </a>');
tips.tour = new Array('page.scrollX() + page.windW() * 0.99 - 173', '382', 158, '<a href="downloads.htm" style="text-decoration:none"><FONT color="black" size="2">Aqu&iacute; puedes conseguir un Screensaver para so&ntilde;ar un poco con las aguas extraordinarias de nuestra isla - Y &iexcl;no cuesta nada! ;-)</a>');
tips.surprise = new Array('page.scrollX() + page.windW() * 0.99 - 173', '526', 158, '<a href="news11.htm" style="text-decoration:none"><FONT color="black" size="2">Sentimos que la noticias ya no sean traducidas en espa&ntilde;ol - Si hablas ingl&eacute;s, sin embargo, pasa y diviertate...</i></a>');

  template = '<table bgcolor="#003366" cellpadding="1" cellspacing="0" width="%2%" border="0">' +
  '<tr><td><table bgcolor="#9BBCDB" cellpadding="4" cellspacing="0" width="100%" border="0">' +
  '<tr><td align="center" class="tipClass">%3%</td></tr></table></td></tr></table>';
 maxAlpha = 90;
 tipStick = 0;
}

var nestTip = new TipObj('nestTip');
with (nestTip)
{
 tips.nest1 = new Array(10, 0, 90,
  '<a href="javascript:alert(\'A regular popup menu...\')">Relative Position</a>');
 tips.nest1.parentObj = staticTip;
 tips.nest1.parentTip = 'links';

 tips.nest2 = new Array('staticTip.xPos + 95', 'staticTip.yPos + 50', 120,
  '<a href="javascript:alert(\'Nested tip 2\')">Absolutely positioned static tip...</a>');
 tips.nest2.parentObj = staticTip;
 tips.nest2.parentTip = 'links';

 template = '<table bgcolor="#000000" cellpadding="1" cellspacing="0" width="%2%" border="0">' +
  '<tr><td><table bgcolor="#009999" cellpadding="3" cellspacing="0" width="100%" border="0">' +
  '<tr><td class="tipClass">%3%</td></tr></table></td></tr></table>';

 tipStick = 0;
}

var stickyTip = new TipObj('stickyTip');
with (stickyTip)
{
 tips.friendlyx = new Array(5, 5, 200, '<FONT color="white" size="2">bla-bla');
 tips.bookmarkx = new Array(5, 5, 210, '<FONT color="white" size="2">bla-bla');

 template = '<table bgcolor="#003366" cellpadding="1" cellspacing="0" width="%2%" border="0">' +
  '<tr><td><table bgcolor="#6699CC" cellpadding="4" cellspacing="0" width="100%" border="0">' +
  '<tr><td align="center" class="tipClass">%3%</td></tr></table></td></tr></table>';

 tipStick = 0.2;
}

if (isNS4) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = function(evt)
{

 docTips.track(evt);
 docTipsx.track(evt);
 staticTip.track(evt);
 transTip.track(evt);
 nestTip.track(evt);
 stickyTip.track(evt);

 if (isNS4) return document.routeEvent(evt);
}

var nsWinW = window.innerWidth, nsWinH = window.innerHeight;
function ns4BugCheck()
{
 if (isNS4 && (nsWinW!=innerWidth || nsWinH!=innerHeight)) location.reload()
	else (location.reload())
}

window.onresize = function()
{
 ns4BugCheck();
}

