var pageID='';
      $(document).ready(function(){
        if (window.location.href.search(/print/) != -1) {
          $("head > link").each(function(i){
            this.disabled = true;
            if ($(this).attr("title") == "print") this.disabled = false;
          });
          $("div.withimgFullWidth:not(:first)").each(function(i){
            $(this).hide();
          });
          window.setTimeout("window.print();", 500);
        }
        // Highlight Links in left and right column
        $("#leftcolumn a").each(function(){
          currentPage = document.location.href.substr(document.location.href.lastIndexOf("/")+1);
          linkedPage = $(this).attr("href").substr($(this).attr("href").lastIndexOf("/")+1);
          if(currentPage == linkedPage && $(this).attr("href").substr(0,1) == "/"){
            $(this).css("font-weight","bold");
          }
        });
        $("#rightcolumn a").each(function(){
          currentPage = document.location.href.substr(document.location.href.lastIndexOf("/")+1);
          linkedPage = $(this).attr("href").substr($(this).attr("href").lastIndexOf("/")+1);
          if(currentPage == linkedPage && $(this).attr("href").substr(0,1) == "/"){
            $(this).css("font-weight","bold");
          }
        });
        // Image-Paging
        if($("#paging").length > 0){
            if( $("#paging > div").size() > 1){
                $("#LayerButton").show();
            }
            
            $("#LayerButton a.next").click(function(){                                                
                var current = $("#paging > div:visible");
                var next = current.next('div');            
                if(next.length == 0) {                 
                    next = $("#paging > div:first");
                }
                $("#paging > div:visible").hide();            
                next.show();                                    
            });
            
            $("#LayerButton a.prev").click(function(){                                                
                var current = $("#paging > div:visible");
                var prev = current.prev('div');            
                if(prev.length == 0) {                 
                    prev = $("#paging > div:last");
                }
                $("#paging > div:visible").hide();            
                prev.show();                                    
            });
        }
        
        // Library Open/Close
        $("div[id^=switch_] a").each(function(){          
          $(this).attr("href", "javascript:void(0);");
          $(this).click(function() {
            $divLibrary = $(this).parent();
            divId = $divLibrary.attr("id");
            pageIdArr = divId.split("_");
            pageId = pageIdArr[1];
            imgSrc = $(this).children("img").attr("src");
            if($(this).hasClass("close")){
                $(this).attr("class", "open");
                imgSrc = imgSrc.replace("close", "open");
                $("#switchEntries_"+""+pageId+"").hide();
            }else{
                $(this).attr("class", "close");
                imgSrc = imgSrc.replace("open", "close");
                $("#switchEntries_"+""+pageId+"").show();
            }
            $(this).children("img").attr("src", imgSrc);
          });
        });

      });
