  BG1 = new Image();
  BG1.src = jsTemplateDir + "/images/btn_bg_top_navi_a.jpg";

  BG2 = new Image();
  BG2.src = jsTemplateDir + "/images/btn_bg_top_navi_b.jpg";

  BG3 = new Image();
  BG3.src = jsTemplateDir + "/images/btn_bg_top_navi_start_a.jpg";

  BG4 = new Image();
  BG4.src = jsTemplateDir + "/images/btn_bg_top_navi_start_b.jpg";


  // Firefox 2/3
  FF = /a/[-1]=='a';
  // Firefox 3
  FF3 = (function x(){})[-5]=='x';
  // Firefox 2
  FF2 = (function x(){})[-6]=='x';
  // Internet Explorer 6/7/8:
  IE = '\v'=='v';
  // Safari:
  Saf = /a/.__proto__=='//';
  // Chrome
  Chr = /source/.test((/a/.toString+''));
  // Opera
  Op = /^function \(/.test([].sort);
  
  // initialize when the DOM is ready 
  $(document).ready(function() {
      
      // test if we need to reposition some visible stuff divs etc.
      if (IE) {
        doIEStuff();
      } else {
        repositionDIVs();
      }
  });
  
  function init() {
    setupZoom();
  }

  function initImageDiv() {
    document.getElementById('main_image_div').style.visibility = 'visible';
  }

  function initContentDiv() {
    document.getElementById('content_div').style.visibility = 'visible';
    document.getElementById('content_div').style.width = '582px';
    document.getElementById('content_div').style.height = '340px';
  }

  function doIEStuff() {
    document.body.style.scrollbarBaseColor = "#ff0000";
    document.body.style.scrollbar3dLightColor = "#eFFFeF";
    document.body.style.scrollbarArrowColor = "#1a653f";
    document.body.style.scrollbarDarkshadowColor = "#1a653f";
    document.body.style.scrollbarFaceColor = "#c9e4af"; // "#cdffaa"; //"#1a653f";
    document.body.style.scrollbarHighlightColor = "#eFFFeF";
    document.body.style.scrollbarShadowColor = "#1a653f";
    document.body.style.scrollbarTrackColor = "#e0f0e0"; //#b0c0b0";
  }
  
  function repositionDIVs() {
        // repositioniere suche
        document.getElementById('search_string').style.marginTop = "0px";
        document.getElementById('search_string').style.marginBottom = "6px";
        document.getElementById('search_submit').style.marginTop = "0px";
        document.getElementById('search_submit').style.marginBottom = "6px";
  }

  function swap_header_bnt_image(element, index, value) {
    element.src = header_btn_images[index][value].src;
  }  
   
  function swapButtonBorder(element, color) {
    if (element.tagName.toUpperCase() == "A") {
      element.style.borderColor = color;
    }
  }
  
  function skipPreviousNextImage(element) {
  }

  function skipNextImage(element) {
  }
  
  function swapBackGround(obj, img) {
    var entry = obj.parentNode;
    //alert(entry.style.background.url);
    entry.style.background="url(" + img.src + ") no-repeat top left";
  }

  function showIFrame(iFrameId, iFrameSrc, iFrameWidth, iFrameHeight) {
      var iFrameDiv = document.getElementById(iFrameId);
      if (iFrameDiv != null) {
         var aRef = iFrameDiv.getElementsByTagName("a")[0];
         var iFrame = document.createElement("iframe");
         iFrame.setAttribute("width", iFrameWidth);
         iFrame.setAttribute("height", iFrameHeight);
         iFrame.setAttribute("src", encodeURI(iFrameSrc));
         iFrame.setAttribute("scrolling", "no")
         iFrame.setAttribute("frameborder", "1");
         
         iFrame.style.borderColor = "#65af58";
         
         iFrameDiv.appendChild(iFrame);             
         var iFrameLinkText = aRef.getElementsByTagName("span")[0].firstChild;        
         var iFrameLinkTextData = aRef.getElementsByTagName("span")[0].firstChild.data;        
         aRef.onclick =  function () { hideIFrame(iFrameId, iFrameSrc, iFrameWidth, iFrameHeight, aRef, iFrameLinkText, iFrameLinkTextData) };
         iFrameLinkText.data = "schliessen"; 
      }
  }

  function hideIFrame(iFrameId, iFrameSrc, iFrameWidth, iFrameHeight, aRef, iFrameLinkText, iFrameLinkTextData) {
      var iFrameDiv = document.getElementById(iFrameId);
      var iFrame = iFrameDiv.getElementsByTagName("iframe")[0];
      iFrameDiv.removeChild(iFrame);
      aRef.onclick =  function () { showIFrame(iFrameId, iFrameSrc, iFrameWidth, iFrameHeight) };
      iFrameLinkText.data = iFrameLinkTextData; 
 }


