
function initTopTenModule(){var list=[$('topTen'),$('threeColumnList'),$('threeColumnListLeft'),$('threeColumnListMiddle'),$('threeColumnListRight')];list.each(function(item){if(item){var pTopTenItems=item.select('a');pTopTenItems.each(function(theItem){Event.observe(theItem,'mouseover',mouseOverTopTenItem);});}});}
function toggleHoverState(theItem){var oModule=theItem.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;var oModuleColumn=theItem.parentNode.parentNode.parentNode.parentNode.parentNode;var pTopTenItems=oModule.select('#'+oModuleColumn.id+' li a');pTopTenItems.each(function(theItem){Element.removeClassName(theItem,'hovered');});Element.addClassName(theItem,'hovered');}
function mouseOverTopTenItem(eventData){var theItem=Event.element(eventData);while(theItem.tagName.toLowerCase()!='a')theItem=theItem.parentNode;var mouseOveredAnchor=theItem;toggleHoverState(theItem);theItem=theItem.parentNode;var index=theItem.id.substring(theItem.id.lastIndexOf('_')+1);theItem=theItem.parentNode.parentNode.parentNode.parentNode;var pImageToChange=$$('#'+theItem.id+' img');var oImageToChange=pImageToChange[0];oImageToChange.src=mouseOveredAnchor.getAttribute('imageref');}
moduleManager.registerModuleLoad(initTopTenModule);function selectRandomElement(array){if(array.length==0)return null;var rnd=Math.floor(Math.random()*array.length);return array[rnd];}
function ajaxifyAToZModule(){$$('#celebsAZ .lettersRow a').each(function(el){Event.observe(el,'click',letterClicked);});}
function letterClicked(eventData){Event.stop(eventData);var theAnchor=Event.element(eventData);var theLetter=theAnchor.innerHTML;try{var params='letter='+theLetter+'&rndParam='+new Date().getTime();var method='get';new Ajax.Request("/celebs/ajaxAtoZ/"+theLetter,{method:method,parameters:params,onSuccess:fetchCelebAToZDataCallBack});}
catch(e){};}
function fetchCelebAToZDataCallBack(callBackData){$('celebsAZ').replace(callBackData.responseText);ajaxifyAToZModule();}
moduleManager.registerModuleLoad(ajaxifyAToZModule);function setUpMashUpModule(){var LIs=$$('#mashUpWrapper li');for(var loop=0;loop<LIs.length;loop++){var theLi=LIs[loop];Event.observe(theLi,'mouseover',mashSelectRow);Event.observe(theLi,'mouseout',mashUnselectRow);Event.observe(theLi,'click',mashClickRow);}}
function mashSelectRow(eventData){var theElement=Event.element(eventData);while(theElement.tagName.toLowerCase()!='li')theElement=theElement.parentNode;theElement.addClassName('selected');}
function mashUnselectRow(eventData){var theElement=Event.element(eventData);while(theElement.tagName.toLowerCase()!='li')theElement=theElement.parentNode;theElement.removeClassName('selected');}
function mashClickRow(eventData){var theElement=Event.element(eventData);while(theElement.tagName.toLowerCase()!='li')theElement=theElement.parentNode;var celebUrl=theElement.getElementsByTagName('a')[0];window.location=celebUrl.href;}
moduleManager.registerModuleLoad(setUpMashUpModule);var LATEST_NEWS_ANIMATION_TIME=0;var LATEST_NEWS_DISPLAYED_TIME=2500;var LATEST_NEWS_QUEUE_NAME='latestNewsQueue';var LATEST_NEWS_QUEUE_MAP={scope:LATEST_NEWS_QUEUE_NAME};var LATEST_NEWS_FADE_FROM=0.99;var LATEST_NEWS_FADE_TO=0.01;function latestNewsFadeOut(){var theAnchor=$$('#latestBreakingNewsLeft a')[0];if(!theAnchor)theAnchor=$('latestHeadline');if(theAnchor)Effect.Fade(theAnchor,{from:LATEST_NEWS_FADE_FROM,to:LATEST_NEWS_FADE_TO,queue:LATEST_NEWS_QUEUE_MAP,duration:LATEST_NEWS_ANIMATION_TIME,afterFinish:latestNewsFadeIn});};function latestNewsFadeIn(){latestNewsIndex++;var lastIndex=Math.min(9,latestNewsData.length-1);if(latestNewsIndex>lastIndex)latestNewsIndex=0;var theAnchor=$$('#latestBreakingNewsLeft a')[0];if(!theAnchor){theAnchor=$('latestHeadline');}
if(theAnchor){theAnchor.href=latestNewsData[latestNewsIndex].uri;theAnchor.innerHTML=latestNewsData[latestNewsIndex].headline;}
var latestAssetType=$('latestAssetType');if(latestAssetType){latestAssetType.innerHTML=latestNewsData[latestNewsIndex].assetType;}
var latestReadMoreLink=$('latestReadMoreLink');if(latestReadMoreLink){latestReadMoreLink.href=latestNewsData[latestNewsIndex].uri;}
Effect.Appear(theAnchor,{from:LATEST_NEWS_FADE_TO,to:LATEST_NEWS_FADE_FROM,queue:LATEST_NEWS_QUEUE_MAP,duration:LATEST_NEWS_ANIMATION_TIME,afterFinish:startLatestNewsFadeOut});};function startLatestNewsFadeOut(){setTimeout('latestNewsFadeOut();',LATEST_NEWS_DISPLAYED_TIME);};moduleManager.registerModuleLoad(startLatestNewsFadeOut);function attachClickEventsToTabs(tabClass,paneClass){var iconTabArray=$$('ul.'+tabClass+' li');iconTabArray.each(function(tab){Event.observe(tab,'mouseover',function(eventData){var tabLI=Event.element(eventData);while(tabLI.tagName.toLowerCase()!='li'){tabLI=tabLI.parentNode;}
Element.addClassName(tabLI,'hovered');});Event.observe(tab,'mouseout',function(eventData){var tabLI=Event.element(eventData);while(tabLI.tagName.toLowerCase()!='li'){tabLI=tabLI.parentNode;}
Element.removeClassName(tabLI,'hovered');});if(tab.parentNode.className.indexOf('nonJSTabs')<0){Event.observe(tab,'click',function(eventData){var tabAnchor=Event.element(eventData);while(tabAnchor.tagName.toLowerCase()!='a'){tabAnchor=tabAnchor.parentNode;}
tabAnchor.blur();var moduleWrapperDiv=tabAnchor.parentNode;while(moduleWrapperDiv.id.length<1){moduleWrapperDiv=moduleWrapperDiv.parentNode;}
var iconTabArray=$$('#'+moduleWrapperDiv.id+' ul.'+tabClass+' li');var dataDivArray=$$('#'+moduleWrapperDiv.id+' .'+paneClass);if(iconTabArray.length&&iconTabArray.length==dataDivArray.length){for(var loop=0,max=iconTabArray.length;loop<max;loop++){if(this===iconTabArray[loop]){Element.addClassName(iconTabArray[loop],'selected');Element.removeClassName(dataDivArray[loop],'jsHidden');var heading3Collection=dataDivArray[loop].getElementsByTagName('h3');if(heading3Collection.length){var heading2Collection=iconTabArray[loop].parentNode.parentNode.getElementsByTagName('h2');if(heading2Collection.length){heading2Collection[0].innerHTML=heading3Collection[0].innerHTML;}}}else{Element.removeClassName(iconTabArray[loop],'selected');Element.addClassName(dataDivArray[loop],'jsHidden');}}}
Event.stop(eventData);});}});};function initialiseIconTabs(){attachClickEventsToTabs('iconTabs','assetSliceWrapper');}
function initialiseTopTabs(){attachClickEventsToTabs('topTabs','topTabsPane');}
moduleManager.registerModuleLoad(initialiseIconTabs);moduleManager.registerModuleLoad(initialiseTopTabs);powerCarousel=function(sElementId,pImageData){if(arguments.length<2){throw new Error("Incorrect number of minimum parameters supplied when creating a new Power Carousel.");}
if(!$(sElementId)){throw new Error("The id [' + sElementId = '] was not found when creating a new Power Carousel.");}
this.oCarousel=$(sElementId);this.bInitialised=false;this.bAnimationInProgress=false;this.bTransitionInProgress=false;this.bMouseOverPaused=false;this.nCurrentlyDisplayedPowerImage=0;this.nNextPowerImageToDisplay=1;this.nSubmissiveTransitioningImage=null;this.bPausedOverNavigationOnly=false;var UA=navigator.userAgent;this.bSkipFade=(UA.indexOf('Mac')!=-1&&UA.indexOf('Firefox/2')!=-1);var safari2Mac=(UA.indexOf('Mac')!=-1&&UA.indexOf('Version/')==-1&&UA.indexOf('Safari/')!=-1);this.nTransitionTime=1;this.nMouseOverTransitionTime=0;this.nAnimationDelay=3000;this.pImageData=pImageData;this.nMaxOpacityValue=0.99;this.nMinOpacityValue=0.01;if(Prototype.Browser.IE){this.nMaxOpacityValue=1;this.nMinOpacityValue=0;}
if(UA.indexOf('Firefox/3')!=-1&&$('powerImageSummary')){$('powerImageSummary').setStyle({overflow:'visible'});}
this.sPowerImageSelector='.powerImageItem img';this.sPowerImageSummarySelector='.powerImageSummary .summary';this.sPowerImageNavigationThumbClass='powerImageThumb';this.sPowerImageNavigationThumbSelector='.powerImageThumb';this.sCarouselNavigatorSelector='#powerImageNavigatorOuter';this.oAnimationTimer=null;this.oMouseOverTimer=null;this.sQueueName='powerImageQueue';this.oQueueMap={scope:this.sQueueName};};powerCarousel.prototype.initialise=function(){this.pPowerImages=$$(this.sPowerImageSelector);this.pPowerImageSummaries=$$(this.sPowerImageSummarySelector);this.pNavigationThumbs=$$(this.sPowerImageNavigationThumbSelector);this.oCarouselNavigator=$$(this.sCarouselNavigatorSelector)[0];if(this.pPowerImages.length!=this.pImageData.length){throw new Error("The number of power image placeholders "+this.pPowerImages.length+"does not match the amount of data supplied "+this.pImageData.length+".");}else{var pTemporaryImagePreloadArray=[];this.pImageData.each(function(powerImageFilename){var tempImg=new Image();if(safari2Mac){tempImg.onload=this.loadedPowerImage.bindAsEventListener(this);}else{Event.observe(tempImg,'load',this.loadedPowerImage.bindAsEventListener(this));}
tempImg.src=powerImageFilename;pTemporaryImagePreloadArray[pTemporaryImagePreloadArray.length]=tempImg;},this);this.bInitialised=true;}};powerCarousel.prototype.loadedPowerImage=function(eventData){if(this.loadedPowerImageCount==null){this.loadedPowerImageCount=0;}
this.loadedPowerImageCount++;if(this.loadedPowerImageCount==this.pImageData.length){var nImageDataIndex=0;this.pPowerImages.each(function(powerImageNode){powerImageNode.src=this.pImageData[nImageDataIndex++];},this);this.intialiseRollovers();this.startAnimation();}};powerCarousel.prototype.intialiseRollovers=function(){this.pNavigationThumbs.each(function(powerImageThumbNode){powerImageThumbNode.observe('mouseover',this.mouseOverPowerImageThumb.bindAsEventListener(this));},this);if(!this.bPausedOverNavigationOnly){this.oCarousel.observe('mouseover',this.mouseOverCarousel.bindAsEventListener(this));this.oCarousel.observe('mouseout',this.mouseOutCarousel.bindAsEventListener(this));}
this.oCarouselNavigator.observe('mouseover',this.mouseOverCarousel.bindAsEventListener(this));this.oCarouselNavigator.observe('mouseout',this.mouseOutCarousel.bindAsEventListener(this));};powerCarousel.prototype.mouseOverCarousel=function(eventData){if(this.oMouseOverTimer!=null){clearTimeout(this.oMouseOverTimer);this.oMouseOverTimer=null;}
if(this.bAnimationInProgress){this.stopAnimation();}
this.bMouseOverPaused=true;};powerCarousel.prototype.mouseOutCarousel=function(eventData){if(this.oMouseOverTimer!=null){clearTimeout(this.oMouseOverTimer);this.oMouseOverTimer=null;}
this.oMouseOverTimer=setTimeout(this.actualMouseOutCarousel.bind(this),100);};powerCarousel.prototype.actualMouseOutCarousel=function(){this.bMouseOverPaused=false;this.startAnimation();};powerCarousel.prototype.startAnimation=function(){this.bAnimationInProgress=true;this.nMouseOverThumbEventTriggered=null;if(this.oAnimationTimer==null){this.oAnimationTimer=setTimeout(this.showNextItem.bind(this),this.nAnimationDelay);}};powerCarousel.prototype.showNextItem=function(eventData){this.oAnimationTimer=null;this.nNextPowerImageToDisplay=(this.nCurrentlyDisplayedPowerImage+1)%this.pPowerImages.length;this.showPowerImage(this.nNextPowerImageToDisplay);this.showPowerImageSummary(this.nNextPowerImageToDisplay);};powerCarousel.prototype.stopAnimation=function(){if(this.oAnimationTimer!=null){clearTimeout(this.oAnimationTimer);this.oAnimationTimer=null;}
this.bAnimationInProgress=false;};powerCarousel.prototype.mouseOverPowerImageThumb=function(eventData){var oNode=Event.element(eventData);while(!Element.hasClassName(oNode,this.sPowerImageNavigationThumbClass))oNode=oNode.parentNode;var nNodeIndex=parseInt(oNode.id.substring(oNode.id.lastIndexOf('_')+1),10);if(this.nMouseOverThumbEventTriggered!=nNodeIndex){this.nMouseOverThumbEventTriggered=nNodeIndex;if(this.nCurrentlyDisplayedPowerImage!=nNodeIndex||this.bTransitionInProgress){var nFadeFromOpacityValue;var nAppearFromOpacityValue;if(this.bTransitionInProgress){if(this.nCurrentlyDisplayedPowerImage==nNodeIndex){this.nCurrentlyDisplayedPowerImage=this.nSubmissiveTransitioningImage;}
nFadeFromOpacityValue=Element.extend(this.pPowerImages[this.nCurrentlyDisplayedPowerImage].parentNode).getOpacity();nAppearFromOpacityValue=1-nFadeFromOpacityValue;this.cancelEffects();if(this.nSubmissiveTransitioningImage!=nNodeIndex){this.instantFadeSubmissiveImage();this.instantFadeSubmissiveSummary();}}
this.nNextPowerImageToDisplay=nNodeIndex;this.showPowerImage(this.nNextPowerImageToDisplay,nFadeFromOpacityValue,nAppearFromOpacityValue);this.showPowerImageSummary(this.nNextPowerImageToDisplay);}}};powerCarousel.prototype.showPowerImage=function(nNodeIndex,nFadeFromOpacityValue,nAppearFromOpacityValue){var oNodeToFadeFrom=Element.extend(this.pPowerImages[this.nCurrentlyDisplayedPowerImage].parentNode);var oNodeToFadeTo=Element.extend(this.pPowerImages[nNodeIndex].parentNode);if(this.bSkipFade){oNodeToFadeFrom.setStyle({zIndex:2}).hide();oNodeToFadeTo.setStyle({zIndex:3}).show();this.pNavigationThumbs[this.nCurrentlyDisplayedPowerImage].removeClassName('selected');this.pNavigationThumbs[nNodeIndex].addClassName('selected');this.nextItemFullyLoaded();return;}
nFadeFromOpacityValue=nFadeFromOpacityValue||this.nMaxOpacityValue;nAppearFromOpacityValue=nAppearFromOpacityValue||this.nMinOpacityValue;var timeToFade=(this.bMouseOverPaused)?this.nMouseOverTransitionTime:this.nTransitionTime;var bSwappedAt50Percent=false;Effect.Appear(oNodeToFadeTo,{from:nAppearFromOpacityValue,to:this.nMaxOpacityValue,duration:timeToFade,queue:this.oQueueMap});Effect.Fade(oNodeToFadeFrom,{from:nFadeFromOpacityValue,to:this.nMinOpacityValue,duration:timeToFade,queue:this.oQueueMap,beforeStart:function(effectObj){this.nSubmissiveTransitioningImage=nNodeIndex;this.bTransitionInProgress=true;oNodeToFadeFrom.setStyle({zIndex:3}).show();oNodeToFadeTo.setStyle({zIndex:2}).show();}.bind(this),beforeUpdate:function(effectObj){var bAfterHalfwayPoint=effectObj.totalFrames/2<=effectObj.currentFrame;if(bAfterHalfwayPoint&&!bSwappedAt50Percent){bSwappedAt50Percent=true;this.nSubmissiveTransitioningImage=this.nCurrentlyDisplayedPowerImage;this.nCurrentlyDisplayedPowerImage=nNodeIndex;this.pNavigationThumbs[this.nSubmissiveTransitioningImage].removeClassName('selected');this.pNavigationThumbs[this.nCurrentlyDisplayedPowerImage].addClassName('selected');oNodeToFadeFrom.setStyle({zIndex:2});oNodeToFadeTo.setStyle({zIndex:3});}}.bind(this),afterFinish:function(effectObj){this.nSubmissiveTransitioningImage=null;this.bTransitionInProgress=false;this.nextItemFullyLoaded();oNodeToFadeFrom.hide();}.bind(this)});};powerCarousel.prototype.nextItemFullyLoaded=function(){if(!this.bMouseOverPaused){this.startAnimation();}};powerCarousel.prototype.cancelEffects=function(){var queue=Effect.Queues.get(this.sQueueName);queue.each(function(e){e.cancel();});this.bTransitionInProgress=false;};powerCarousel.prototype.instantFadeSubmissiveImage=function(){var oNode=Element.extend(this.pPowerImages[this.nSubmissiveTransitioningImage].parentNode);oNode.setStyle({opacity:this.nMinOpacityValue,zIndex:1});oNode.hide();this.pNavigationThumbs[this.nSubmissiveTransitioningImage].removeClassName('selected');};powerCarousel.prototype.instantFadeSubmissiveSummary=function(){var oNode=this.pPowerImageSummaries[this.nSubmissiveTransitioningImage];oNode.setStyle({opacity:this.nMinOpacityValue,zIndex:1});oNode.hide();};powerCarousel.prototype.showPowerImageSummary=function(nNodeIndex){var oldNode=this.pPowerImageSummaries[this.nCurrentlyDisplayedPowerImage];var newNode=this.pPowerImageSummaries[nNodeIndex];if(this.bSkipFade){oldNode.hide();newNode.show();this.nCurrentlyDisplayedPowerImage=nNodeIndex;return;}
var timeToFade=(this.bMouseOverPaused)?this.nMouseOverTransitionTime:this.nTransitionTime;Effect.Appear(newNode,{from:this.nMinOpacityValue,to:this.nMaxOpacityValue,duration:timeToFade,queue:this.oQueueMap,beforeStart:function(){oldNode.hide();}});};function initQuoteModule(){if(typeof(quoteAssetArray)!='undefined'&&quoteAssetArray.length>0){var quoteAsset=selectRandomElement(quoteAssetArray);$$('#quoteModule .quoteText a')[0].innerHTML=quoteAsset.quote;$$('#quoteModule .quoteByline')[0].innerHTML=quoteAsset.byline;$$('#quoteModule .quoteAsset')[0].innerHTML=quoteAsset.shortHeadline;$$('#quoteModule .quoteLink').each(function(link){link.href=quoteAsset.uri;link.title=quoteAsset.mainHeadline;Element.addClassName(link,'randomQuote')})
$$('#quoteModule .readMoreLink').each(function(link){link.href=quoteAsset.uri;Element.addClassName(link,'randomQuote')})
$$('#quoteModule .quoteContent')[0].removeClassName('jsHidden');}}
moduleManager.registerModuleLoad(initQuoteModule);var PaginationModule=Class.create({initialize:function(currentPage,numPages,nextFunction,prevFunction,idOfContainer){if(isNaN(parseInt(currentPage,10))){throw('You must supply a valid numeric currentPage parameter');}
if(isNaN(parseInt(numPages,10))){throw('You must supply a valid numeric numPages parameter');}
if(typeof(nextFunction)!='function'){throw('You must supply a valid function as the nextFunction parameter');}
if(typeof(prevFunction)!='function'){throw('You must supply a valid function as the prevFunction parameter');}
this.container=$(idOfContainer);if(!this.container){throw('You must supply a valid DOM ID as the idOfContainer parameter');}
this.currentPage=currentPage;this.numPages=numPages;this.nextFunction=nextFunction;this.prevFunction=prevFunction;this.render();},render:function(){var markup='';markup+='<div class="paginationBlock fontStyle05">';markup+='<a href="#" class="prevLink noBorder" title="Previous">';markup+='<img src="'+IMAGE_BASE_URL+'transparent.gif" alt="">';markup+='</a>';markup+='<span>'+this.currentPage+' of '+this.numPages+'</span>';markup+='<a href="#" class="nextLink noBorder" title="Next">';markup+='<img src="'+IMAGE_BASE_URL+'transparent.gif" alt="">';markup+='</a>';markup+='</div>';this.container.innerHTML=markup;var prevButton=$$('#'+this.container.id+' .prevLink')[0];var nextButton=$$('#'+this.container.id+' .nextLink')[0];if(prevButton)Event.observe(prevButton,'click',this.prevPage.bind(this));if(nextButton)Event.observe(nextButton,'click',this.nextPage.bind(this));},nextPage:function(eventData){if(eventData)Event.stop(eventData);if(this.currentPage<this.numPages){this.currentPage++;}else{this.currentPage=1;}
this.render();this.nextFunction();},prevPage:function(eventData){if(eventData)Event.stop(eventData);if(this.currentPage>1){this.currentPage--;}else{this.currentPage=this.numPages;}
this.render();this.prevFunction();}});coedit.slicedGalleryControl=function(l_sSelf,l_sElementId)
{if(arguments.length<2)
{throw new Error("Incorrect number of minimum parameters supplied when creating a Sliced Gallery Control.");}
if(document.getElementById(l_sElementId)==undefined)
{throw new Error("Could not find anything with id="+l_sElementId+" when creating a Sliced Gallery Control.");}
this.m_sTargetElement=l_sElementId;this.m_oTargetElement=$(l_sElementId);this.m_sSelf=l_sSelf;this.m_bTransitioning=false;this.m_bPauseButtonPause=false;this.m_bMouseOverPause=false;this.m_nCurrentSelectedImageIndex=0;this.m_nMinWidth=90;this.m_nMinOpacity=0.5;this.m_nMaxWidth=300;this.m_nSteps=15;this.m_nStepAmount=(this.m_nMaxWidth-this.m_nMinWidth)/this.m_nSteps;this.m_nTimeBetweenTransitions=3000;this.m_nTimeBetweenSteps=40;this.m_nLastImageMousedOver=-1;this.decorate();setTimeout(this.m_sSelf+'.masterTimer()',this.m_nTimeBetweenTransitions);};coedit.slicedGalleryControl.prototype.decorate=function()
{var l_pDivWrappers=$$('#'+this.m_sTargetElement+' .slicedImageWrapper');var l_oSelf=this;for(var loop=0,max=l_pDivWrappers.length;loop<max;loop++)
{var l_oDiv=l_pDivWrappers[loop];l_oDiv.getElementsByTagName('img')[0].style.left='0px';if(loop==this.m_nCurrentSelectedImageIndex)
{l_oDiv.style.width=this.m_nMaxWidth+'px';this.setOpacity(l_oDiv,1);}
else
{l_oDiv.style.width=this.m_nMinWidth+'px';this.setOpacity(l_oDiv,this.m_nMinOpacity);l_oDiv.getElementsByTagName('img')[0].style.left=(0-(this.m_nMaxWidth-this.m_nMinWidth)/2)+'px';}
l_oDiv.getElementsByTagName('img')[0].onmouseover=this.userMouseOverSlice.bind(this,loop);}
var l_pSliceWrap=$$('#'+this.m_sTargetElement+' .sliceWrapper');if(l_pSliceWrap.length)
{l_pSliceWrap[0].onmouseover=this.mouseOnGallery.bind(this);l_pSliceWrap[0].onmouseout=this.mouseOffGallery.bind(this);}};coedit.slicedGalleryControl.prototype.mouseOverSlice=function(l_nThisImageIndex)
{if(this.m_bTransitioning==false&&l_nThisImageIndex!=this.m_nCurrentSelectedImageIndex)
{this.m_bTransitioning=true;this.toggleSlice(this.m_nCurrentSelectedImageIndex,l_nThisImageIndex);}};coedit.slicedGalleryControl.prototype.userMouseOverSlice=function(l_nThisImageIndex)
{this.m_nLastImageMousedOver=l_nThisImageIndex;this.mouseOverSlice(l_nThisImageIndex);};coedit.slicedGalleryControl.prototype.mouseOnGallery=function()
{this.m_bMouseOverPause=true;};coedit.slicedGalleryControl.prototype.mouseOffGallery=function()
{this.m_bMouseOverPause=false;this.m_nLastImageMousedOver=-1;};coedit.slicedGalleryControl.prototype.toggleSlice=function(l_nReduceSliceIndex,l_nGrowSliceIndex)
{var l_bContinueReducing=this.reduceSlice(l_nReduceSliceIndex);var l_bContinueGrowing=this.growSlice(l_nGrowSliceIndex);if(l_bContinueReducing||l_bContinueGrowing)
{setTimeout(this.m_sSelf+'.toggleSlice('+l_nReduceSliceIndex+','+l_nGrowSliceIndex+')',this.m_nTimeBetweenSteps);}
else
{this.m_nCurrentSelectedImageIndex=l_nGrowSliceIndex;this.showLinkInfo();this.m_bTransitioning=false;if(this.m_bMouseOverPause&&this.m_nLastImageMousedOver!=-1&&this.m_nLastImageMousedOver!=this.m_nCurrentSelectedImageIndex){this.showNextImage();}}};coedit.slicedGalleryControl.prototype.showLinkInfo=function()
{var l_oLink=$$('#'+this.m_sTargetElement+' .linkedHeadingWrapper a')[0];var l_oLinkData=this.m_pSlicedData[this.m_nCurrentSelectedImageIndex];l_oLink.href=l_oLinkData.linkhref;l_oLink.innerHTML=l_oLinkData.linktext;l_oLink.title='Click for more about: '+l_oLinkData.linktext;};coedit.slicedGalleryControl.prototype.reduceSlice=function(l_nSliceIndex)
{var l_pDivWrappers=$$('#'+this.m_sTargetElement+' .slicedImageWrapper');var l_oDivWrapper=l_pDivWrappers[l_nSliceIndex];var l_nWidth=parseInt(l_oDivWrapper.style.width,10);if(l_nWidth>this.m_nMinWidth)
{l_oDivWrapper.style.width=l_nWidth-this.m_nStepAmount+'px';var l_nStepCount=(this.m_nMaxWidth-parseInt(l_oDivWrapper.style.width,10))/this.m_nStepAmount;var l_nStepOpacity=((1-this.m_nMinOpacity)/this.m_nSteps)*l_nStepCount;this.setOpacity(l_oDivWrapper,1-l_nStepOpacity);l_oDivWrapper.getElementsByTagName('img')[0].style.left=parseInt(l_oDivWrapper.getElementsByTagName('img')[0].style.left,10)-(this.m_nStepAmount/2)+'px';return true;}
else
{l_oDivWrapper.style.width=this.m_nMinWidth+'px';Element.removeClassName(l_oDivWrapper,'selected');this.setOpacity(l_oDivWrapper,this.m_nMinOpacity);l_oDivWrapper.getElementsByTagName('img')[0].style.left=(0-(this.m_nMaxWidth-this.m_nMinWidth)/2)+'px';return false;}};coedit.slicedGalleryControl.prototype.growSlice=function(l_nSliceIndex)
{var l_pDivWrappers=$$('#'+this.m_sTargetElement+' .slicedImageWrapper');var l_oDivWrapper=l_pDivWrappers[l_nSliceIndex];var l_nWidth=parseInt(l_oDivWrapper.style.width,10);if(l_nWidth<this.m_nMaxWidth)
{l_oDivWrapper.style.width=l_nWidth+this.m_nStepAmount+'px';var l_nStepCount=(parseInt(l_oDivWrapper.style.width,10)-this.m_nMinWidth)/this.m_nStepAmount;var l_nStepOpacity=((1-this.m_nMinOpacity)/this.m_nSteps)*l_nStepCount;this.setOpacity(l_oDivWrapper,this.m_nMinOpacity+l_nStepOpacity);l_oDivWrapper.getElementsByTagName('img')[0].style.left=parseInt(l_oDivWrapper.getElementsByTagName('img')[0].style.left,10)+(this.m_nStepAmount/2)+'px';return true;}
else
{l_oDivWrapper.style.width=this.m_nMaxWidth+'px';Element.addClassName(l_oDivWrapper,'selected');this.setOpacity(l_oDivWrapper,1);l_oDivWrapper.getElementsByTagName('img')[0].style.left='0px';return false;}};coedit.slicedGalleryControl.prototype.setOpacity=function(l_oNode,l_nOpacity)
{if(l_oNode!=undefined&&l_nOpacity!=undefined)
{l_oNode.style.opacity=l_nOpacity;l_oNode.style.MozOpacity=l_nOpacity;l_oNode.style.KhtmlOpacity=l_nOpacity;l_oNode.style.filter="alpha(opacity="+l_nOpacity*100+")";}};coedit.slicedGalleryControl.prototype.masterTimer=function()
{if(this.m_bTransitioning==false){if((this.m_bMouseOverPause&&this.m_nLastImageMousedOver!=-1)||(this.m_bPauseButtonPause==false&&this.m_bMouseOverPause==false)){this.showNextImage();}}
setTimeout(this.m_sSelf+'.masterTimer()',this.m_nTimeBetweenTransitions);};coedit.slicedGalleryControl.prototype.showNextImage=function()
{var l_nNextImageIndex=this.m_nCurrentSelectedImageIndex+1;if(this.m_nLastImageMousedOver!=-1){l_nNextImageIndex=this.m_nLastImageMousedOver;}
this.mouseOverSlice((l_nNextImageIndex)%this.m_pSlicedData.length);};function setUpRollOvers(moduleClass){var theModuleClass=moduleClass||'rollover';var rolloverSpots=$$('.'+theModuleClass);rolloverSpots.each(function(theHotspot){Event.observe(theHotspot,'mouseover',function(eventData){mouseOverHotspot(eventData,theModuleClass);});Event.observe(theHotspot,'mouseout',function(eventData){mouseOutHotspot(eventData,theModuleClass);});});}
function mouseOverHotspot(eventData,theModuleClass){var theSpot=Event.element(eventData);if(!Element.hasClassName(theSpot,theModuleClass))theSpot=theSpot.up('.'+theModuleClass);Element.addClassName(theSpot,'hovered');}
function mouseOutHotspot(eventData,theModuleClass){var theSpot=Event.element(eventData);if(!Element.hasClassName(theSpot,theModuleClass))theSpot=theSpot.up('.'+theModuleClass);Element.removeClassName(theSpot,'hovered');}
moduleManager.registerModuleLoad(setUpRollOvers);function tripleOptionSlotSetup(){var theAnchors=$$('.tripleOptionSlotWrapper .droppable a');theAnchors.each(function(theAnchor){if(theAnchor.className!='skyPlayerLogo'){Event.observe(theAnchor,'mouseover',tripleOptionSlotMouseOver);}});}
function tripleOptionSlotMouseOver(eventData){var selectedAnchor=Event.element(eventData);if(selectedAnchor.tagName.toLowerCase()!='a')return;var parentDroppable=selectedAnchor.parentNode;if(parentDroppable.className=='internalPositioner'){parentDroppable=parentDroppable.parentNode;}
var optionSlotWrapper=Element.extend(parentDroppable.parentNode);var tripleOptionsInner=Element.extend(optionSlotWrapper.parentNode);var optionImageWrapper=tripleOptionsInner.select('.tripleOptionSlotImageWrapper')[0];var theAnchors=optionSlotWrapper.select('.droppable a');theAnchors.each(function(theAnchor){theAnchor.removeClassName('selected');});selectedAnchor.addClassName('selected');var theSelectedIndex=parentDroppable.id.sub(/hotspot.*_/,'')
var theImageAnchors=optionImageWrapper.select('a');theImageAnchors.each(function(theAnchor,loop){if(loop==theSelectedIndex){theAnchor.style.zIndex='5';}else{theAnchor.style.zIndex='1';}});}
moduleManager.registerModuleLoad(tripleOptionSlotSetup);function getCorrespondingDisplayDivFromHref(theHref){var currentlyDisplayedDiv=$(theHref.slice(theHref.lastIndexOf('#')+1,theHref.lastIndexOf('Link'))+'Wrapper');return currentlyDisplayedDiv;};function skyPlayerModuleCollectionMenuClick(eventData){var link=Event.element(eventData);while(link.tagName.toLowerCase()!='a')link=link.parentNode;var div=link;while(div.tagName.toLowerCase()!='div')div=div.parentNode;var menuItems=$$('#skyPlayerModuleCollection .menubar div.selected');menuItems.each(function(link){if(link==div){return;}
Element.removeClassName(link,'selected');Element.addClassName(getCorrespondingDisplayDivFromHref(link.getElementsByTagName('a')[0].href),'jsHidden');});Element.addClassName(div,'selected');Element.removeClassName(getCorrespondingDisplayDivFromHref(link.href),'jsHidden');if(eventData!=null)Event.stop(eventData);};function setUpSkyPlayerModuleCollection(){var menuItems=$$('#skyPlayerModuleCollection .menubar div a');menuItems.each(function(link){Event.observe(link,'click',skyPlayerModuleCollectionMenuClick);});$$('#tvSkyPlayerEditorsPickWrapper a').each(function(link){link.href+='/editorspicks';});$$('#tvSkyPlayerLastChanceToSeeWrapper a').each(function(link){link.href+='/lastchance';});$$('#sky1SkyPlayerEditorsPickWrapper a').each(function(link){link.href+='/editorspicks';});$$('#sky1SkyPlayerLastChanceToSeeWrapper a').each(function(link){link.href+='/lastchance';});};moduleManager.registerModuleLoad(setUpSkyPlayerModuleCollection);if(window['loadFirebugConsole']){window.loadFirebugConsole();}else{if(!window['console']){window.console={};window.console.info=alert;window.console.log=alert;window.console.warn=alert;window.console.error=alert;}}
var galleryViewer=null;function initialiseGalleryViewer(){galleryViewer=new GalleryViewer();};var GalleryViewer=Class.create({initialize:function(){this.imageData=[];this.currentImage=currentImageNumber;this.paginationModule=null;this.advertReloadFrequency=5;this.advertReloadCounter=0;this.preloadImageSpread=4;this.preloadGalleryImages();this.slowLoadDelay=1000;this.slowLoadTimerHandle=null;var theImg=$$('#theGalleryImage img')[0];theImg.onload=this.imageLoadedCallBack.bindAsEventListener(this);document.fire('gallery:initialised',this);},preloadGalleryImages:function(){for(var loop=0,max=galleryData.length;loop<max;loop++){var theImage=galleryData[loop];this.imageData[this.imageData.length]={caption:theImage.caption,captionHeading:theImage.captionHeading,url:baseImagePath+theImage.url,alt:theImage.alt}}
this.preloadImagesFromWindow();this.paginationModule=new PaginationModule(this.currentImage,this.imageData.length,this.nextButtonClicked.bind(this),this.prevButtonClicked.bind(this),'theGalleryPagination');},preloadImagesFromWindow:function(){var nStartIndex=this.currentImage-1-this.preloadImageSpread;if(nStartIndex<0){nStartIndex=this.imageData.length+this.currentImage-1-this.preloadImageSpread;}
if(nStartIndex<0){nStartIndex=0;}
var preloadImages=[];for(var loop=0,max=2*this.preloadImageSpread;loop<=max;loop++){var nImageIndexToLoad=(nStartIndex+loop)%this.imageData.length;var theImage=this.imageData[nImageIndexToLoad];var img=new Image();img.src=theImage.url;preloadImages[preloadImages.length]=img;}},imageLoadedCallBack:function(){if(this.slowLoadTimerHandle!=null){clearTimeout(this.slowLoadTimerHandle);this.slowLoadTimerHandle=null;}
this.hideLoadingMessage();document.fire('gallery:current_image_loaded',this);},showLoadingMessage:function(){this.slowLoadTimerHandle=null;var messageDiv=$('theGalleryLoadingMessage');if(!messageDiv){messageDiv=document.createElement('div');messageDiv.id='theGalleryLoadingMessage';messageDiv.className='opaqueDark';messageDiv.innerHTML='Loading&hellip;';$('theGalleryImage').appendChild(messageDiv);}else{Element.show(messageDiv);}
document.fire('gallery:show_loading_message',this);},hideLoadingMessage:function(){this.slowLoadTimerHandle=null;var messageDiv=$('theGalleryLoadingMessage');if(messageDiv){Element.hide(messageDiv);}},updateAdverts:function(){this.advertReloadCounter++;if(this.advertReloadCounter==this.advertReloadFrequency){this.advertReloadCounter=0;if(!EXPANDING_ADS_ENABLED||(EXPANDING_ADS_ENABLED&&typeof(embeddedGalleryLoadedOK)=='undefined'&&(typeof(inlineGallery)=='boolean'&&!inlineGallery))){this.refreshAdIframes();}}
document.fire('gallery:adverts_updated',this);},refreshAdIframes:function(){var adIframes=$$('.reloadableAd');for(var loop=0;loop<adIframes.length;loop++){var iframe=adIframes[loop];var src=iframe.getAttribute('adUrl');iframe.contentWindow.location.replace(src);}},updateHitBox:function(){var hitBoxSuffix='';if(typeof(inlineGallery)=='boolean'&&inlineGallery){hitBoxSuffix='+(Inline+gallery+click)';}
try{_hbPageView(hbx.pn+hitBoxSuffix,hbx.mlc);}catch(e){};document.fire('gallery:hitbox_updated',this);},prevButtonClicked:function(eventData){if(this.currentImage>1){this.currentImage--;}else{this.currentImage=this.imageData.length;}
this.showImage(this.currentImage);this.updateAdverts();this.updateHitBox();this.preloadImagesFromWindow();document.fire('gallery:previous_button_pressed',this);},nextButtonClicked:function(eventData){if(this.currentImage<this.imageData.length){this.currentImage++;}else{this.currentImage=1;}
this.showImage(this.currentImage);this.updateAdverts();this.updateHitBox();this.preloadImagesFromWindow();document.fire('gallery:next_button_pressed',this);},showImage:function(imageNum){var imageIndex=imageNum-1;var img=$$('#theGalleryImage img')[0];if(this.slowLoadTimerHandle!=null)clearTimeout(this.slowLoadTimerHandle);this.slowLoadTimerHandle=setTimeout(this.showLoadingMessage.bind(this),this.slowLoadDelay);img.src=this.imageData[imageIndex].url;img.alt=this.imageData[imageIndex].alt;var captionTitle=$('captionTitle');var captionBody=$('captionBody');var captionTitleHtml=''
var captionBodyHtml=''
if(this.imageData[imageIndex].caption||this.imageData[imageIndex].captionHeading){if(this.imageData[imageIndex].captionHeading){captionTitleHtml+=this.imageData[imageIndex].captionHeading;}
if(this.imageData[imageIndex].caption){captionBodyHtml+=this.imageData[imageIndex].caption;}}else{captionTitleHtml+='&nbsp;';captionBodyHtml+='&nbsp;';}
if(captionTitleHtml){captionTitle.innerHTML=captionTitleHtml;captionTitle.setStyle({display:'block'});}else{captionTitle.innerHTML='';captionTitle.setStyle({display:'none'});}
captionBody.innerHTML=captionBodyHtml;}});var promoList=['skyPlayer','skyHd','joinSky'];function loadPromoImage(container){container=$(container);var selectedPromo=selectRandomElement(promoList);if(container.up('#pageHeaderWrapper')){var img=new Image();img.src=IMAGE_BASE_URL+'sky1/promo/'+selectedPromo+'Over.png';}else{var img=new Image();img.src=IMAGE_BASE_URL+'sky1/promo/'+selectedPromo+'Over-360.png';}
var promo=container.down('.'+selectedPromo);promo.removeClassName('hidden');}
coedit.gallerynavControl=function(l_sElementId,l_pListOrder)
{if(arguments.length<1)
{throw new Error("Incorrect number of minimum parameters supplied when creating a Gallery Navigator Control.");}
if(document.getElementById(l_sElementId)==undefined)
{throw new Error("Could not find anything with id="+l_sElementId+" when creating a Gallery Navigator Control.");}
this.m_oTargetElement=document.getElementById(l_sElementId);this.m_pListOrder=l_pListOrder||[12,11,16,17,18,13,8,7,6,5,10,15,20,21,22,23,24,19,14,9,4,3,2,1,0];if(this.m_oTargetElement.getElementsByTagName('a').length>0){this.ParseDataIn();this.Decorate();this.firstLoaded=true;this.MouseOverLink({target:$$("div.linksWrapper a")[0]},true);this.lastSelectedElement=$$("div.linksWrapper a")[0];}};coedit.gallerynavControl.prototype.Decorate=function()
{this.m_pDecoratedData=[];var l_oControlWrapper=document.createElement('div');l_oControlWrapper.className="gallerynavControl";var l_oImagesWrapper=document.createElement('div');l_oImagesWrapper.className="imagesWrapper";var l_oLinksWrapper=document.createElement('div');l_oLinksWrapper.className="linksWrapper";for(var loop=0,max=this.m_pData.length;loop<max;loop++)
{var l_oImageLink=document.createElement('a');l_oImageLink.href=this.m_pData[loop].href;l_oImageLink.title=this.m_pData[loop].title;l_oImageLink.onmouseover=this.MouseOverImage.bind(this);l_oImageLink.onmouseout=this.MouseOutImage.bind(this);var l_oImage=document.createElement('img');l_oImage.src=this.m_pData[loop].imagesrc;l_oImage.alt='';l_oImage.myIndex=loop;l_oImage.myPosition=this.FindRelatedLink(loop);l_oImageLink.appendChild(l_oImage);l_oImagesWrapper.appendChild(l_oImageLink);var l_oLink=document.createElement('a');l_oLink.href=this.m_pData[this.GetOrderedIndex(loop)].href;l_oLink.title=this.m_pData[this.GetOrderedIndex(loop)].title;l_oLink.myPosition=this.GetOrderedIndex(loop);l_oLink.innerHTML=this.m_pData[this.GetOrderedIndex(loop)].name;l_oLink.onmouseover=this.MouseOverLink.bind(this);l_oLink.onmouseout=this.MouseOutLink.bind(this);l_oLinksWrapper.appendChild(l_oLink);}
var l_oInitialSplashDiv=$$('#'+this.m_oTargetElement.id+' div.gallerynavPreload')[0];l_oInitialSplashDiv.parentNode.removeChild(l_oInitialSplashDiv);var l_oList=this.m_oTargetElement.getElementsByTagName('dl')[0];l_oList.parentNode.removeChild(l_oList);l_oControlWrapper.appendChild(l_oImagesWrapper);l_oControlWrapper.appendChild(l_oLinksWrapper);this.m_oTargetElement.appendChild(l_oControlWrapper);this.m_oImagesWrapper=l_oImagesWrapper;this.m_oLinksWrapper=l_oLinksWrapper;};coedit.gallerynavControl.prototype.GetOrderedIndex=function(l_nIndex)
{var l_nOrderedIndex=this.m_pListOrder[l_nIndex];if(l_nOrderedIndex==undefined||l_nOrderedIndex==null)
{l_nOrderedIndex=l_nIndex;}
return l_nOrderedIndex;};coedit.gallerynavControl.prototype.FindRelatedLink=function(l_sPosition)
{for(var loop=0,max=this.m_pListOrder.length;loop<max;loop++)
{if(this.m_pListOrder[loop]==l_sPosition)break;}
return loop;};coedit.gallerynavControl.prototype.MouseOverLink=function(l_oEventData,userTriggered)
{if(userTriggered){var l_oNode=l_oEventData.target;}else{var l_oNode=(window.event)?event.srcElement:l_oEventData.target;}
var l_sPosition=l_oNode.myPosition;if(!this.firstLoaded){this.HideLink(this.lastSelectedElement);this.HideImage();}
this.firstLoaded=false;this.lastSelectedElement=l_oNode;this.RevealLink(l_oNode);this.RevealImage(this.m_oImagesWrapper.getElementsByTagName('a')[l_sPosition].getElementsByTagName('img')[0]);};coedit.gallerynavControl.prototype.MouseOverImage=function(l_oEventData)
{var l_oNode=(window.event)?event.srcElement:l_oEventData.target;var l_sPosition=l_oNode.myPosition;this.HideLink(this.lastSelectedElement);if(!this.firstLoaded){this.HideImage();}
this.firstLoaded=false;this.lastSelectedElement=this.m_oLinksWrapper.getElementsByTagName('a')[l_sPosition];this.RevealLink(this.m_oLinksWrapper.getElementsByTagName('a')[l_sPosition]);this.RevealImage(l_oNode);};coedit.gallerynavControl.prototype.MouseOutLink=function(l_oEventData){};coedit.gallerynavControl.prototype.MouseOutImage=function(l_oEventData){};coedit.gallerynavControl.prototype.RevealImage=function(l_oNode)
{Element.addClassName(l_oNode,'hilite');var l_nMyIndex=l_oNode.myIndex;var l_nCols=(this.m_pData.length==25)?5:(this.m_pData.length==16)?4:(this.m_pData.length==9)?3:(this.m_pData.length==4)?2:1;this.m_pImagesToHide=[l_nMyIndex];var l_pImmediateNeighbours=[l_nMyIndex-l_nCols,l_nMyIndex+l_nCols];if(l_nMyIndex%l_nCols>0)
{l_pImmediateNeighbours[l_pImmediateNeighbours.length]=l_nMyIndex-l_nCols-1;l_pImmediateNeighbours[l_pImmediateNeighbours.length]=l_nMyIndex-1;l_pImmediateNeighbours[l_pImmediateNeighbours.length]=l_nMyIndex+l_nCols-1;}
if(l_nMyIndex%l_nCols<l_nCols-1)
{l_pImmediateNeighbours[l_pImmediateNeighbours.length]=l_nMyIndex-l_nCols+1;l_pImmediateNeighbours[l_pImmediateNeighbours.length]=l_nMyIndex+1;l_pImmediateNeighbours[l_pImmediateNeighbours.length]=l_nMyIndex+l_nCols+1;}
for(var loop=0,max=l_pImmediateNeighbours.length;loop<max;loop++)
{if(l_pImmediateNeighbours[loop]>-1&&l_pImmediateNeighbours[loop]<this.m_pData.length)
{var l_oImageNode=this.m_oImagesWrapper.getElementsByTagName('a')[l_pImmediateNeighbours[loop]].getElementsByTagName('img')[0];Element.addClassName(l_oImageNode,'immediateNeighbour');this.m_pImagesToHide[this.m_pImagesToHide.length]=l_pImmediateNeighbours[loop];}}
if(l_nCols>3)
{var l_pDistantNeighbours=[l_nMyIndex-l_nCols-l_nCols,l_nMyIndex+l_nCols+l_nCols];if(l_nMyIndex%l_nCols>0)
{l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex-l_nCols-l_nCols-1;l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex+l_nCols+l_nCols-1;}
if(l_nMyIndex%l_nCols>1)
{l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex-l_nCols-l_nCols-2;l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex-l_nCols-2;l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex-2;l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex+l_nCols-2;l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex+l_nCols+l_nCols-2;}
if(l_nMyIndex%l_nCols<l_nCols-1)
{l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex-l_nCols-l_nCols+1;l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex+l_nCols+l_nCols+1;}
if(l_nMyIndex%l_nCols<l_nCols-2)
{l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex-l_nCols-l_nCols+2;l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex-l_nCols+2;l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex+2;l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex+l_nCols+2;l_pDistantNeighbours[l_pDistantNeighbours.length]=l_nMyIndex+l_nCols+l_nCols+2;}
for(var loop=0,max=l_pDistantNeighbours.length;loop<max;loop++)
{if(l_pDistantNeighbours[loop]>-1&&l_pDistantNeighbours[loop]<this.m_pData.length)
{var l_oImageNode=this.m_oImagesWrapper.getElementsByTagName('a')[l_pDistantNeighbours[loop]].getElementsByTagName('img')[0];Element.addClassName(l_oImageNode,'distantNeighbour');this.m_pImagesToHide[this.m_pImagesToHide.length]=l_pDistantNeighbours[loop];}}}};coedit.gallerynavControl.prototype.RevealLink=function(l_oNode)
{Element.addClassName(l_oNode,'hilite');};coedit.gallerynavControl.prototype.HideImage=function()
{for(var loop=0,max=this.m_pImagesToHide.length;loop<max;loop++)
{var l_oImageNode=this.m_oImagesWrapper.getElementsByTagName('a')[this.m_pImagesToHide[loop]].getElementsByTagName('img')[0];Element.removeClassName(l_oImageNode,'immediateNeighbour');Element.removeClassName(l_oImageNode,'distantNeighbour');Element.removeClassName(l_oImageNode,'hilite');}
this.m_pImagesToHide=null;delete this.m_pImagesToHide;};coedit.gallerynavControl.prototype.HideLink=function(l_oNode)
{Element.removeClassName(l_oNode,'hilite');};coedit.gallerynavControl.prototype.ParseDataIn=function()
{var l_oList=this.m_oTargetElement.getElementsByTagName('dl')[0];var l_nDT=l_oList.getElementsByTagName('dt');var l_nDD=l_oList.getElementsByTagName('dd');this.m_pData=[];for(var loop=0,max=l_nDT.length;loop<max;loop++)
{var l_sName=this.GetName(l_nDT[loop]);var l_sHref=this.GetHref(l_nDT[loop]);var l_sTitle=this.GetTitle(l_nDT[loop]);var l_sImageSrc=this.GetImageSrc(l_nDD[loop]);var l_sImageAlt=this.GetImageAlt(l_nDD[loop]);this.m_pData[loop]={'loop':loop,'name':l_sName,'href':l_sHref,'title':l_sTitle,'imagealt':l_sImageAlt,'imagesrc':l_sImageSrc};}};coedit.gallerynavControl.prototype.GetName=function(l_oDT)
{return l_oDT.getElementsByTagName('a')[0].innerHTML;};coedit.gallerynavControl.prototype.GetHref=function(l_oDT)
{return l_oDT.getElementsByTagName('a')[0].href;};coedit.gallerynavControl.prototype.GetTitle=function(l_oDT)
{return l_oDT.getElementsByTagName('a')[0].title;};coedit.gallerynavControl.prototype.GetImageSrc=function(l_oDD)
{return l_oDD.getElementsByTagName('img')[0].src;};coedit.gallerynavControl.prototype.GetImageAlt=function(l_oDD)
{return l_oDD.getElementsByTagName('img')[0].alt;};function initialiseSixDegreesModule(){attachClickEventsToSixDegreesAnchors();};function attachClickEventsToSixDegreesAnchors(){var anchorArray=$$('#sixDegreesModule ul a');anchorArray.each(function(anchor){Event.observe(anchor,'click',sixDegreesClickHandler);});var moduleTopSliceWrapper=$$('#sixDegreesModule .topSliceWrapper');if(moduleTopSliceWrapper.length){var resetButton=document.createElement('a');resetButton.href=window.sixDegreesResetLocator;resetButton.className='resetLink';resetButton.innerHTML='Reset';moduleTopSliceWrapper[0].appendChild(resetButton);Event.observe(resetButton,'click',sixDegreesClickHandler);}};function sixDegreesClickHandler(eventData){var anchor=Event.element(eventData);anchor.blur();var locator=anchor.href.substr(anchor.href.lastIndexOf('/')+1);var params="locator="+locator+'&cacheBuster='+new Date().getTime();new Ajax.Updater('sixDegreesModule','/celeb/sixDegreesUpdate',{method:'get',evalScripts:true,parameters:params,onComplete:attachClickEventsToSixDegreesAnchors})
Event.stop(eventData);};moduleManager.registerModuleLoad(initialiseSixDegreesModule);var UA=navigator.userAgent;var safari2Mac=(UA.indexOf('Mac')!=-1&&UA.indexOf('Version/')==-1&&UA.indexOf('Safari/')!=-1);if(safari2Mac){var dot1=location.hostname.lastIndexOf(".");var domainPart=location.hostname.substring(0,dot1);var dot2=domainPart.lastIndexOf(".");if(domainPart.substring(dot2+1,dot1)=="co"){domainPart=location.hostname.substring(0,dot2);dot2=domainPart.lastIndexOf(".");}
document.domain=location.hostname.substring(dot2+1);}
moduleManager.registerModuleLoad(setupInlineGallery);var inlineGallery=false;var inlineGalleryExpandedDiv=null;var inlineGalleryCollapsedBar=null;var expanded=true;function setupInlineGallery(){inlineGallery=$$('#inlineAsset .gallery').length>0;var inlineAsset=$('inlineAsset');if(inlineAsset){inlineGalleryExpandedDiv=inlineAsset.select('#galleryImageWrapper')[0];if(galleryViewer===null)initialiseGalleryViewer();}}
function SPHost(hostId,brandName,placeHolder,startPageUrl)
{var STANDALONE_WINDOW_FEATURES='width=540,height=446,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no';var CURRENT_POSITION_QS='currentPosition';var POPPED_QS='popped';var HOST_ID_QS='hostId';this.hostId;this.brandName;this.placeHolder;this.startPageUrl;var _playerIframe;SPHost.prototype.createSyndicatedPlayer=function()
{var container=document.createElement("div");container.className='syndicatedPlayerContainer';_playerIframe=document.createElement("iframe");_playerIframe.className='middle';_playerIframe.setAttribute("scrolling",'no');_playerIframe.setAttribute("frameborder",'0');_playerIframe.src=this._buildPlayUrl(this.startPageUrl);container.appendChild(_playerIframe);this.placeHolder.appendChild(container);}
this._setInnerText=function(element,value){if(document.all)
element.innerText=value;else
element.textContent=value;}
this._buildPlayUrl=function(baseUrl){var qschar=baseUrl.indexOf("?")>=0?"&":"?";return baseUrl+=qschar+HOST_ID_QS+"="+this.hostId;}
this._buildPlayDetachedUrl=function(baseUrl){return this._buildPlayUrl(baseUrl)
+"&"+CURRENT_POSITION_QS+'=0'
+'&'+POPPED_QS+'=true';}
SPHost.prototype.play=function(baseUrl){var fullUrl=this._buildPlayUrl(baseUrl);_playerIframe.src=fullUrl;return false;}
SPHost.prototype.playDetached=function(baseUrl){var fullUrl=this._buildPlayDetachedUrl(baseUrl);fullUrl=fullUrl.replace("playSyndicate","detachedSyndicated");var uniqueWindowName='syndicatePlayer'+Math.floor(Math.random()*1000000);window.open(fullUrl,uniqueWindowName,STANDALONE_WINDOW_FEATURES);return false;}}
var UA=navigator.userAgent;var safari2Mac=(UA.indexOf('Mac')!=-1&&UA.indexOf('Version/')==-1&&UA.indexOf('Safari/')!=-1);if(safari2Mac){var dot1=location.hostname.lastIndexOf(".");var domainPart=location.hostname.substring(0,dot1);var dot2=domainPart.lastIndexOf(".");if(domainPart.substring(dot2+1,dot1)=="co"){domainPart=location.hostname.substring(0,dot2);dot2=domainPart.lastIndexOf(".");}
document.domain=location.hostname.substring(dot2+1);}