var MEDIAPLAYER = "/javascripts/shadowbox/libraries/mediaplayer/player-licensed.swf";
var EXPRESSINSTALL = "/javascripts/shadowbox/libraries/swfobject/expressInstall.swf";

// JavaScript Document
/**
 *
 *  Now that most js development is stable, it is probably best to statically link to js.
 *  create a 'google' object to catch any remaining google calls.
 *
 **/
 // http://code.google.com/apis/ajaxlibs/documentation/
//google.load("jquery", "1.3");
//google.load("jqueryui", "1.7");
//google.load("swfobject", "2");
var google = {setOnLoadCallback:$}

// Load Videos
function loadMedia(media, format, auto){
    auto = (auto) ? 'true' : 'false' ;
	var flashvars = {
		skin:'/media/ClearExternalNoVol.swf&media=' + media + '&format=' + format + '&auto=' + auto
	};
	var params = {
		wmode:'transparent'
	};
	var attributes = {};
	
	swfobject.embedSWF(MEDIAPLAYER, "media-player-content", "400", "306", "9.0.115", EXPRESSINSTALL, flashvars, params, attributes);
	
    return false;
};

$(function(){
	///////////////////////////////
	// Start JS functions here.

	///////////////////////////////
	// PNG Fix
	$.getScript('/javascripts/supersleight.plugin.js',function(){
		$('body').supersleight();
	});


	///////////////////////////////
	// jcarousel
	$.getScript('/javascripts/jcarousel/lib/jquery.jcarousel.pack.js',function(){
		$('#featureCarousel').show().jcarousel({
			// Configuration goes here
			//scroll:1,
			//visible:4,
			animation:1*1000, // milliseconds
			wrap:'both', // null, 'first', 'last', 'both', 'circular'
			auto:15 // seconds
		});
			
		$('#videoCarousel .videoThumb').css('display','block');
		$('#videoCarousel').jcarousel({
			vertical:true,
			visible:4
		});
	});

	///////////////////////////////
	// mainNav drop down
	$('ul#mainNav > li > a').mouseenter(function(e){
	    var $this = $(this);
	    var $sub = $this.parent().find('> ul');
	    $sub.show();
	});
	$('ul#mainNav > li').mouseleave(function(e){
	    var $this = $(this);
	    var $sub = $this.find('> ul');
	    $sub.hide();
	});

});



