$(document).ready(function(){writeFlash();callCycle();correctRightColHeight();$(".controls a").hover(on,off)});function correctRightColHeight(){setTimeout(function(){var a=$("#content").height();$("div.rightCol").css({height:a+"px"})},2000)}function callCycle(){$('<div class="slide-controls"><a class="previous-slide" href="#">Previous slide</a><ul class="controls"></ul><a class="next-slide" href="#">Next slide</a></div>').appendTo("#slideshow");$("#the").cycle({timeout:5000,delay:2000,speed:500,pager:".controls",next:".next-slide",prev:".previous-slide",before:onAfter,pagerAnchorBuilder:function(b,a){var c=$("img",a).attr("rel");return'<li><a href="#" rel="'+$(a).attr("rel")+'" class="slide-item"></a><div class="tooltip"><h3>'+a.title+"</h3></div></li>"}});$("a.next-slide,a.previous-slide,a.slide-item").click(function(){$("#the").cycle("pause")})}function getExt(a){return(/[.]/.exec(a))?/[^.]+$/.exec(a.toLowerCase()):""}function writeFlash(){$.each($("#the li"),function(d){var c=$("img",$(this));var b=$(c).attr("src");var e=getExt(b);if(e=="swf"){var a='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="291" height="126" id="slide'+d+'"><param name="wmode" value="transparent" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="'+b+'" /><embed src="'+b+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="291" height="126" wmode="transparent"></embed></object>';$(c).remove();$(this).prepend(a)}})}var indexdepth=0;function onAfter(){var a=$(this).attr("rel");var b='<img src="'+a+'" alt=""/>';$(".image-panel").prepend(b);$(".image-panel img:first-child").css({opacity:0}).fadeTo(1000,1).css("zIndex",indexdepth++);if($(".image-panel").children().length>2){$(".image-panel img:last-child").remove()}replaceBackgroundImage()}function replaceBackgroundImage(){$("div.backgroundImage").removeAttr("style")}function rewriteFlash(){var a={src:"/templates/public/flash/crankMinus.swf"};var b={src:"/templates/public/flash/crankPlus.swf"};sIFR.activate(a);sIFR.activate(b);sIFR.replace(b,{selector:".tactical-title",wmode:"transparent",css:[".sIFR-root { color: #ef3e42;leading:-5; }"],tuneHeight:-5,offsetTop:0});sIFR.replace(a,{selector:".tactical-date",wmode:"transparent",forceSingleLine:true,css:[".sIFR-root { color: #666666;}"],tuneHeight:-2,offsetTop:-2})}function on(){$(this).parent().addClass("on")}function off(){$(this).parent().removeClass("on")};
