Type.registerNamespace("RFERL.js.custom");RFERL.js.custom.MultimediaWidget=function(b,a){RFERL.js.custom.MultimediaWidget.initializeBase(this);this.widgetId=b;this.widgetSelector="#multimedia_widget_"+this.widgetId;this.clickedItem=null;this.nowPlaying=a;this.contentSelector="div#multimedia_widget_"+b+" .mmw_content_container";this.videoPlayerId="mediaVideoPlayer_"+b;this.videoContainerSelector="#mediaVideoContainer_"+b;this.photogalleryPlayerId="mediaPhotogalleryPlayer_"+b;this.photogalleryContainerSelector="#mediaPhotogalleryContainer_"+b;this.soundslidePlayerId="mediaSoundslidePlayer_"+b;this.soundslideContainerSelector="#mediaSoundslideContainer_"+b;this.soundslidePlaceholderSelector="#mediaSoundslidePlaceholder_"+b;this.soundslideFullscreenSelector="#mmw_soundslide_fulscreen_"+b;this.soundslideBgSelector="#mmw_soundslide_fulscreen_"+b+" div.mmw_soundslide_background";this.soundslidePopupSelector="#mmw_soundslide_fulscreen_"+b+" div.mmw_soundslide_popup";this.soundslideHideSlelector="div#mmw_soundslide_fulscreen_"+b+" .mmw_soundslide_hide";this.soundslideOverlaySelector="#mmw_soundslide_overlay_"+b;this.nowplayingDescriptionSelector="#mmw_nowplaying_description_"+b;this.overlayDescriptionSelector="#mmw_overlay_description_"+b;this.overlayDescriptionContainerSelector="#mmw_overlay_description_"+b+" div.mmw_overlay_description_container";this.thumbnailsSelector="#mmw_thumbnails_"+b;this.thumbnailPadding=17;this.leftScrollAreaSelctor="div#multimedia_widget_"+b+" .mmw_left_scroll_active_area";this.rightScrollAreaSelctor="div#multimedia_widget_"+b+" .mmw_right_scroll_active_area";this.leftScrollDisabled=false;this.rightScrollDisabled=false;this.soundslideW=760;this.soundslideH=533;this.soundslideFullscreenActive=false;this.filmstripSelector="div#multimedia_widget_"+this.widgetId+" div.mmw_filmstrip";this.thumbnailsContainerSelector="div#multimedia_widget_"+this.widgetId+" .mmw_thumbnails_container";this.thumbnailsContainerWidth=$(this.thumbnailsContainerSelector).width();this.thumbsLayout=$(this.thumbnailsContainerSelector).css("float");this.thumbnailsLeft=0;this.thumbnailsWidth=0;this.imageWidth=0;this.animActive=false;this.mmw_thumbnailSelectedClass="mmw_thumbnail_selected";this.videoPlayerH=230;this.videoPlayerW=385;this.photogalPlayerH=230;this.photogalPlayerW=305;this.overlayDescToImgTitle=false;this.titleMaximumChars=$(this.widgetSelector).hasClass("mmw_two_columns")?75:35;this.alternativeContent="";this.MultimediaWidget()};RFERL.js.custom.MultimediaWidget.prototype={MultimediaWidget:function(){this.prepare();this.bindEvents();if(this.nowPlaying!=null){this.hilightPlayed(this.nowPlaying)}},prepare:function(){var c=this;var a=0;var b=this.thumbnailPadding;$(this.thumbnailsSelector).children("div.mmw_thumbnail_container").each(function(e){if(isSafari||c.overlayDescToImgTitle==true){var d=$(this).children("img.mmw_thumbnail_overlay");var f=$(d).data("mediaItem");var g=$("#mmw_item_description_"+c.widgetId+"_"+f.mediaId+" h4[class!=orange] a:first-child").text();$(d).attr("title",g)}if(c.imageWidth==0){c.imageWidth=$(this).outerWidth()}a+=$(this).outerWidth()});$(this.thumbnailsSelector).css("width",a+"px");this.thumbnailsWidth=a;this.thumbnailsContainerWidth=$(this.filmstripSelector).width()-$(this.leftScrollAreaSelctor).width()-$(this.rightScrollAreaSelctor).width();$(this.thumbnailsContainerSelector).css("width",this.thumbnailsContainerWidth+"px");disableSelection($(this.filmstripSelector).get()[0]);$(document.body).append($(this.soundslideFullscreenSelector));if($(this.soundslidePlaceholderSelector+" img").length==1){$(this.soundslidePlaceholderSelector).prepend("<img src='/img/spacer.gif' alt='' />")}},bindEvents:function(){$(window).bind("scroll",{_this:this},this.windowScroll);$(document).bind("keyup",{_this:this},this.windowKeypress);$(window).bind("resize",{_this:this},this.windowResize);this.bindNowplayingDescEvents();$("div#multimedia_widget_"+this.widgetId+" .mmw_thumbnail_overlay").bind("click",{_this:this},this.thumbnailClick);$("div#multimedia_widget_"+this.widgetId+" .mmw_thumbnail_overlay").bind("mouseenter",{_this:this},this.thumbnailMouseenter);$("div#multimedia_widget_"+this.widgetId+" .mmw_thumbnail_overlay").bind("mouseleave",{_this:this},this.thumbnailMouseleave);if($(this.thumbnailsSelector).outerWidth()>$(this.thumbnailsContainerSelector).width()){this.enableSlideRight();this.disableSlideLeft()}else{this.disableSlideLeft();this.disableSlideRight()}$("div#mmw_overlay_description_"+this.widgetId).bind("mouseenter",{_this:this},this.overdescMouseenter);$("div#mediaSoundslidePlaceholder_"+this.widgetId).bind("click",{_this:this},this.soundslidePlaceholderClick);$(this.soundslideHideSlelector).bind("click",{_this:this},this.soundslideHide);$(this.soundslideHideSlelector).bind("mouseenter",{_this:this},this.soundslideHideMouseenter);$(this.soundslideHideSlelector).bind("mouseleave",{_this:this},this.soundslideHideMouseleave);$(this.soundslideHideSlelector).bind("mousedown",{_this:this},this.soundslideHideMousedown);$(this.soundslideBgSelector).bind("click",{_this:this},this.soundslideHide);$(this.soundslidePlaceholderSelector+" img:first-child").bind("load",{_this:this},this.soundslidePlaceholderOverlayLoaded)},enableSlideLeft:function(){$(this.leftScrollAreaSelctor).unbind();if(this.thumbsLayout=="left"){$(this.leftScrollAreaSelctor).removeClass("mmw_left_scroll_active_area_disabled");$(this.leftScrollAreaSelctor).bind("mouseenter",{_this:this},this.slideLeft);$(this.leftScrollAreaSelctor).bind("mousedown",{_this:this},this.slideLeftFaster);$(this.leftScrollAreaSelctor).bind("mouseup",{_this:this},this.slideLeft)}else{$(this.leftScrollAreaSelctor).removeClass("mmw_right_scroll_active_area_disabled");$(this.leftScrollAreaSelctor).bind("mouseenter",{_this:this},this.slideRight);$(this.leftScrollAreaSelctor).bind("mousedown",{_this:this},this.slideRightFaster);$(this.leftScrollAreaSelctor).bind("mouseup",{_this:this},this.slideRight)}$(this.leftScrollAreaSelctor).bind("mouseleave",{_this:this},this.stopSlide);this.leftScrollDisabled=false},enableSlideRight:function(){$(this.rightScrollAreaSelctor).unbind();if(this.thumbsLayout=="left"){$(this.rightScrollAreaSelctor).removeClass("mmw_right_scroll_active_area_disabled");$(this.rightScrollAreaSelctor).bind("mouseenter",{_this:this},this.slideRight);$(this.rightScrollAreaSelctor).bind("mousedown",{_this:this},this.slideRightFaster);$(this.rightScrollAreaSelctor).bind("mouseup",{_this:this},this.slideRight)}else{$(this.rightScrollAreaSelctor).removeClass("mmw_left_scroll_active_area_disabled");$(this.rightScrollAreaSelctor).bind("mouseenter",{_this:this},this.slideLeft);$(this.rightScrollAreaSelctor).bind("mousedown",{_this:this},this.slideLeftFaster);$(this.rightScrollAreaSelctor).bind("mouseup",{_this:this},this.slideLeft)}$(this.rightScrollAreaSelctor).bind("mouseleave",{_this:this},this.stopSlide);this.rightScrollDisabled=false},disableSlideLeft:function(){if(this.thumbsLayout=="left"){$(this.leftScrollAreaSelctor).removeClass("mmw_left_scroll_active_area_hover");$(this.leftScrollAreaSelctor).removeClass("mmw_left_scroll_active_area_hit");$(this.leftScrollAreaSelctor).addClass("mmw_left_scroll_active_area_disabled")}else{$(this.leftScrollAreaSelctor).removeClass("mmw_right_scroll_active_area_hover");$(this.leftScrollAreaSelctor).removeClass("mmw_right_scroll_active_area_hit");$(this.leftScrollAreaSelctor).addClass("mmw_right_scroll_active_area_disabled")}$(this.leftScrollAreaSelctor).unbind();this.leftScrollDisabled=true},disableSlideRight:function(){if(this.thumbsLayout=="left"){$(this.rightScrollAreaSelctor).removeClass("mmw_right_scroll_active_area_hover");$(this.rightScrollAreaSelctor).removeClass("mmw_right_scroll_active_area_hit");$(this.rightScrollAreaSelctor).addClass("mmw_right_scroll_active_area_disabled")}else{$(this.rightScrollAreaSelctor).removeClass("mmw_left_scroll_active_area_hover");$(this.rightScrollAreaSelctor).removeClass("mmw_left_scroll_active_area_hit");$(this.rightScrollAreaSelctor).addClass("mmw_left_scroll_active_area_disabled")}$(this.rightScrollAreaSelctor).unbind();this.rightScrollDisabled=true},bindNowplayingDescEvents:function(){if(isOpera){$("div#multimedia_widget_"+this.widgetId+" div.mmw_nowplaying_description a").bind("mouseenter",{_this:this},this.descLinkOperaFix)}if(isOpera){$("div#multimedia_widget_"+this.widgetId+" div.mmw_nowplaying_description a").bind("mouseleave",{_this:this},this.descLinkOperaFix)}},playItem:function(c){var b=this.nowPlaying;var a=c.mediaId+""+this.widgetId;this.playerFailures=0;this.curentlySendedId=a;this.nowPlaying=c;switch(c.mediatype){case"Photogallery":$(this.photogalleryContainerSelector).css("display","block");$(this.videoContainerSelector).css("display","none");$(this.soundslideContainerSelector).css("display","none");$(this.soundslidePlaceholderSelector).css("display","none");$(this.soundslideFullscreenSelector).css("display","none");if(b.mediatype==this.nowPlaying.mediatype){this.playItemInFlash(c.flashUrl,this.photogalleryPlayerId,a,c)}else{this.reloadPlayer(c);this.afterPlay(c)}break;case"Video":$(this.videoContainerSelector).css("display","block");$(this.photogalleryContainerSelector).css("display","none");$(this.soundslideContainerSelector).css("display","none");$(this.soundslidePlaceholderSelector).css("display","none");$(this.soundslideFullscreenSelector).css("display","none");if(b.mediatype==this.nowPlaying.mediatype){this.playItemInFlash(c.flashUrl,this.videoPlayerId,a,c)}else{this.reloadPlayer(c);this.afterPlay(c)}break;case"Soundslide":$(this.soundslideContainerSelector).css("display","block");$(this.soundslidePlaceholderSelector).css("display","block");$(this.photogalleryContainerSelector).css("display","none");$(this.videoContainerSelector).css("display","none");$(this.soundslideFullscreenSelector).css("display","none");this.renderSoundslidePlaceholder(c);this.ieResetVideoObject();this.afterPlay(c);break}},afterPlay:function(a){this.hilightPlayed(a);$(this.overlayDescriptionSelector).css("display","none");this.renderDescription(a)},scrollToItem:function(a){},hilightPlayed:function(a){$("div#multimedia_widget_"+this.widgetId+" .mmw_thumbnails_container div."+this.mmw_thumbnailSelectedClass).removeClass(this.mmw_thumbnailSelectedClass);$("#mmw_thumbnail_container_"+this.widgetId+"_"+a.mediaId).addClass(this.mmw_thumbnailSelectedClass)},renderSoundslide:function(c){var b={bgcolor:"#000000"};var a={id:"mediaSoundslidePlayer_"+this.widgetId,name:"SoundslidePlayer"};swfobject.embedSWF(c,"mediaSoundslidePlayer_"+this.widgetId,String(this.soundslideW),String(this.soundslideH),"10.0.0","/flash/expressInstall.swf",null,b,a);$(this.soundslideFullscreenSelector).css("display","block");$(this.soundslideBgSelector).css("opacity","0.5");$(this).removeClass("mmw_soundslide_hide_hit");this.soundslideLayout();this.soundslideFullscreenActive=true},soundslideLayout:function(){var e=$(window).height();var i=$(window).width();var d=$(window).scrollTop();$(this.soundslideFullscreenSelector).css("top",d);$(this.soundslideFullscreenSelector).css("width",i+"px");$(this.soundslideFullscreenSelector).css("height",e+"px");$(this.soundslideBgSelector).css("width",i+"px");$(this.soundslideBgSelector).css("height",parseInt(e+1000)+"px");var g=5;var f=140;var k=5;var c=5;var j=this.soundslideH+g+c+($(this.soundslideHideSlelector).outerHeight());var b=this.soundslideW+f+k;if(j>e){g=1;c=1;j=this.soundslideH+g+c+($(this.soundslideHideSlelector).outerHeight())}if(b>i){f=1;k=1;b=this.soundslideW+f+k}var h=(j<e)?parseInt((e-j)/2):0;var a=(b<i)?parseInt((i-b)/2):0;$(this.soundslidePopupSelector).css("margin-top",h+"px");$(this.soundslidePopupSelector).css("margin-left",a+"px");$(this.soundslidePopupSelector).css("margin-right",a+"px");$(this.soundslidePopupSelector).css("margin-bottom",h+"px");$(this.soundslidePopupSelector).css("padding-top",g+"px");$(this.soundslidePopupSelector).css("padding-left",f+"px");$(this.soundslidePopupSelector).css("padding-right",k+"px");$(this.soundslidePopupSelector).css("padding-bottom",c+"px")},soundslideHide:function(a){var b=a.data._this;$(b.soundslideFullscreenSelector).css("display","none");$("#mediaSoundslideContainer_"+this.widgetId).html("<div id='mediaSoundslidePlayer_"+this.widgetId+"' class='mmw_soundslideplayer'></div>");b.soundslideFullscreenActive=false},soundslideHideMouseenter:function(a){var b=a.data._this;$(this).addClass("mmw_soundslide_hide_hover");$(this).removeClass("mmw_soundslide_hide_hit")},soundslideHideMouseleave:function(a){var b=a.data._this;$(this).removeClass("mmw_soundslide_hide_hover");$(this).removeClass("mmw_soundslide_hide_hit")},soundslideHideMousedown:function(a){var b=a.data._this;$(this).removeClass("mmw_soundslide_hide_hover");$(this).addClass("mmw_soundslide_hide_hit")},renderSoundslidePlaceholder:function(a){if(a.soundslidePlaceholderSrc!=""){$(this.soundslidePlaceholderSelector+" img:first-child").attr("src",a.soundslidePlaceholderSrc)}},soundslidePlaceholderOverlayLoaded:function(b){var c=b.data._this;var a=($(c.widgetSelector).hasClass("mmw_one_column")&&$(b.currentTarget).width()>($(c.contentSelector).width()-14))?$(c.contentSelector).width()-14:$(b.currentTarget).width();c.soundslidePlaceholderOverlayImgW(a)},soundslidePlaceholderOverlayImgW:function(a){if($(this.soundslideOverlaySelector).width()!=a){$(this.soundslideOverlaySelector).width(a)}},soundslidePlaceholderClick:function(a){var c=a.data._this;var b=c.nowPlaying;c.renderSoundslide(b.flashUrl)},windowScroll:function(a){var b=a.data._this;if(b.soundslideFullscreenActive==true){$(b.soundslideFullscreenSelector).css("top",$(window).scrollTop()+"px")}},windowKeypress:function(a){var b=a.data._this;if(b.soundslideFullscreenActive==true&&a.keyCode==27){b.soundslideHide(a)}},windowResize:function(a){var b=a.data._this;if(b.soundslideFullscreenActive==true){b.soundslideLayout()}},renderDescription:function(a){var b="#mmw_item_description_"+this.widgetId+"_"+a.mediaId;$(this.nowplayingDescriptionSelector).html($(b).html());this.bindNowplayingDescEvents()},renderOverlayDescriotion:function(b){var c="#mmw_item_description_"+this.widgetId+"_"+b.mediaId+" h4[class!=orange] a:first-child";$(this.overlayDescriptionSelector).css("display","block");if($(c).text()!=""){$(this.overlayDescriptionContainerSelector).html($(c).text())}else{this.hideOverlayDescription()}var a=$(this.overlayDescriptionContainerSelector).width();if(a>$(this.overlayDescriptionSelector).width()){this.stripTitleHtml($(c).text(),this.overlayDescriptionSelector,this.overlayDescriptionContainerSelector,5,0)}},hideOverlayDescription:function(){$(this.overlayDescriptionSelector).css("display","none")},overdescMouseenter:function(a){var b=a.data._this;b.hideOverlayDescription()},thumbnailClick:function(a){var c=a.data._this;var b=$(a.currentTarget).data("mediaItem");c.clickedItem=this;c.playItem(b);return false},thumbnailMouseenter:function(a){var c=a.data._this;var b=$(a.currentTarget).data("mediaItem");switch(b.mediatype){case"Photogallery":$(this).attr("src","/img/photogalleryOverlay_mmw.gif");break;case"Video":$(this).attr("src","/img/videoOverlay_mmw.gif");break;case"Soundslide":$(this).attr("src","/img/soundOverlay_mmw.gif");break}if(!isSafari&&c.overlayDescToImgTitle!=true){c.renderOverlayDescriotion(b)}return false},thumbnailMouseleave:function(a){var c=a.data._this;var b=$(a.currentTarget).data("mediaItem");$(this).attr("src","/img/spacer.gif");c.hideOverlayDescription()},stopSlide:function(a){var b=a.data._this;$(b.thumbnailsSelector).stop();b.animActive=false;$(this).removeClass("mmw_right_scroll_active_area_hover");$(this).removeClass("mmw_left_scroll_active_area_hover");$(this).removeClass("mmw_right_scroll_active_area_hit");$(this).removeClass("mmw_left_scroll_active_area_hit")},slideLeft:function(a){var b=a.data._this;if(b.animActive==true){b.stopSlide(a)}b.slideL(5000);$(this).removeClass("mmw_left_scroll_active_area_hit");$(this).addClass("mmw_left_scroll_active_area_hover")},slideL:function(e){var f=this;var a=f.thumbnailsContainerWidth;var d=parseInt($(f.thumbnailsSelector).css("left"));if(this.thumbsLayout=="left"){if(this.rightScrollDisabled==true){this.enableSlideRight()}var c=Math.abs(d)}else{if(this.leftScrollDisabled==true){this.enableSlideLeft()}var c=parseInt(f.thumbnailsWidth-a-d)}var b=parseInt((c/((11*(f.imageWidth+f.thumbnailPadding))-a))*e);if((f.thumbsLayout=="left"&&d<0)||(f.thumbsLayout=="right"&&Math.abs(d)<(f.thumbnailsWidth-a))){f.animActive=true;$(f.thumbnailsSelector).animate({left:"+="+c},b,function(){f.animActive=false;if(f.thumbsLayout=="left"){f.disableSlideLeft()}else{f.disableSlideRight()}})}},slideLeftFaster:function(a){var b=a.data._this;if(b.animActive==true){b.stopSlide(a)}b.slideL(2000);$(this).removeClass("mmw_left_scroll_active_area_hover");$(this).addClass("mmw_left_scroll_active_area_hit")},slideRight:function(a){var b=a.data._this;if(b.animActive==true){b.stopSlide(a)}b.slideR(5000);$(this).removeClass("mmw_right_scroll_active_area_hit");$(this).addClass("mmw_right_scroll_active_area_hover")},slideR:function(e){var f=this;var a=f.thumbnailsContainerWidth;var d=parseInt($(f.thumbnailsSelector).css("left"));if(this.thumbsLayout=="left"){if(this.leftScrollDisabled==true){this.enableSlideLeft()}var c=parseInt(d+f.thumbnailsWidth-a)}else{if(this.rightScrollDisabled==true){this.enableSlideRight()}var c=Math.abs(d)}var b=parseInt((c/((11*(f.imageWidth+f.thumbnailPadding))-a))*e);if((f.thumbsLayout=="left"&&Math.abs(d)<(f.thumbnailsWidth-a))||(f.thumbsLayout=="right"&&d>0)){f.animActive=true;$(f.thumbnailsSelector).animate({left:"-="+c},b,function(){f.animActive=false;if(f.thumbsLayout=="left"){f.disableSlideRight()}else{f.disableSlideLeft()}})}},slideRightFaster:function(a){var b=a.data._this;if(b.animActive==true){b.stopSlide(a)}b.slideR(2000);$(this).removeClass("mmw_right_scroll_active_area_hover");$(this).addClass("mmw_right_scroll_active_area_hit")},reloadPlayer:function(e){var g=this;var d="";var b=null;var a=null;var f={wmode:"transparent",allowFullScreen:"true"};var c=null;switch(e.mediatype){case"Video":d=String.format("<div id='mediaVideoPlayer_{0}'>{1}</div>",this.widgetId,this.alternativeContent);b=$("#mediaVideoContainer_"+this.widgetId);b.html(d);a={configFilePath:encodeURIComponent(e.flashUrl),defvolume:getVolume()};c={id:"mediaVideoPlayer_"+this.widgetId,name:"MediaPlayer"};swfobject.embedSWF("/flash/MediaPlayer.swf?cache=","mediaVideoPlayer_"+this.widgetId,String(this.videoPlayerW),String(this.videoPlayerH),"10.0.0","/flash/expressInstall.swf",a,f,c);this.ie6FlashWidthFix(this.videoPlayerW);break;case"Photogallery":this.ieResetVideoObject();d=String.format("<div id='mediaPhotogalleryPlayer_{0}'>{1}</div>",this.widgetId,this.alternativeContent);b=$("#mediaPhotogalleryContainer_"+this.widgetId);b.html(d);a={configFilePath:encodeURIComponent(e.flashUrl)};c={id:"mediaPhotogalleryPlayer_"+this.widgetId,name:"PhotogalleryPlayer"};swfobject.embedSWF("/flash/photogalleryComponent.swf?cache=","mediaPhotogalleryPlayer_"+this.widgetId,String(this.photogalPlayerW),String(this.photogalPlayerH),"10.0.0","/flash/expressInstall.swf",a,f,c);this.ie6FlashWidthFix(this.photogalPlayerW);break}},ieResetVideoObject:function(){if(isIE){$(String.format("#mediaVideoContainer_{0}",this.widgetId)).html(String.format("<div id='mediaVideoPlayer_{0}' class='mmw_videoplayer'></div>",this.widgetId))}},ie6FlashWidthFix:function(b){var c=this;var a=b;if(isIE6){setTimeout(function(){$("#mediaPhotogalleryPlayer_"+c.widgetId).css("width",a+"px")},10)}},descLinkOperaFix:function(a){var b=a.data._this;fixOperaRedraw("#feffff")}};RFERL.js.custom.MultimediaWidget.registerClass("RFERL.js.custom.MultimediaWidget",RFERL.js.custom.BaseListComponent);