(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);function reelTime($speed,$duration,$bgColor,$color,$controlHover,$captionStyle,$texture,$startState,$fitScreen,$width,$height){$(document).ready(function(){$("#rtFsImg").hide();$("#reelTime, #rtImgs").css({overflow:"hidden"});var $aTitle="Find Out More &#62;&#62;";var $rtLink="";var $paused=0;var $rw=0;var $imgQty=$("#rtImgs img").length;var $activePos=0;var $widthpx=$width+"px";var $heightpx=$height+"px";var $activeNumber;var $whereAmI;var $killClicks=0;var $activePos;var $nextPos;var $intervalId=0;$("#rtLoad").css({width:$widthpx,height:$heightpx});var colors={blue:"#1826a8",teal:"#00a5b4",magenta:"#bf0844",black:"#000000",charcoal:"#282828",lightgrey:"#bfbfbf",pink:"e028c4",red:"#c80828",orange:"#e4670c",green:"#00a43c",yellow:"#e4c703",brown:"#592a0e",white:"#FFFFFF",purple:"#622e8a"};for(x in colors){if($bgColor==x){$bgColor=colors[$bgColor]}};for(x in colors){if($color==x){$color=colors[$color]}};$("#rtCaption,#rtPos").css({color:$color});if(!(($(".active").index("#rtImgs img"))>-1)){$("#rtImgs img").eq(0).addClass("active");$activePos=0};function findActive(){$activePos=$(".active").index("#rtImgs img")};findActive();function findNext(){if($rw==0){if($activePos==($imgQty-1)){$nextPos=0}else{$nextPos=$activePos+1}}else{if($activePos==0){$nextPos=$imgQty-1}else{$nextPos=$activePos-1}};if(($("#rtImgs img.nextAct"))>-1){$("#rtImgs img.nextAct").removeClass("nextAct")};$("#rtImgs img").eq($nextPos).addClass("nextAct").show()};if($fitScreen!="yes"){$("#rtFs").hide()}else{var $windowW;var $windowH;var $imgScaleW;var $imgScaleH;var $xOffset;var $yOffset;var $fsImgW;var $fsImgH;var $fsImgWpx;var $windowHpx;var $windowWpx;var $fsMarginL;var $fsMarginT;var $fsImgSrc;var $xOffsetN;var $yOffsetN;var $fsScale;var $fsScroll;var $rtGo=0;function rtFs(){$windowW=$(window).width();$windowH=$(window).height();$imgScaleW=($windowW/$width);$imgScaleH=($windowH/$height);if($imgScaleW<=$imgScaleH){$fsScale=$imgScaleW}else{$fsScale=$imgScaleH};$fsScroll=$(window).scrollTop();$xOffsetN=(-($("#reelTime").offset().left));$yOffsetN=(-($("#reelTime").offset().top)+$fsScroll);$xOffset=$yOffsetN+"px";$yOffset=$yOffsetN+"px";$fsImgW=(Math.floor(($width*$fsScale)));$fsImgH=(Math.floor(($height*$fsScale)));$fsImgWpx=$fsImgW+"px";$fsImgHpx=$fsImgH+"px";$windowWpx=$windowW+"px";$windowHpx=$windowH+"px";$fsMarginL=(Math.floor(($windowW-$fsImgW)/2))+"px";$fsMarginT=(Math.floor(($windowH-$fsImgH)/2))+"px";$fsImgSrc=$("#rtImgs img.active").attr("src");$("#rtFsImg").css({width:$windowWpx,height:$windowHpx,top:$yOffsetN,left:$xOffsetN});$("#rtFsImg").html("<img src='"+$fsImgSrc+"' width='"+$fsImgW+"' height='"+$fsImgH+"' />");$("#rtFsImg img").css({marginTop:$fsMarginT,marginLeft:$fsMarginL})};rtFs();$(window).resize(function(){if($rtGo==1){rtFs()}});$(window).scroll(function(){if($rtGo==1){rtFs()}});function rtFsTrue(){rtFs();$("#rtFsImg img").hide();$("#rtFsImg").show($speed,function(){$("#rtFsImg img").fadeIn($speed)});$rtGo=1};function rtFsFalse(){$("#rtFsImg").fadeOut($speed);$rtGo=0}};if($startState=="play"){$paused=0;$("#rtPlay").hide()}else{$paused=1;$("#rtPause").hide()};if($captionStyle=="hide"){$("#rtCaption, #rtLink").hide()};if($captionStyle!="bold"){$captionStyle="normal"};function writeCaption(){$activeNumber=$activePos+1;if($("#rtImgs img.active").attr("alt")){$caption=$("#rtImgs img.active").attr("alt")+" &nbsp; | &nbsp; ";$whereAmI=$activeNumber+"/"+$imgQty}else{$caption="";$whereAmI=""};$("#rtCaption").html($caption);$("#rtPos").text($whereAmI)};writeCaption();function writeLink(){if($("#rtImgs img.active").parent("a").attr("href")){if($("#rtImgs img.active").parent("a").attr("title")){$aTitle=$("#rtImgs img.active").parent("a").attr("title")+" &#62;&#62;"}else{$aTitle="Find Out More &#62;&#62;"};$rtLink="<a href='"+$("#rtImgs img.active").parent("a").attr("href")+"'>"+$aTitle+"</a>"}else{$rtLink=""};$("#rtLink").html($rtLink);$("#rtLink a").css({color:$color})};writeLink();$("#rtControls, #rtBack, #rtPlay, #rtPause, #rtFwd, #rtFs, #rtText, #rtCaption, #rtLink, #rtPos").addClass("zero");$("#reelTime").css({width:$widthpx,height:$heightpx});$("#rtImgs img").each(function(){$(this).attr("height",$height);$(this).attr("width",$width)});if($texture=="gloss"){$("#rtControls").removeClass("zero").addClass("zeroGloss")};$("#rtControls").css({backgroundColor:$bgColor});function applyHover(themeItem){$(themeItem).hover(function(){$(this).removeClass("zero").addClass("zeroHover")},function(){$(this).removeClass("zeroHover").addClass("zero")})};applyHover("#rtBack");applyHover("#rtPlay");applyHover("#rtPause");applyHover("#rtFwd");applyHover("#rtFs");if($controlHover=="yes"){$("#rtControls, #rtText").hide();var $delayHover=$speed*1.62;function rtFadeIn(){$("#rtControls, #rtText").fadeIn($speed)};function rtFadeOut(){$("#rtControls, #rtText").fadeOut($speed)};var $hoverDelay={over:rtFadeIn,timeout:$delayHover,out:rtFadeOut};$("#reelTime").hoverIntent($hoverDelay)};var $offsetBar=($height-24)+"px";if($fitScreen=="yes"){var $textWidth=($width-142)+"px"}else{var $textWidth=($width-109)+"px"};$("#rtControls").css({width:$widthpx,top:$offsetBar});$("#rtText").css({width:$textWidth,top:$offsetBar});$("#rtCaption").css({fontWeight:$captionStyle});$("#rtLink").css({fontWeight:$captionStyle});$("#rtPos").css({fontWeight:$captionStyle});$("#rtBack").click(function(){if($killClicks==0){$rw=1;rtPause();rtSwitch();rtLoop()}});function rtPlay(){if($killClicks==0){$("#rtPlay").hide();$("#rtPause").show();clearInterval($intervalId);$paused=0;rtLoop()}};$("#rtPlay").click(function(){rtPlay()});function rtPause(){if($killClicks==0){$("#rtPause").hide();$("#rtPlay").show();$paused=1;clearInterval($intervalId)}};$("#rtPause").click(function(){rtPause()});$("#rtFwd").click(function(){if($killClicks==0){$rw=0;rtPause();rtSwitch()}});$("#rtFs").click(function(){if($killClicks==0){rtPause();rtFsTrue();$("#reelTime, #rtImgs").css({overflow:"visible"})}});$("#rtFsImg").click(function(){rtFsFalse();if($startState=="play"){rtPlay()}});function rtSwitch(){$killClicks=1;findActive();findNext();$("#rtImgs img.active").fadeOut($speed,function(){$("#rtImgs img.active").removeClass("active");$("#rtImgs img.nextAct").removeClass("nextAct").addClass("active");findActive();writeCaption();writeLink();$killClicks=0})};function rtLoop(){if($paused==0){$intervalId=setInterval(rtSwitch,$duration)}};$("#rtImgs img").one('load',function(){$("#rtLoad").fadeOut($speed);if($startState=="play"){rtPlay()}}).each(function(){if(this.complete)$(this).load()})})};
