SetupNamespaces("AlpineInterviews.Videos");AlpineInterviews.Videos.PlaylistPlayer=function(a){var c={containerElem:a,videos:[],preloadedImages:[],videoContainer:null,playerContainer:null,numbersContainer:null,playlistContainer:null,currentVideo:0,playerObj:null,showPlaylist:true,SwitchToVideo:function(d,f,h){c.currentVideo=d;if(!c.playerObj){c.playerObj=flowplayer(c.playerContainer.id,{src:"/flash/flowplayer.commercial-3.2.2.swf?r="+(Math.random()),wmode:"transparent"},{key:"#$937b2fcb0671c6d70f6",plugins:{rtmp:{url:"/flash/flowplayer.rtmp-3.2.1.swf?r="+(Math.random()),netConnectionUrl:"rtmp://flash.pliner.com/FMS/AlpineVideo",objectEncoding:0},controls:{url:"/flash/flowplayer.controls-3.2.1.swf?r="+(Math.random()),backgroundGradient:[0.3,0],backgroundColor:"#000000",buttonColor:"#999999",buttonOverColor:"#1D90C6",timeColor:"#FFFFFF",durationColor:"#999999",progressColor:"#CCCCCC",progressGradient:"high",bufferColor:"#999999",bufferGradient:"high",sliderColor:"#555555",sliderGradient:"medium",tooltips:{buttons:true}}},canvas:{backgroundColor:"#999999",backgroundGradient:[0.8,0]},clip:{url:f,provider:"rtmp",autoPlay:h},onLoad:function(){this.setVolume(100)}})}else{setTimeout(function(){c.playerObj.play({url:f,provider:"rtmp"})},1250)}setTimeout(function(){c.playerContainer.style.display="block"},500);var e=Get("initResp");if(e){e.value=d}e=null;if(c.showPlaylist){c.DisplayVideoNumbers();var g=Get(c.containerElem.id+"_PlaylistItem_"+c.currentVideo);g.className="PlayVideoLinkHighlighted";g.blur();g=null}},DisplayVideoNumbers:function(){ClearElem(c.numbersContainer);var k=Math.min(c.currentVideo,5);var d=Math.min(c.videos.length-c.currentVideo-1,10-k);if(d<5){k=Math.min(c.currentVideo,10-d)}if(k>0){var l=Elem("img");l.src="/images/layout/videoplayer/arrow_number_left_off.gif";l.width=9;l.height=9;l.style.margin="4px auto";l.alt="Back One Response";var j=Elem("a");j.href="#";j.className="SmallBlockListLink";j.onclick=function(){b.LaunchVideo(c.currentVideo-1,true);return false};j.onmouseover=function(){l.src="/images/layout/videoplayer/arrow_number_left_on.gif"};j.onmouseout=function(){l.src="/images/layout/videoplayer/arrow_number_left_off.gif"};j.appendChild(l);c.numbersContainer.appendChild(j)}for(var m=c.currentVideo-k;m<c.currentVideo;m++){var h=Elem("a");h.href="#";h.className="SmallBlockListLink";h.onclick=function(n){return function(){b.LaunchVideo(n,true);return false}}(m);h.appendChild(Text(m+1));c.numbersContainer.appendChild(h)}var i=Elem("a");i.href="#";i.className="SmallBlockListLinkHighlight";i.onclick=function(){b.LaunchVideo(c.currentVideo,true);return false};i.appendChild(Text(c.currentVideo+1));c.numbersContainer.appendChild(i);for(var m=c.currentVideo+1;m<c.currentVideo+d+1;m++){var e=Elem("a");e.href="#";e.className="SmallBlockListLink";e.onclick=function(n){return function(){b.LaunchVideo(n,true);return false}}(m);e.appendChild(Text(m+1));c.numbersContainer.appendChild(e)}if(d>0){c.numbersContainer.style.paddingRight=0;var g=Elem("img");g.src="/images/layout/videoplayer/arrow_number_right_off.gif";g.width=9;g.height=9;g.style.margin="4px auto";g.alt="Forward One Response";var f=Elem("a");f.href="#";f.className="SmallBlockListLink";f.onclick=function(){b.LaunchVideo(c.currentVideo+1,true);return false};f.onmouseover=function(){g.src="/images/layout/videoplayer/arrow_number_right_on.gif"};f.onmouseout=function(){g.src="/images/layout/videoplayer/arrow_number_right_off.gif"};f.appendChild(g);c.numbersContainer.appendChild(f)}else{c.numbersContainer.style.paddingRight="19px"}}};var b={IsBetaSite:false,Display:function(j,g,h){ClearElem(c.containerElem);if(c.videos.length<=0){return}c.showPlaylist=g;var i=Elem("div");i.style.padding="10px 0";i.style.backgroundColor="#000000";i.style.textAlign="center";c.videoContainer=Elem("div");c.videoContainer.id=c.containerElem.id+"_VideoPlayerContainer";c.videoContainer.style.width="320px";c.videoContainer.style.height="240px";c.videoContainer.style.margin="0 auto";c.videoContainer.style.background="transparent url(/images/layout/loading_dark.gif) no-repeat scroll center center";c.playerContainer=Elem("div");c.playerContainer.id=c.containerElem.id+"_VideoPlayer";c.playerContainer.style.display="none";c.playerContainer.style.width="320px";c.playerContainer.style.height="240px";c.videoContainer.appendChild(c.playerContainer);if(c.showPlaylist){var f=Elem("h2");f.style.margin="10px 0 8px 0";f.style.padding="0 12px";f.style.lineHeight="30px";f.style.fontSize="14px";f.style.color="#555555";f.style.fontWeight="bold";f.style.background="#EBEBEB url(/images/layout/videoplayer/bar_black.gif) repeat-x scroll left top";f.style.fontFamily="Arial, Helvetica, Sans-Serif";f.style.textAlign="left";c.numbersContainer=Elem("div");c.numbersContainer.style.margin="7px 0 0 0";c.numbersContainer.style.position="relative";if(typeof(c.numbersContainer.style.cssFloat)!="undefined"){c.numbersContainer.style.cssFloat="right"}else{c.numbersContainer.style.styleFloat="right"}f.appendChild(c.numbersContainer);f.appendChild(Text(h));c.playlistContainer=Elem("div");for(var d=0;d<c.videos.length;d++){var e=Elem("a");e.id=c.containerElem.id+"_PlaylistItem_"+d;e.href="#";e.className="PlayVideoLink";e.style.margin="0 1px 1px 1px";e.onclick=function(k){return function(){b.LaunchVideo(k,true);return false}}(d);e.appendChild(Text(c.videos[d].title,true));c.playlistContainer.appendChild(e)}}i.appendChild(c.videoContainer);if(c.showPlaylist){i.appendChild(f);i.appendChild(c.playlistContainer)}c.containerElem.appendChild(i);b.LaunchVideo(j!=null&&j!=undefined?j:0,false);if(c.showPlaylist){setTimeout(function(){if(c.playlistContainer.offsetHeight>200){c.playlistContainer.style.height="200px"}c.playlistContainer.style.overflow="auto"},250)}},AddVideoToPlaylist:function(f,g){var e=[];for(var d=2;d<arguments.length;d++){e.push(arguments[d])}var h={title:f,type:g,args:e};c.videos.push(h)},ClearPlaylist:function(){c.videos=[];if(c.playerObj!=null){c.playerObj.stop();c.playerObj.setPlaylist([{}])}},LaunchVideo:function(d,g){if(d<0){d=c.videos.length-1}else{if(d>=c.videos.length){d=0}}c.playerContainer.style.display="none";if(c.showPlaylist){Get(c.containerElem.id+"_PlaylistItem_"+c.currentVideo).className="PlayVideoLink"}if(c.playerObj!=null){c.playerObj.stop();c.playerObj.setPlaylist([{}])}var f=function(){alert("We're sorry, but there was a problem loading this video. Please try again.")};var h=new Pliner.Util.Ajax.Message("/files/videos/prepvideoforstreaming.ashx",0);h.AddPostDataKey("videoType",c.videos[d].type);for(var e=0;e<c.videos[d].args.length;e++){h.AddPostDataKey("arg"+e,c.videos[d].args[e])}h.AddOnCompletedEvent(function(i){c.SwitchToVideo(d,i.responseText,g)});h.AddOnErrorEvent(function(i){f()});ajaxConnection.AddToQueue(h)}};c.preloadedImages.push("/images/layout/loading_dark.gif");c.preloadedImages.push("/images/layout/videoplayer/arrow_number_left_off.gif");c.preloadedImages.push("/images/layout/videoplayer/arrow_number_left_on.gif");c.preloadedImages.push("/images/layout/videoplayer/arrow_number_right_off.gif");c.preloadedImages.push("/images/layout/videoplayer/arrow_number_right_on.gif");c.preloadedImages.push("/images/layout/videoplayer/bar_black.gif");c.preloadedImages.push("/images/layout/videoplayer/bg_number_black.gif");c.preloadedImages.push("/images/layout/videoplayer/bg_number_blue.gif");c.preloadedImages.push("/images/layout/videoplayer/arrow_q_off.gif");c.preloadedImages.push("/images/layout/videoplayer/arrow_q_hover.gif");c.preloadedImages.push("/images/layout/videoplayer/arrow_q_playing.gif");Pliner.Util.Display.PreloadImages(c.preloadedImages);return b};