// JavaScript Document

/* 
| Featured Videos v2.0
| Eric M. Roberts
| 12/8/2011
*/

/* Navigation Options */

var PageMaskFadeTransition = false;		//default is false (instant-on, instant-off);
var PageMaskFadeTransitionMs = 1000;	//default is 1000 (1 second); Duration pagemask's dimming/undimming fade effect, if applicable.

/* DO NOT CHANGE ANYTHING BELOW THIS POINT */
$(document).ready(function(){$("#FeaturedVideos").jCarouselLite({btnNext: "#FeaturedVideosWrapper .next",btnPrev: "#FeaturedVideosWrapper .prev",visible: 5,scroll: 1});
	$('#FeaturedVideos a').click(function(e){e.preventDefault(); x = $(this).attr('id').split('_'); projectid = x[0]; projectuuid = x[1];	videouuid = x[2];
		OpenVideo('',projectid,projectuuid,videouuid,'http://mediasuite.multicastmedia.com/templates/V9-480h.swf','#000000',512,545,-1);});});
function mask_on(){$('#PageMask').css('opacity',0).removeClass('Off').addClass('On').animate({opacity: .75},(PageMaskFadeTransition ? PageMaskFadeTransitionMs : 1),'swing');}
function mask_off(){$('#PageMask').animate({opacity: 0},(PageMaskFadeTransition ? PageMaskFadeTransitionMs : 1),'swing',function(){$(this).removeClass('On').addClass('Off');});}
function OpenVideo(ts,projectid,projectuuid,videouuid,swf,bgcol,w,h,headertext){mask_on(); var evname = 'mediaSuitePlayer_embedcontents';
	var headertext = (headertext=='')?'Featured Video':((headertext==-1)?'':headertext);
	var flashvars = {file:swf,ts:ts,programuuid:'',gfToken:'',loadingdomain:'http://mediasuite.multicastmedia.com',serviceURL:'http://mediasuite.multicastmedia.com/services/index.php',doResize:'true',typePlayer:'vod',wmode:'transparent'};
	var params = {allowfullscreen:'true',allowscriptaccess:'always',wmode:'transparent'};	var attributes = {id:'live_player',name:'live_player',bgcolor:bgcol};
	flashvars.projectid = projectid;flashvars.projectuuid = projectuuid;flashvars.programid = videouuid;
	swfobject.embedSWF(swf, 'mediaSuitePlayer_embedcontents', w, h, '9', '/globalassets/includes/swfobject/expressInstall.swf', flashvars, params, attributes, null);
	$('#PageMask').before($('#popup_featuredvideo'));	$('#EmbeddedVidPopUpCloseBtn').click(function(){CloseVideo();});}
function CloseVideo(){swfobject.removeSWF('live_player');temp = $('#popup_featuredvideo').clone();$('#popup_featuredvideo').remove();	$('#popup_featured_video_close').remove();
	$('#Limbo').append(temp);$('#embeddedvid').append('<div style="display: inline;" id="mediaSuitePlayer_embedcontents"></div>');mask_off();}
