/* !user_scripts */
var doNewWin=function(){$("a[href^='http://'], a[href^='https://']").addClass("newwin");$("a[href*='"+URL.domain+"'], a[href*='"+URL.domain.split("www.")[1]+"']").removeClass("newwin");$("a.newwin, a.newWin").each(function(){var x=$(this);var linkTitle="(This link opens a new window)";var newTitle=(empty(x.attr("title")))?linkTitle:x.attr("title")+" "+linkTitle;x.attr("title",newTitle);x.removeClass("newwin").removeClass("newWin").addClass("ext");if(x.children("img:first").length>0)x.addClass("isImg");x.click(function(){window.open(x.attr("href"));return false;});});};var linkIcons=function(){$("#outer a[href$='.pdf']").each(function(){var x=$(this);var linkTitle="(Download PDF)";var newTitle=(empty(x.attr("title")))?linkTitle:x.attr("title")+" "+linkTitle;x.addClass("pdf").attr("title",newTitle);x.click(function(){window.open(x.attr("href"));return false;});});};
/* !slideshow_gallery */
var doSlideshow=function(info,count){if(info.length==1)
{return false;}
if(count===undefined){count=1;$.each(info,function(){$("<img>").attr("src",this.Path);});}
if(count==info.length){count=0;}
setTimeout(function(){changeSlide(info,count);},5000);};var changeSlide=function(info,count){var show=$("body .SlideshowArea img:first").parent();var img=show.find("img:first");var nImg=$("<img>").attr({'src':info[count].Path,'width':info[count].width,'height':info[count].height,'alt':info[count].Name}).prependTo(show).hide();img.fadeOut(500,function(){$(this).remove();nImg.fadeIn(500);});show.find('.description').html(info[count].Description);count++;doSlideshow(info,count);};var galleryClicks=function(){$("body .ImageGalleryArea").each(function(){var gallery=$(this);var image=gallery.find("img:first");var link=gallery.find("a.lightbox");var desc=gallery.find(".description");var links=gallery.find("ul.galleryThumbs li a");links.click(function(){var thumb=$(this).find("img:first");var src='';if(thumb.length===0){thumb=$(this).find("span:first");src=thumb.attr("rel");}else{src=thumb.attr("src").replace("-t.","-m.");}
var size=$(this).attr("rel").split(',');image.attr({"width":size[0],"height":size[1],"alt":thumb.attr("alt"),"src":src});link.attr("href",src.replace("-m.","."));desc.html($(this).attr("title"));return false;});});};
/* !highlight_page */
var highlight_page=function(){var page=(URL.path+URL.file).replace("/ap/index.php","").replace("/index.php","");if(page=="/")
{page="/home/";}
$("a[href^='"+page+"']").addClass("current_page");};
/* !load_user_scripts */
jQuery(document).ready(function(){doNewWin();linkIcons();galleryClicks();highlight_page();});

