
﻿
function GetContentHTMLForColourBox()
{var html=null;var content=$(".Html",$(this));if(content.length>0)
{html=content.attr('title');}
else
{html=$(this).html();}
return html;};function StartOverlay(event)
{var clickID="";if(event.target.id!="")
{clickID=event.target.id;}
else
{clickID=$(this).attr('id');}
var targetID="#ColourBoxContent #cbItem"+clickID;$(targetID).colorboxLaunch();return false;};jQuery(document).ready(function()
{$("#BodyWrapper").jSlowLoadImages({loadClass:".BaseLoad",onComplete:StartNewsScroller});function StartNewsScroller()
{$("#NewsListScroll0").jCirculet({scrollSpeed:1000,repeatInterval:6000,visibleItems:1,scrollItems:1,startItem:0,vertical:true,sourceList:'NewsListScrollerContent0'}).jCirculetStartAutomatic();};});(function($)
{var context={type:"jSlowLoader",count:0};$.fn.jSlowLoadImages=function(options)
{var defaults={loadClass:".Firstload",onComplete:null};if(this.length>1)
{this.each(function(){$(this).jSlowLoadImages(options);});}
else
{if(options)
{options=this.extend({},defaults,options);}
else
{options=defaults;}
var container=$(this),slowLoadItems=$(options.loadClass,container),totalCountSL=0,itemCountSL=0;var slowLoadId="jSL"+context.count;context.count++;var slowLoad=$("<div></div>",{"id":slowLoadId,"class":"jSlowLoad"}).css({"display":"none"}).appendTo("body");if(slowLoadItems.length>0)
{for(var i=0;i<slowLoadItems.length;i++)
{totalCountSL+=i;}
options.state={slowLoad:null,total:totalCountSL,item:itemCountSL,image:{}};options.state.slowLoad=slowLoad;var slowLoadIdSelector="#"+slowLoadId;$(slowLoadIdSelector).data("jSL",options);slowLoadItems.each(function()
{$(this).data("jSL",slowLoadIdSelector);});slowLoadItems.each(LoadImageData);}
else
{if(options.onComplete)options.onComplete.call(slowLoad);}}
return(this);};function LoadImageData(itemIndex,domElement)
{var options=$($(this).data("jSL")).data("jSL");if(options)
{var imageHtml=$(this).attr('title');if(imageHtml&&(imageHtml.slice(0,3).toUpperCase().indexOf("IMG")!=-1))
{imageHtml.replace("'","\"");imageHtml="<"+imageHtml+" />";var parent=$(this).parent();$(this).remove();var imageLoad=$(imageHtml).appendTo(parent);options.state.image[itemIndex]=imageLoad;imageLoad.one("error",OnImageError(options,itemIndex));imageLoad.one("load",OnImageLoad(options,itemIndex));if(imageLoad[0].complete||(jQuery.browser.msie&&parseInt(jQuery.browser.version)==6))
{$(imageLoad).trigger("load");}}}};function OnImageLoad(options,itemIndex)
{return(function()
{$(options.state.image[itemIndex]).show();options.state.item+=itemIndex;if(options.state.item>=options.state.total)
{if(options.onComplete)
{options.onComplete.call(options.state.slowLoad);options.onComplete=null;}}});};function OnImageError(options,itemIndex)
{return(function()
{options.state.item+=itemIndex;if(options.state.item>=options.state.total)
{if(options.onComplete)
{options.onComplete.call(options.state.slowLoad);options.onComplete=null;}}});};})(jQuery);(function($)
{function animateSlides(elem,options)
{return(function()
{$(elem).children().eq(0).fadeOut(options['speedOut']).next().fadeIn(options['speedIn']).end().appendTo(elem);});};$.fn.simplestSlideShow=function(options)
{var defaults={timeOut:3000,speedOut:'normal',speedIn:'normal'};if(this.length>1)
{this.each(function(){$(this).simplestSlideShow(options)});}
else
{if(options)
{options=this.extend({},defaults,options);}
else
{options=defaults;}
$(this).data("jSSShow",options);}
return this;};$.fn.simplestSlideShowStart=function()
{if(this.length>1)
{this.each(function(){$(this).simplestSlideShowStart()});}
else
{var options=$(this).data("jSSShow");if(options)
{$(this).children(':gt(0)').hide();setInterval(animateSlides(this,options),options['timeOut']);}}
return this;};})(jQuery);(function($)
{var context={type:"jCirculet",itemTemplateHtml:"<div class='ScrollItem'></div>"};$.fn.jCirculet=function(options)
{var defaults={scrollSpeed:800,repeatInterval:3800,visibleItems:3,scrollItems:1,startItem:0,vertical:true,paused:false,sourceList:'',clickHandler:null,index:0,deBounce:true,timerId:null,setGeometry:true,scrollComplete:null,pauseHandler:null,state:null};if(this.length>1)
{this.each(function(index){options.index=index;$(this).jCirculet(options)});}
else
{if(options)
{options=this.extend({},defaults,options);}
else
{options=defaults;}
var currentItem=options.startItem;var scrollOuterDiv=$(this);var scrollDiv=$(".ScrollInner",scrollOuterDiv);var sourceItems=null;if(options.sourceList=='')
{var sourceDiv=$(".ScrollerContent0",scrollOuterDiv);sourceItems=$(".ScrollItem",sourceDiv);}
else
{var sourceListID="#"+options.sourceList+" .ScrollItem";sourceItems=$(sourceListID);}
var scrollerItemCount=sourceItems.length;scrollDiv.css({position:"relative"});scrollOuterDiv.css({overflow:"hidden",position:"relative"});options.state={currentItem:options.startItem,scrollOuterDiv:$(this),scrollDiv:$(".ScrollInner",scrollOuterDiv),sourceItems:sourceItems,scrollItems:null,scrollerItemCount:sourceItems.length,siSize:0};AddToScroll(options,options.visibleItems);var scrollItems=$(".ScrollItem",scrollDiv);options.state.scrollItems=scrollItems;if(options.deBounce==true&&options.pauseHandler!=null)
{$(this).jDebounce({target:options.pauseHandler,deBounceID:"pause"});}
scrollOuterDiv.hover(HoverIn,HoverOut);if(options.clickHandler!=null)
{$(scrollItems).live('click',ClickHandler(options.clickHandler));}
$(this).data("jCirculet",options);if(options.setGeometry==true)
{$(this).jCirculetSetGeometry();}}
return this;};$.fn.jCirculetSetGeometry=function()
{if(this.length>1)
{this.each(function(){$(this).jCirculetSetGeometry()});}
else
{var options=$(this).data('jCirculet');if(options)
{var scrollerItemSize=options.state.scrollItems.eq(0)[0].offsetHeight;var divSize=scrollerItemSize*options.visibleItems;options.state.scrollOuterDiv.css("height",divSize+"px");options.state.siSize=scrollerItemSize;}}
return this;};function hoverToggle(options)
{var target=this;if(options.pauseHandler!=null)
{if(options.deBounce==true)
{$(target).jDebounceToggle("pause",options.paused);}
else
{options.pauseHandler.call(target,options.paused);}}};function HoverIn()
{var options=$(this).data('jCirculet');options.paused=true;hoverToggle.call(this,options);};function HoverOut()
{var options=$(this).data('jCirculet');options.paused=false;hoverToggle.call(this,options);};function ClickHandler(handler)
{return(function(e)
{if(e.button!==0&&typeof e.button!=='undefined')
{return true;}
else
{return(handler.call(this,e));}});};$.fn.jCirculetStartAutomatic=function()
{if(this.length>1)
{this.each(function(){$(this).jCirculetStartAutomatic()});}
else
{var options=$(this).data('jCirculet');if(options&&(options.repeatInterval>0))
{if(options.timerId==null)
{options.timerId=setInterval(ScrollTimer(this,options),options.repeatInterval);}}}
return this;};$.fn.jCirculetStartOneShot=function(delay)
{if(this.length>1)
{this.each(function(index){$(this).jCirculetStartOneShot(delay);});}
else
{var options=$(this).data('jCirculet');if(options)
{if(delay&&delay>0)
{if(options.timerId==null)
{options.timerId=setTimeout(ScrollTimer(this,options),delay);}}
else
{ScrollAction.call(this,options);}}}
return this;};$.fn.jCirculetManualScroll=function()
{if(this.length>1)
{this.each(function(index){$(this).jCirculetManualScroll();});}
else
{var options=$(this).data('jCirculet');ScrollAction.call(this,options);}
return this;};function ScrollTimer(target,options)
{return(function()
{ScrollAction.call(target,options);options.timerId=null;});};function ScrollAction(options)
{if(options&&!options.paused)
{AddToScroll(options,options.scrollItems);var siSize=options.state.siSize;options.state.scrollDiv.animate({top:-(options.scrollItems*siSize)},options.scrollSpeed,null,OnAnimationComplete(this,options));}};function OnAnimationComplete(target,options)
{return(function()
{var scrollItems=$('.ScrollItem',options.state.scrollDiv).slice(0,options.scrollItems);scrollItems.remove();options.state.scrollDiv.css("top","0px");if(options.scrollComplete!=null)
{options.scrollComplete.call(target,options.index);}});};function AddToScroll(options,count)
{var state=options.state;for(var i=0;i<count;i++)
{state.sourceItems.eq(state.currentItem).clone().appendTo(state.scrollDiv);if((++state.currentItem)>=state.scrollerItemCount)
{state.currentItem=0;}}};})(jQuery);(function($)
{var defaults={timerId:null,state:false,interval:380,target:null,deBounceID:""};$.fn.jDebounce=function(options)
{if(this.length>1)
{this.each(function(){$(this).jDebounce(options);});}
else
{if(options)
{options=this.extend({},defaults,options);}
else
{options=defaults;}
$(this).data("jDebounce"+options.deBounceID,options);}
return(this);};$.fn.jDebounceToggle=function(deBounceID,toggle)
{if(this.length>1)
{this.each(function(index){$(this).jDebounceToggle(deBounceID,toggle);});}
else
{var options=$(this).data(("jDebounce"+deBounceID));var t=this;if(options&&(options.target!=null))
{if(options.timerId!=null)
{if(options.state!=toggle)
{clearTimeout(options.timerId);options.timerId=null;}}
else
{options.state=toggle;options.timerId=setTimeout(function()
{options.target.call(t,toggle);options.timerId=null;},options.interval);}}}
return this;};$.fn.jDebounceSolo=function(deBounceID)
{if(this.length>1)
{this.each(function(index){$(this).jDebounceToggle(deBounceID);});}
else
{var options=$(this).data(("jDebounce"+deBounceID));var t=this;if(options&&(options.target!=null))
{if(options.timerId!=null)
{clearTimeout(options.timerId);options.timerId=null;}
options.timerId=setTimeout(function()
{options.target.call(t);options.timerId=null;},options.interval);}}
return this;};})(jQuery);(function($,undefined)
{var context={type:"jCascade",count:0};$.fn.jCascade=function(options)
{var defaults={currentScroll:0,repeatTime:10000,intervalTime:1200,repeatTimerId:null,scrollCompleteCount:0,scrollCount:0,scrollStart:0,scrollerOptionsCallback:null,scrollCollection:""};if(this.length>1)
{}
else
{if(options)
{options=this.extend({},defaults,options);}
else
{options=defaults;}
var scrollOptions={};if(options.scrollerOptionsCallback!=null)
{scrollOptions=options.scrollerOptionsCallback();}
var extras={scrollComplete:RelayScroll,pauseHandler:ToggleHandler};scrollOptions=$.fn.extend({},scrollOptions,extras);var cascadeId="cascade"+context.count;context.count++;var cascade=$("<div></div>",{"id":cascadeId,"class":"jCascade"}).appendTo("body");options.currentScroll=options.scrollStart;if(options.scrollCollection!="")
{$(options.scrollCollection).jCirculet(scrollOptions);for(var i=0;i<$(options.scrollCollection).length;i++)
{options.scrollCompleteCount+=i;}
$("#"+cascadeId).data("jCascade",options);$(options.scrollCollection).each(function()
{$(this).data("jCascade",cascadeId).addClass("jCascade");});}}
return(this);};$.fn.jCascadeStart=function(index)
{if(this.length>1)
{this.each(function(index){$(this).jCascadeStart(index)});}
else
{var counter=0;if(index!==undefined)
{counter=index;}
var options=$("#cascade"+counter).data("jCascade");if(options)
{options.repeatTimerId=setTimeout(ActivateScrollDelay(options),options.repeatTime);}}
return(this);};function RelayScroll(index)
{var selector="#"+$(this).data("jCascade");var context=$(selector).data("jCascade");var count=index+1;if(context)
{if(count>=$(context.scrollCollection).length)
{count=0;}
context.currentScroll=count;context.scrollCount+=index;if(context.scrollCount>=context.scrollCompleteCount)
{context.scrollCount=0;context.currentScroll=context.scrollStart;context.repeatTimerId=setTimeout(ActivateScrollDelay(context),context.repeatTime);}}};function ActivateScrollDelay(context)
{return(function()
{ActivateScroll(context);context.repeatTimerId=null;});};function ActivateScroll(context)
{var collection=null;if(context)
{collection=$(context.scrollCollection).slice(context.currentScroll);collection.each(startScroll);}};function startScroll(index)
{var context="#"+$(this).data("jCascade");context=$(context).data("jCascade");$(this).jCirculetStartOneShot((index*context.intervalTime));};function ToggleHandler(toggle)
{var selector="#"+$(this).data("jCascade");var context=$(selector).data("jCascade");if(context)
{if(!toggle)
{ActivateScroll(context);}
else
{clearTimeout(context.repeatTimerId);context.repeatTimerId=null;$(context.scrollCollection).each(function()
{var thisScroller=$(this).data('jCirculet')
clearTimeout(thisScroller.timerId);thisScroller.timerId=null;});}}};})(jQuery);
