var DELL=window.DELL||{};DELL.com=DELL.com||{};DELL.com.mediaPlayer=DELL.com.mediaPlayer||{};(function($){(function(){var context=$(".uif_maincontent, .uif_rightrail, .uif_bodyWidget #content");init=function(){if(context.size()<=0)
return;bindLinkEvents();renderVideo();};bindLinkEvents=function(){context.find('a.mediaPlayerEmbedLink',context).click(function(e){e.preventDefault();if($(this).parent().parent().prev().attr('id')){var movieName=$(this).parent().parent().prev().attr('id');}
else{var movieName=$('.mediaPlayerContainer object').attr('id');}
$('#'+movieName)[0].openEmbedPanel();});};renderVideo=function(){$('.inlinevideo',context).each(function(i){var fr="http://www1-cdn.dell.com/flash/default/";if(location.protocol==='https:'){fr="https://www1-cdn.dell.com/flash/default/";}
var v=$(this);var m=v.find("input[name='videoSrc']").val();var oid=v.attr("oid");var wide=v.find("input[name='videoWS']").val();var b=v.find(".iv_thumb",v).attr("src");var t=escape(v.find(".iv_title",v).html());var d=$("a",v).attr("href")||"#";var pt=v.find("input[name='videoPType']").val()||"related";var c=v.find("input[name='videoCSS']").val()||fr+"media_player/assets/css/media_player_theme.css";var l=v.attr("lang")||"en";var w
v.find("input[name='videoWidth']").val().length>0?w=v.find("input[name='videoWidth']").val().replace("px",""):w=250;var h
v.find("input[name='videoHeight']").val().length>0?h=v.find("input[name='videoHeight']").val().replace("px",""):h=232;var id=v.attr("id");if(id==null||id.length==0){id="fid_"+Math.floor(Math.random()*10000);v.attr("id",id);}
if(oid!=null&&oid!=""){var swfPath="http://i.dell.com/images/global/ooyala/swf/ooyala_player.swf";if(location.protocol==='https:'){swfPath="https://i.dell.com/images/global/ooyala/swf/ooyala_player.swf";}
var mode="";switch(pt.toUpperCase()){case"FEATURED":mode="normal";break;case"RELATED":mode="rightRail";break;case"INLINE":mode="rightRail";break;case"MAIN":mode="main";break;default:mode="normal";break;}
if(String(wide).toUpperCase()=="YES"){h=(w*.5625);}
var fv={themePath:"images/global/ooyala/swf/theme-about_dell.swf",xmlPath:"images/global/ooyala/xml/playerMasterCopy.xml",mode:mode,playerWidth:w,playerHeight:h,embedCode:oid,autoplay:0,l:l,hostedAtURL:d,enableFullScreen:0};if(String(wide).toUpperCase()=="YES"&&mode!="rightRail"){h=h+44;}
var p={allowscriptaccess:'always',wmode:'transparent',allowfullscreen:'true',src:swfPath,width:w,height:h};var attributes={id:id};}
else{var swfPath=fr+"media_player/delphi_media_player.swf";var p={allowscriptaccess:'always',wmode:'transparent',allowfullscreen:'true',src:swfPath,width:w,height:h,base:fr};var labelResume=v.find('.mediaPlayerContainer:first input[name=labelResume]').val()||"Resume";var labelReplay=v.find('.mediaPlayerContainer:first input[name=labelReplay]').val()||"Replay";var labelShare=v.find('.mediaPlayerContainer:first input[name=labelShare]').val()||"Share";var labelEmbed=v.find('.mediaPlayerContainer:first input[name=labelEmbed]').val()||"Embed";var labelEmbedBtn=v.find('.mediaPlayerContainer:first input[name=labelEmbedBtn]').val()||"Embed";var labelEmbedBtnPressed=v.find('.mediaPlayerContainer:first input[name=labelEmbedBtnPressed]').val()||"Pressed";var labelPlayPause=v.find('.mediaPlayerContainer:first input[name=labelPlayPause]').val()||"Pause";var labelExpandContract=v.find('.mediaPlayerContainer:first input[name=labelExpandContract]').val()||"Expand / Collapse";var fv={appWidth:w,media:m,thumb:b,mediaTitle:t,destination:d,languageCode:l,basePath:fr+"media_player/",playerType:pt,CSSFile:c,flashID:id,labelResume:labelResume,labelReplay:labelReplay,labelShare:labelShare,labelEmbed:labelEmbed,labelEmbedBtn:labelEmbedBtn,labelEmbedBtnPressed:labelEmbedBtnPressed,labelPlayPause:labelPlayPause,labelExpandContract:labelExpandContract};var attributes={id:id};}
if(m.indexOf(".wmv")>-1){if(pt=='main'){this.innerHTML='<object id="MediaPlayer" width="'+w+'" height="'+h+'" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading…" type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"><param name="AllowChangeDisplaySize" value="true"><param name="autosize" value="false"><param name="filename" value="'+m+'" /><param name="Showcontrols" value="True" /><param name="autoStart" value="True" /><embed type="application/x-mplayer2" autoStart="true" src="'+m+'" name="MediaPlayer" width="'+w+'" height="'+h+'"></embed></object>';}
return;}
if(m.indexOf(".swf")>-1){swfobject.embedSWF(m,id,w,h,"9.0.0",fr+"media_player/expressinstall.swf",fv,{},{});return;}
swfobject.embedSWF(swfPath,id,w,h,"9.0.0",fr+"media_player/expressinstall.swf",fv,p,attributes);});};this.ooyalaCallback=function(playerId,eventName,parameters){switch(eventName){case"apiReady":document.getElementById(playerId).loadRatingsApi();break;case"ratingsApiReady":var currentRating=parseInt(document.getElementById(playerId).getCurrentItemAverageRating(),10)/2;var ratingForm=$("#ooyalaRating-"+playerId);ratingForm.data('isOoyala',true);ratingForm.data('canRate',document.getElementById(playerId).getCanRateCurrentItem());ratingForm.data('avgRating',currentRating);DELL.com.Ratings.createRatingStars(ratingForm);break;}};$(document).ready(function(){init();});}).call(DELL.com.mediaPlayer)})(jQuery);