// JavaScript Document
sfHover = function() {
			var sfEls = document.getElementById("nav").getElementsByTagName("LI");
			for (var i=0; i<sfEls.length; i++) {
				sfEls[i].onmouseover=function() {
					this.className+=" sfhover";
				}
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
		}
	

	sfHoverAll = function(lists) {
			var lists=new Array("nav","caribbean","marine","world")

			for(var index=0;index<lists.length;index++)
			{
				var sfEls = document.getElementById(lists[index]).getElementsByTagName("LI");
				for (var i=0; i<sfEls.length; i++) {
					sfEls[i].onmouseover=function() {
						this.className+=" sfhover";
					}
					sfEls[i].onmouseout=function() {
						this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
					}
				}
			}
		}
		
		
function openup(newpage, name) { 
	window.name = "main";
	switch (name){ 
	   case 'SCUBACHART' : 
		  win=window.open(newpage, name, "width=780, height=550, scrollbars=yes, resizable=yes, toolbar=no, status=no, location=no, menubar=no");  
		  break;
	   default : 
		  // Nothing happens if default; 
	} 
	if(win.focus){win.focus();}  // BRING TO FRONT
}
		
function openup2(newpage, name,width, height) { 
	win=window.open(newpage, name, "width=" + width + ", height=" + height + ", scrollbars=yes, resizable=yes, toolbar=no, status=no, location=no, menubar=no");  
	
	if(win.focus){win.focus();}  // BRING TO FRONT
}

function openup(newpage, name,width, height) { 
	win=window.open(newpage, name, "width=" + width + ", height=" + height + ", scrollbars=no, resizable=no, toolbar=no, status=no, location=no, menubar=no");  
	
	if(win.focus){win.focus();}  // BRING TO FRONT
}
 
function popUp(o, width, height) 
{
	popupWin = window.open(o.href, '','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height);
	return false;
}

function initRollovers() {
 if (!document.getElementById) return
 
 var aPreLoad = new Array();
 var sTempSrc;
 var aImages = document.getElementsByTagName('img');
 
 for (var i = 0; i < aImages.length; i++) {  
  if (aImages[i].className == 'imgover') {
   var src = aImages[i].getAttribute('src');
   var ftype = src.substring(src.lastIndexOf('.'), src.length);
   var hsrc = src.replace(ftype, '_o'+ftype);
 
   aImages[i].setAttribute('hsrc', hsrc);
   
   aPreLoad[i] = new Image();
   aPreLoad[i].src = hsrc;
   
   aImages[i].onmouseover = function() {
    sTempSrc = this.getAttribute('src');
    this.setAttribute('src', this.getAttribute('hsrc'));
   } 
   
   aImages[i].onmouseout = function() {
    if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
    this.setAttribute('src', sTempSrc);
   }
  }
 }
}

window.onload = initRollovers;
