sfHover = function() {
	var sfEls = document.getElementById("topNav").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);


//sfHover = function() {
//	var sfEls = document.getElementById("subNav").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);


$(document).ready(function() { 
    $(".trigger").tooltip({tip: '.popup', position: 'bottom center'});  // Home page popups
	$(".scrollable").scrollable({size: 1}).circular().autoscroll({  // News Scroller
		interval: 8000,
		api: true
	}); 
	//flowplayer("a.videoPlayer", "/persistent/flashplayer/flowplayer-3.1.4.swf");
	$(".zebraTable tr:even").addClass("even"); // Zebra striped tables 
	$(".zebraTable tr:odd").addClass("odd");


	// setup overlay actions to buttons
	$("a[rel]").overlay({

		// use the Apple effect for overlay
		effect: 'apple',		
		expose: '#000',	// Background transparency colour
		
		onLoad: function(content) {
			// find the player contained inside this overlay and load it
			this.getOverlay().find("a.player").flowplayer(0).load();
		},
		
		onClose: function(content) {
			$f().unload();
		}
	});					
	
	// install Flash flowplayers
	$("a.player").flowplayer("/persistent/flashplayer/flowplayer-3.1.4.swf"); 
	
	$("a.videoPlayerSmall").flowplayer("/persistent/flashplayer/flowplayer-3.1.4.swf"); 
	$("a.videoPlayerLarge").flowplayer("/persistent/flashplayer/flowplayer-3.1.4.swf"); 
	$('#pageGallery').galleryView({
		panel_width: 550,
		panel_height: 300,
		filmstrip_position: 'right',
		frame_width: 90,
		frame_height: 60,
		overlay_opacity: 0.5,
		pause_on_hover: true
	});
});	
