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"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
		
		


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;


function openVideo(x){
	var video=window.open(x,'Headfirst','width=550,height=522,location=no,scrollbars=no,toolbar=0,directories=0,status=0,menubar=0,resizable=no,screenx=0,screeny=0,top=0,left=0");video.focus();')
}

function openup(newpage, name) { 
	window.name = "main";
	switch (name){ 
	   case 'DIRECTIONS' : 
		  win=window.open(newpage, name, "width=650, height=800, scrollbars=yes, resizable=yes, toolbar=no, status=no, location=no, menubar=no");  
		  break;
		  case 'ANNOUNCEMENTS' : 
		  win=window.open(newpage, name, "width=400, height=300, scrollbars=yes, resizable=yes, toolbar=no, status=no, location=no, menubar=no");
		  break;
		  case 'VIDEO' : 
		  win=window.open(newpage, name, "width=520, height=400, scrollbars=no, resizable=yes, toolbar=no, status=no, location=no, menubar=no");
		  break;
		  case 'VIDEOCAMPS' : 
		  win=window.open(newpage, name, "width=540, height=480, scrollbars=no, 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 loadIntoOpener(page) {
    if (opener && !opener.closed)
        opener.location=page;
    else {
		var myWin = window.open(page, '', "width=800, height=600, scrollbars=yes, resizable=yes, toolbar=yes, status=yes, location=yes, menubar=yes");
        //var myWin = window.open(page,'','width=100,height=100');
        // trick the window into thinking it was opened by this new window:
        opener = myWin;
    }
}



