var flashPlayer=Class.create();flashPlayer.prototype={initialize:function(a){this.width=a.dyboxObject.options.containerDimensions.width;this.height=a.dyboxObject.options.containerDimensions.height;this.vidWidth=a.dyboxObject.options.containerDimensions.width;this.uiEnabled=a.dyboxObject.options.videoPlayerConfig.uiEnabled;if(this.uiEnabled==true){this.playerHeight=parseInt(a.dyboxObject.options.containerDimensions.height)+26}else{this.playerHeight=a.dyboxObject.options.containerDimensions.height}this.vidHeight=a.dyboxObject.options.containerDimensions.height;this.fullscreen=a.dyboxObject.options.videoPlayerConfig.allowFullScreen;this.skipTime=a.dyboxObject.options.videoPlayerConfig.skipTime;this.allowscriptaccess=a.dyboxObject.options.videoPlayerConfig.allowscriptaccess;this.allowFullScreen=a.dyboxObject.options.videoPlayerConfig.allowFullScreen;this.uiBarColour=a.dyboxObject.options.videoPlayerConfig.uiBarColour;this.uiBarBufferColor=a.dyboxObject.options.videoPlayerConfig.uiBarBufferColor;this.bufferTime=a.dyboxObject.options.videoPlayerConfig.bufferTime;this.pageWidth=getBodyWidth();this.videoLocation=a.dyboxObject.options.videoDetails.videoLocation},defineFlashPlayer:function(){var a=new SWFObject(mediaServerLocation+"/swf/video/flvPlayer.swf","flv",this.vidWidth,this.playerHeight,"8","#000000");a.addVariable("viewHeight",this.vidHeight);a.addVariable("viewWidth",this.vidWidth);a.addVariable("fullscreen",this.fullscreen);a.addVariable("skipTime",this.skipTime);a.addVariable("uiBarTimeColor",this.uiBarColour);a.addVariable("uiBarBufferColor",this.uiBarBufferColor);a.addVariable("uiEnabled",this.uiEnabled);a.addVariable("buffer",this.bufferTime);a.addParam("menu","false");a.addParam("allowscriptaccess",this.allowscriptaccess);a.addParam("allowFullScreen",this.allowFullScreen);a.addVariable("file",this.videoLocation);return a},defineYouTubePlayer:function(){var b,a;b=document.createElement("object");b.setAttribute("type","objectContainer");b.setAttribute("data",this.videoLocation);b.setAttribute("width",this.width);b.setAttribute("height",this.height);a=document.createElement("param");a.setAttribute("name","objectContainer");a.setAttribute("value",this.videoLocation);b.appendChild(a);return b},defineSWFPlayer:function(){var a=new SWFObject(this.videoLocation,"swf",this.vidWidth,this.playerHeight,"8","#000000");a.addVariable("viewHeight",this.vidHeight);a.addVariable("viewWidth",this.vidWidth);a.addParam("menu","false");return a},disableClick:function(){}};function loadFlashPlayerVideo(b){var a,d,c;b.disableClick();d=window.windowDimensions();buildContainers(b);if(b.dyboxObject.options.videoDetails.videoType.toLowerCase()=="swf"){c=new flashPlayer(b);a=c.defineSWFPlayer()}else{if(b.dyboxObject.options.videoDetails.videoType.toLowerCase()=="youtube"){c=new flashPlayer(b);a=c.defineYouTubePlayer()}else{c=new flashPlayer(b);a=c.defineFlashPlayer()}}if(videoJukeBox.length>0){createJukeBoxCentre();this.putCenter("lightbox_Content",b)}displayContent(b,a)}var viewJukeBox=false;function addToVideoJukeBox(a,b){var d,c;if(b==undefined){b=false}if(b==true){clearJukeBox()}d=videoJukeBox.length;for(c=0;c<a.length;c++){videoJukeBox[d+c]=a[c]}}function clearJukeBox(){videoJukeBox.length=0}var jukeBoxItem=Class.create();jukeBoxItem.prototype={imageSRC:"",videoLinkText:"",videoLocation:"",videoType:"",jukeBoxID:"",linkBind:"",dyboxObject:"",currentFlashPlayer:"",initialize:function(a,b){this.imageSRC=a.options.imageLink.imageSRC;this.videoLinkText=a.options.imageLink.linkText;this.videoLocation=a.options.videoDetails.videoLocation;this.videoType=a.options.videoDetails.videoType;this.jukeBoxID=b;this.linkBind="";this.linkBindRollover="";this.dyboxObject=a;this.currentFlashPlayer=new flashPlayer(this)},createJukeBoxItem:function(){var e,b,a,c,f,d;b=document.createElement("div");b.setAttribute("class","lightbox_JukeBoxItem");e=document.createElement("a");e.setAttribute("href","javascript:void(0);");e.setAttribute("id","lightbox_JukeboxItem_"+this.jukeBoxID);a=document.createElement("img");a.setAttribute("src",this.imageSRC);e.appendChild(a);c=document.createElement("p");f=document.createTextNode(this.videoLinkText);c.appendChild(f);e.appendChild(c);b.appendChild(e);return b},jukeBoxItemClicked:function(){var a,b;$("lightbox_Flash").style.width=this.dyboxObject.options.containerDimensions.width+"px";if(this.dyboxObject.options.videoPlayerConfig.uiEnabled==true){$("lightbox_Flash").style.height=this.dyboxObject.options.containerDimensions.height+26+"px"}else{$("lightbox_Flash").style.height=this.dyboxObject.options.containerDimensions.height+"px"}if(viewJukeBox==false){$("lightbox_Jukebox").style.width=setJukeBoxWidth("startingPos")}else{$("lightbox_Jukebox").style.width=setJukeBoxWidth("full")}if(this.videoType.toLowerCase()=="youtube"){unloadContent("lightbox_Container");a=this.currentFlashPlayer.defineYouTubePlayer();$("lightbox_Container").appendChild(a)}else{if(this.videoType.toLowerCase()=="swf"){a=this.currentFlashPlayer.defineSWFPlayer()}else{a=this.currentFlashPlayer.defineFlashPlayer()}a.write("lightbox_Container")}},jukeBoxItemRollover:function(){$("lightbox_JukeboxItem_"+this.jukeBoxID).setAttribute("src",this.imageSRC.replace(".jpg","_Alt.jpg"))}};function jukeBoxToggle(){var b,a;b=getLightBoxContainerWidth();if(viewJukeBox==false){new Effect.Morph("lightbox_Jukebox",{style:"width:"+b+"px",queue:{position:"end",scope:"jukeBoxToggle"}});Effect.SlideDown("lightbox_JukeboxContent",{duration:1,scaleContent:false,scaleTo:100,queue:{position:"end",scope:"jukeBoxToggle"}});viewJukeBox=true;$("lightbox_JukeboxToggle").innerHTML=jukeBoxText_Close}else{Effect.SlideUp("lightbox_JukeboxContent",{duration:1,scaleContent:false,scaleFrom:100,queue:{position:"end",scope:"jukeBoxToggle"}});new Effect.Morph("lightbox_Jukebox",{style:"width:"+setJukeBoxWidth("startingPos"),queue:{position:"end",scope:"jukeBoxToggle"}});viewJukeBox=false;$("lightbox_JukeboxToggle").innerHTML=jukeBoxText_Open}}function setJukeBoxWidth(a){var b;lightboxContainerWidth=getLightBoxContainerWidth();if(a=="full"){b=lightboxContainerWidth+"px"}else{if(jukeBoxItemWidth>lightboxContainerWidth){b=lightboxContainerWidth+"px"}else{b=jukeBoxItemWidth+"px"}}return b}function getLightBoxContainerWidth(){var a=parseInt(($("lightbox_Flash").style.width).replace("px",""));return a}function createJukeBoxCentre(){var a,h,c,l,d,f,j,b,g,k,e;k=0;a=document.createElement("div");a.setAttribute("id","lightbox_Jukebox");a.setAttribute("class","clear");if(viewJukeBox==false){a.style.width=setJukeBoxWidth("startingPos")}else{a.style.width=setJukeBoxWidth("full")}h=document.createElement("div");h.setAttribute("id","lightbox_JukeboxContent");h.setAttribute("class","clear");if(viewJukeBox==false){h.style.display="none"}h.setAttribute("class","clear");e=document.createElement("div");e.setAttribute("id","lightbox_JukeboxContentContainer");e.setAttribute("class","clear");h.appendChild(e);a.appendChild(h);$("lightbox_Content").appendChild(a);for(d=0;d<videoJukeBox.length;d++){k+=parseInt(jukeBoxItemWidth);if(k<getLightBoxContainerWidth()){f=new jukeBoxItem(videoJukeBox[d],d);j=f.createJukeBoxItem();e.appendChild(j);f.linkBind=f.jukeBoxItemClicked.bindAsEventListener(f);Event.observe("lightbox_JukeboxItem_"+d,"click",f.linkBind)}}c=document.createElement("a");c.setAttribute("id","lightbox_JukeboxToggle");if(viewJukeBox==false){l=document.createTextNode(jukeBoxText_Open)}else{l=document.createTextNode(jukeBoxText_Close)}c.appendChild(l);a.appendChild(c);Event.observe("lightbox_JukeboxToggle","click",jukeBoxToggle)};
