//CUSTOM SCRIPTS FOR THE HEAD

// Run javascript after DOM is initialized
$(document).ready(function(){
	//Page FadeIn function - it uses jQuery
	if (!$.browser.msie) {
		$('body').css({display: 'none'}).fadeIn(1200);
	}

	//Menu, Superfish
	$("ul.sf-menu").superfish();

	//Flowplayer.Tools.Tooltip
	$('.tooltip_trigger').tooltip({offset: [10, 0], effect: 'slide'}).dynamic({bottom: {direction: 'down', bounce: true}});
	//$(".tooltip_html_trigger").tooltip({offset: [10, 0], effect: 'drop', relative:true}).dynamic({ bottom: { direction: 'down', bounce: true } });

	//Flowplayer.Tools.Overlay - is initialized with this single JavaScript call
	$('a[rel]').overlay({mask: '#ffffff', effect: 'apple'});

	// Gallery, Lightbox
	$('#lightbox_gallery a').lightBox();

	// Tabs
	var activeTabIndex =0;
	var activeTabLink = $('.wdCurrentTab');
	if(activeTabLink.length > 0) activeTabIndex = parseInt($(activeTabLink).first().attr("wdnwTabIndex"));
	$('ul.tabs').tabs('> .pane', {initialIndex: activeTabIndex});

});

// Gallery, Lightbox - Configuration related to images
var lightboxImageLoading ='images/icon_processing_large.gif';		// (string) Path and the name of the loading icon
var lightboxImageBtnPrev ='layout_icbss/modules_gallery_lightbox/images/lightbox-btn-prev.png';			// (string) Path and the name of the prev button image
var lightboxImageBtnNext ='layout_icbss/modules_gallery_lightbox/images/lightbox-btn-next.png';			// (string) Path and the name of the next button image
var lightboxImageBtnClose ='images/icon_cancel.png';		// (string) Path and the name of the close btn
var lightboxImageBlank ='layout_icbss/modules_gallery_lightbox/images/lightbox-blank.gif';			// (string) Path and the name of a blank image (one pixel)

//cufon font replacement, define the node elements for replacement
if (!$.browser.msie) {
	Cufon.replace('h1, h2, h3');
}

function initializeUI(){
	if (!$.browser.msie) {
		$('body').hide();
	}
}
