if (document.all && document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule) {
  // Feel free to add rules for specific tags only, you just have to call it several times.
  
  document.styleSheets[0].addRule('#einstiegexzellenzmenueBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#einstiegzeitmenueBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#einstiegwertmenueBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#einstiegwachstummenueBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#einstiegkulturmenueBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');

  document.styleSheets[0].addRule('#einstiegexzellenzmenueTBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#einstiegzeitmenueTBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#einstiegwertmenueTBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#einstiegwachstummenueTBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#einstiegkulturmenueTBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');

  document.styleSheets[0].addRule('#logo', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');

  document.styleSheets[0].addRule('#exzellenzmenueBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#zeitmenueBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#wertmenueBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#wachstummenueBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#kulturmenueBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  
  document.styleSheets[0].addRule('#exzellenzmenueTBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#zeitmenueTBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#wertmenueTBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#wachstummenueTBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('#kulturmenueTBild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  
  document.styleSheets[0].addRule('#themenbild', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  
  document.styleSheets[0].addRule('.quicklinkoben', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('.quicklinkmitte', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  document.styleSheets[0].addRule('.quicklinkunten', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
  
  document.styleSheets[0].addRule('img', 'behavior: url(fileadmin/templates/js/iepngfix.htc)');
}

window.onresize = init;

var bildX;
var bildY;
var pufferX;
var pufferY;

function init() {
    preloadNavigationImage();
    preloadIconsHoverEinstiegsnavigation();
    preloadTextIconsHoverEinstiegsnavigation();

    object = document.getElementById('container');
    if (object) {
    	getWindowSize();
        if (pufferX > 0)
            object.style.left = pufferX + 'px';
        else
            object.style.left = '0px';
        
        if (pufferY > 0)
    	object.style.top = pufferY + 'px';
        else
            object.style.top = '0px';
        
        object.style.visibility = 'visible';
    }

    preloadIconsHover();
}

function getWindowSize() {
    if(window.innerWidth && window.innerHeight) {
        bildX = window.innerWidth;
        bildY = window.innerHeight;
    } else {
        bildX = document.getElementById('body').offsetWidth;
        bildY = document.getElementById('body').offsetHeight;
    }

    if (bildX > 1255) {
        pufferX = Math.round((bildX - 1255) / 2);
    } else {
        pufferX = 0;
    }
    
    if (bildY > 865) {
        pufferY = Math.round((bildY - 865) / 2);
    } else {
        pufferY = 0;
    }
}

function hoverIn(box, aktiv) {
    
    boxId = box.id.replace(/ADD2/, '');
    boxId = boxId.replace(/ADD3/, '');
    
    bilddatei = boxId;
    pfad = 'fileadmin/templates/img/icon/';
    pfadTextBild = 'fileadmin/templates/img/icon/text/';
    
    boxT = document.getElementById(boxId + 'TBild');
    box = document.getElementById(boxId + 'Bild');

    
    if (!boxId.match(aktiv) || aktiv == 'einstieg') {
    	box.style.backgroundImage = 'url('+ pfad + bilddatei +'_hover.png)';
    	boxT.style.backgroundImage = 'url('+ pfadTextBild + bilddatei +'_hover.png)';
    }
}

function hoverOut(box, aktiv) {
    boxId = box.id.replace(/ADD2/, '');
    boxId = boxId.replace(/ADD3/, '');
        
    bilddatei = boxId;
    pfad = 'fileadmin/templates/img/icon/';
    pfadTextBild = 'fileadmin/templates/img/icon/text/';
       
    boxT = document.getElementById(boxId + 'TBild');
    box = document.getElementById(boxId + 'Bild');
    
    if (!boxId.match(aktiv) || aktiv == 'einstieg') {
    	box.style.backgroundImage = 'url('+ pfad + bilddatei +'.png)'
    	boxT.style.backgroundImage = 'url('+ pfadTextBild + bilddatei +'.png)';
    }
}

function loadpage (seite) {
    if (seite == 'exzellenz')
        document.location.href= 'Exzellenz.484.0.html';
    else if (seite == 'zeit')
        document.location.href= 'Zeit.488.0.html';
    else if (seite == 'wert')
        document.location.href= 'Wert.489.0.html';
    else if (seite == 'wachstum')
        document.location.href= 'Wachstum.487.0.html';
    else if (seite == 'kultur')
        document.location.href= 'Kultur.486.0.html';
    else if (seite == 'root')
        document.location.href= '/index.php';
}

function preloadNavigationImage() {
    imageDirectory = 'fileadmin/templates/img/';    
    
    img1 = new Image();
    img1.src = imageDirectory + 'einstiegsnavigation.png';
}

function preloadIconsHoverEinstiegsnavigation() {
    imageDirectory = 'fileadmin/templates/img/icon/';
    hover = '_hover';
    
    img1 = new Image();
    img1.src = imageDirectory + 'einstiegexzellenzmenue' + hover + '.png';
    
    img2 = new Image();
    img2.src = imageDirectory + 'einstiegkulturmenue' + hover + '.png';
    
    img3 = new Image();
    img3.src = imageDirectory + 'einstiegwachstummenue' + hover + '.png';
    
    img4 = new Image();
    img4.src = imageDirectory + 'einstiegwertmenue' + hover + '.png';
    
    img5 = new Image();
    img5.src = imageDirectory + 'einstiegzeitmenue' + hover + '.png';
}

function preloadTextIconsHoverEinstiegsnavigation() {
    imageDirectory = 'fileadmin/templates/img/icon/text/';
    hover = '_hover';
    
    img1 = new Image();
    img1.src = imageDirectory + 'einstiegexzellenzmenue' + hover + '.png';
    
    img2 = new Image();
    img2.src = imageDirectory + 'einstiegkulturmenue' + hover + '.png';
    
    img3 = new Image();
    img3.src = imageDirectory + 'einstiegwachstummenue' + hover + '.png';
    
    img4 = new Image();
    img4.src = imageDirectory + 'einstiegwertmenue' + hover + '.png';
    
    img5 = new Image();
    img5.src = imageDirectory + 'einstiegzeitmenue' + hover + '.png';
}


function preloadIconsHover() {
    imageDirectory = 'fileadmin/templates/img/icon/';
    hover = '_hover';
    
    img1 = new Image();
    img1.src = imageDirectory + 'exzellenzmenue' + hover + '.png';
    
    img2 = new Image();
    img2.src = imageDirectory + 'kulturmenue' + hover + '.png';
    
    img3 = new Image();
    img3.src = imageDirectory + 'wachstummenue' + hover + '.png';
    
    img4 = new Image();
    img4.src = imageDirectory + 'wertmenue' + hover + '.png';
    
    img5 = new Image();
    img5.src = imageDirectory + 'zeitmenue' + hover + '.png';
}

// Ab hier Scroller


// Made by geeeet ät ghtml punkt com
// Keep these two lines and you're free to use this code

// Known bugs :
// If ie4.5 mac, please press apple-t to remove sidebar, otherwise everything is pushed 20px to the right...

// Corrected bugs :
// 25.01.2001 - When the height of the span "content" was less than the height of the span "contentClip" a javascript error occured, function changed : move()
// 21.02.2001 - Scrolling text wasn't selectable in ie, function changed : move()
// 05.03.2001 - Ie x and y coordinates was wrong when page was scrolled, function changed : getMouse()

// 19.04.2001 - Finally able to remove browser-scrollbar if content is longer than the browser is high:
// Just put this in the style-tag right before the end head-tag:
// body {margin-left:0; margin-right:0; margin-top:0; margin-bottom:0; width:100%;height:100%;overflow:hidden}

// Touch me here :-)
var upH = 30; // Height of up-arrow
var upW = 30; // Width of up-arrow
var downH = 30; // Height of down-arrow
var downW = 30; // Width of down-arrow
var dragH = 30; // Height of scrollbar
var dragW = 15; // Width of scrollbar
var scrollH = 333; // Height of scrollbar
var speed = 8; // Scroll speed

// And now... go to the bottom of the page...

// Browser detection
var dom = document.getElementById ? true:false;
var nn4 = document.layers ? true:false;
var ie4 = document.all ? true:false;

var mouseY; // Mouse Y position onclick
var mouseX; // Mouse X position onclick

var clickUp = false; // If click on up-arrow
var clickDown = false; // If click on down-arrow
var clickDrag = false; // If click on scrollbar
var clickAbove = false; // If click above scrollbar
var clickBelow = false; // If click below scrollbar

var timer = setTimeout("",500); // Repeat variable
var upL; // Up-arrow X
var upT; // Up-arrow Y
var downL; // Down-arrow X
var downT; // Down-arrow Y
var dragL; // Scrollbar X
var dragT; // Scrollbar Y
var dragTbackup = -1;
var rulerL; // Ruler X
var rulerT; // Ruler Y
var rulerTbackup = -1;
var contentT; // Content layer Y;
var contentH; // Content height
var contentHbackup = -1; // Content height
var contentClipH; // Content clip height
var scrollLength; // Number of pixels scrollbar should move
var startY; // Keeps track of offset between mouse and span

function doNothing() {

}

// Mousedown
function down(e){
  if((nn4 && e.which != 1) || (ie4 && event.button != 1) && (navigator.userAgent.indexOf("Opera") == -1)) return true; // Enables the right mousebutton
  getMouse(e);
  startY = (mouseY - dragT);
  // If click on up-arrow
  if(mouseX - pufferX >= upL && (mouseX - pufferX <= (upL + upW)) && mouseY - pufferY >= upT && (mouseY - pufferY <= (upT + upH))){
    clickUp = true;
    return scrollUp();
  } 
  // Else if click on down-arrow
  
  else if(mouseX - pufferX >= downL && (mouseX - pufferX <= (downL + downW)) && mouseY - pufferY >= downT && (mouseY - pufferY <= (downT + downH))){
    clickDown = true;
    return scrollDown();
  }
  // Else if click on scrollbar
  else if(mouseX - pufferX >= dragL && (mouseX - pufferX<= (dragL + dragW)) && mouseY - pufferY >= dragT && (mouseY - pufferY <= (dragT + dragH))){
    clickDrag = true;
    return false;
  }
  else if(mouseX - pufferX >= dragL && (mouseX - pufferX<= (dragL + dragW)) && mouseY - pufferY >= rulerT && (mouseY - pufferY <= (rulerT + scrollH))){
    // If click above drag
    if(mouseY - pufferY < dragT){
      clickAbove = true;
      clickUp = true;
      return scrollUp();
    }
    // Else click below drag
    else{
      clickBelow = true;
      clickDown = true;
      return scrollDown();
    }
  }
  // If no scrolling is to take place
  else{
    return true;
  }
}

// Drag function
function move(e){
  if(clickDrag && contentH > contentClipH){
    getMouse(e);
    dragT = (mouseY - startY);
   
    if(dragT < (rulerT))
      dragT = rulerT;   
    if(dragT > (rulerT + scrollH - dragH))
      dragT = (rulerT + scrollH - dragH);
   
    contentT = ((dragT - rulerT)*(1/scrollLength));
    contentT = eval('-' + contentT);

    moveTo();
   
    // So ie-pc doesn't select gifs
    if(ie4)
      return false;
  }
}

function up(){
  clearTimeout(timer);
  // Resetting variables
  clickUp = false;
  clickDown = false;
  clickDrag = false;
  clickAbove = false;
  clickBelow = false;
  return true;
}

// Reads content layer top
function getT(){
  if(ie4)
    contentT = document.all.content.style.pixelTop;
  else if(nn4)
    contentT = document.contentClip.document.content.top;
  else if(dom)
    contentT = parseInt(document.getElementById("content").style.top);
}

// Reads mouse X and Y coordinates
function getMouse(e){
  if(ie4){
    mouseY = event.clientY + document.body.scrollTop;
    mouseX = event.clientX + document.body.scrollLeft;
  }
  else if(nn4 || dom){
    mouseY = e.pageY;
    mouseX = e.pageX;
  }
}

// Moves the layer
function moveTo(){
  if(ie4){
    document.all.content.style.top = contentT;
    document.all.ruler.style.top = dragT;
    document.all.drag.style.top = dragT;
  }
  else if(nn4){
    document.contentClip.document.content.top = contentT;
    document.ruler.top = dragT;
    document.drag.top = dragT;
  }
  else if(dom){
    document.getElementById("content").style.top = contentT + "px";
    document.getElementById("drag").style.top = dragT + "px";
    document.getElementById("ruler").style.top = dragT + "px";
  }
}

// Scrolls up
function scrollUp(){
  getT();
 
  if(clickAbove){
    if(dragT <= (mouseY-(dragH/2)))
      return up();
  }
 
  if(clickUp){
    if(contentT < 0){   
      dragT = dragT - (speed*scrollLength);
     
      if(dragT < (rulerT))
        dragT = rulerT;
       
      contentT = contentT + speed;
      if(contentT > 0)
        contentT = 0;
     
      moveTo();
      timer = setTimeout("scrollUp()",25);
    }
  }
  return false;
}

// Scrolls down
function scrollDown(){
  getT();
 
  if(clickBelow){
    if(dragT >= (mouseY-(dragH/2)))
      return up();
  }

  if(clickDown){
    if(contentT > -(contentH - contentClipH)){     
      dragT = dragT + (speed*scrollLength);
      if(dragT > (rulerT + scrollH - dragH))
        dragT = (rulerT + scrollH - dragH);
     
      contentT = contentT - speed;
      if(contentT < -(contentH - contentClipH))
        contentT = -(contentH - contentClipH);
     
      moveTo();
      timer = setTimeout("scrollDown()",25);
    }
  }
  return false;
}

// Preload
function eventLoader(){
  if(ie4){
    // Up-arrow X and Y variables
    upL = document.all.up.style.pixelLeft;
    upT = document.all.up.style.pixelTop;   
    // Down-arrow X and Y variables
    downL = document.all.down.style.pixelLeft;
    downT = document.all.down.style.pixelTop;
    // Scrollbar X and Y variables
    dragL = document.all.drag.style.pixelLeft;
    dragT = document.all.drag.style.pixelTop;   
    // Ruler Y variable
    rulerT = document.all.ruler.style.pixelTop;   
    // Height of content layer and clip layer
    contentH = parseInt(document.all.content.scrollHeight);
    contentClipH = parseInt(document.all.contentClip.style.height);
  }
  else if(nn4){
    // Up-arrow X and Y variables
    upL = document.up.left;
    upT = document.up.top;   
    // Down-arrow X and Y variables
    downL = document.down.left;
    downT = document.down.top;   
    // Scrollbar X and Y variables
    dragL = document.drag.left;
    dragT = document.drag.top;   
    // Ruler Y variable
    rulerT = document.ruler.top;
    // Height of content layer and clip layer
    contentH = document.contentClip.document.content.clip.bottom;
    contentClipH = document.contentClip.clip.bottom;
  }
  else if(dom){
    // Up-arrow X and Y variables
    upL = parseInt(document.getElementById("up").style.left);
    upT = parseInt(document.getElementById("up").style.top);
    // Down-arrow X and Y variables
    downL = parseInt(document.getElementById("down").style.left);
    downT = parseInt(document.getElementById("down").style.top);
    // Scrollbar X and Y variables
    dragL = parseInt(document.getElementById("drag").style.left);
    dragTbackup = (dragTbackup == -1) ? parseInt(document.getElementById("drag").style.top) : dragTbackup;
    dragT = dragTbackup;
    
    // Ruler Y variable
    rulerTbackup = (rulerTbackup == -1) ? parseInt(document.getElementById("ruler").style.top) : rulerTbackup;
    rulerT = rulerTbackup;
    // Height of content layer and clip layer
    contentH = parseInt(document.getElementById("content").offsetHeight);
    contentClipH = parseInt(document.getElementById("contentClip").offsetHeight);
    document.getElementById("content").style.top = 0 + "px";
   
  }
  
  contentHbackup = (contentHbackup == -1) ? contentH : contentHbackup;
  // Number of pixels scrollbar should move
  scrollLength = ((scrollH-dragH)/(contentH-contentClipH));
  if (scrollLength > 0) {
    showScrollbar();
  }
  // Initializes event capturing
  if(nn4){
    document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
  }
  document.onmousedown = down;
  document.onmousemove = move;
  document.onmouseup = up;
}
// Pop Up
function openNewWindow(URLtoOpen, windowName, windowFeatures) { newWindow=window.open(URLtoOpen, windowName, windowFeatures); }

function setScrollerToDefault(e) {
  setTimeout('resetView()', 200);  
}

function resetView() {
  var heightChanged = false;
  var actualContentHeight = -1;
  if(ie4){
    actualContentHeight = parseInt(document.all.content.scrollHeight);
  } else if(nn4){
    actualContentHeight = document.contentClip.document.content.clip.bottom;
  } else if(dom){
    actualContentHeight = parseInt(document.getElementById("content").offsetHeight);
  }

  if (actualContentHeight != -1 && actualContentHeight != contentHbackup) {
     upL = 0;
     upT = 0; // Up-arrow Y
     downL = 0; // Down-arrow X
     downT = 0; // Down-arrow Y
     dragL = 0; // Scrollbar X
     dragT = 0; // Scrollbar Y
     rulerL = 0; // Ruler X
     rulerT = 0; // Ruler Y
     contentT = 0; // Content layer Y;
     contentH = 0; // Content height
     contentClipH = 0; // Content clip height
     scrollLength = 0; // Number of pixels scrollbar should move
     startY = 0; 
     upH = 30; // Height of up-arrow
     upW = 30; // Width of up-arrow
     downH = 30; // Height of down-arrow
     downW = 30; // Width of down-arrow
     dragH = 30; // Height of scrollbar
     dragW = 15; // Width of scrollbar
     scrollH = 333; // Height of scrollbar
     speed = 8; // Scroll speed
     eventLoader();
     moveTo();
     contentHbackup = actualContentHeight;
  }
}

function showScrollbar() {
  try {
    if(ie4){
      document.all.content.onmousedown = setScrollerToDefault;
      document.all.up.style.visibility="visible";
      document.all.down.style.visibility="visible";
      document.all.drag.style.visibility="visible";
      document.all.ruler.style.visibility="visible";
    } else if (nn4) {
      document.content.onmousedown = setScrollerToDefault;
      document.up.style.visibility="visible";
      document.down.style.visibility="visible";
      document.drag.style.visibility="visible";
      document.ruler.style.visibility="visible";
    }
    else if(dom){
      document.getElementById("content").onmousedown = setScrollerToDefault;
      document.getElementById("up").style.visibility="visible";
      document.getElementById("down").style.visibility="visible";
      document.getElementById("drag").style.visibility="visible";
      document.getElementById("ruler").style.visibility="visible";
    }
  } catch (exception) {
    //Nothing;
  }
}

/** This is high-level function.
 * It must react to delta being more/less than zero.
 */
function handle(delta) {
  if (delta < 0) {
    clickDown = true;
    scrollDown();
    clickDown = false;
  } else {
    clickUp = true;
    scrollUp();
    clickUp = false;
  }
}

/** Event handler for mouse wheel event.
 */
function wheel(event){
        var delta = 0;
        if (!event) /* For IE. */
                event = window.event;
        if (event.wheelDelta) { /* IE/Opera. */
                delta = event.wheelDelta/120;
                /** In Opera 9, delta differs in sign as compared to IE.
                 */
                if (window.opera)
                        delta = -delta;
        } else if (event.detail) { /** Mozilla case. */
                /** In Mozilla, sign of delta is different than in IE.
                 * Also, delta is multiple of 3.
                 */
                delta = -event.detail/3;
        }
        /** If delta is nonzero, handle it.
         * Basically, delta is now positive if wheel was scrolled up,
         * and negative, if wheel was scrolled down.
         */
        if (delta)
                handle(delta);
        /** Prevent default actions caused by mouse wheel.
         * That might be ugly, but we handle scrolls somehow
         * anyway, so don't bother here..
         */
        if (event.preventDefault)
                event.preventDefault();
	event.returnValue = false;
}

/** Initialization code. 
 * If you use your own event management code, change it as required.
 */
if (window.addEventListener)
        /** DOMMouseScroll is for mozilla. */
        window.addEventListener('DOMMouseScroll', wheel, false);
/** IE/Opera. */
window.onmousewheel = document.onmousewheel = wheel;