var tmo;function positionLightboxImage(){var a=($(window).width()-650)/2;$("#popup").css({width:650,height:$(window).height(),top:0+$(document).scrollTop(),left:a}).fadeIn();$("#overlay").css("height",$(window).height());$(window).resize(function(){clearTimeout(tmo);tmo=setTimeout("positionLightboxImage()",10)})}function removeLightbox(){$("#overlay, #popup").remove();$("body").removeClass("stopscroll");$("html").removeClass("stopscrollhtml");$("object, embed").show()}
function popup(){$("body").addClass("stopscroll");$("html").addClass("stopscrollhtml");$("object, embed").hide();$('<div id="overlay"></div>').css("top",$(document).scrollTop()).css("opacity","0.8").css("height",$(window).height()).click(function(){removeLightbox()}).appendTo("body");$('<div id="popup"></div>').hide().appendTo("body");$("#close a").click(function(){removeLightbox()});$("#popup").load("/telegraph_review",function(){$(this).prepend('<p id="close"><a href="#">close</a></p>');$("#close").css("text-align",
"right").click(function(){removeLightbox()});positionLightboxImage()})}var currentslide=0,nextslide=0;
function showslide(){$(".news_scroller").css({height:"30px",position:"relative",overflow:"hidden"});$("#news").css("height","auto");$(".newstext").css({position:"absolute","white-space":"nowrap"});$("#news .newspic, #news .news_scroller").hide();$("#news .news_scroller:eq("+currentslide+"), #news .newspic:eq("+currentslide+")").show();$("#news .news_scroller:eq("+currentslide+")").SetScroller({velocity:80,direction:"horizontal",startfrom:"right",loop:1,movetype:"linear",onmouseover:"play",onmouseout:"play",
onstartup:"play",cursor:"pointer"},function(){nextslide=currentslide+1;if(nextslide>=$("#news .newspic").length)nextslide=0;$("#news").css({background:"url('"+$("#news .newspic:eq("+nextslide+") img").attr("src")+"')","background-repeat":"no-repeat"});$("#news .newspic:eq("+currentslide+")").fadeOut("slow",function(){currentslide=nextslide;showslide()})})}$(function(){showslide();$("a#telegraph_review").click(function(){popup();return false})});
