// fixie.js - emulate :hover pseudo class, implement support for q tag and
//              max-width property for MS IE
//            Pseudoklasse :hover fr MS IE emulieren, Untersttzung fr q Tag
//              und max-width Eigenschaft fr MS IE implementieren
// (c) 2006 Christian Hennecke
 
function hoverIE() {
  node = document.getElementById("navArticles");
  node.onmouseover=function() {
    this.className+=" over";
  }
  node.onmouseout=function() {
    this.className=this.className.replace(" over", "");
  }
}
 
function widthIE() {
  var cssWidth, cssSize;
  switch (getActiveStyleSheet()) {
    case "small":
      cssWidth = 650;
      cssSize = 14;
      break;
    case "medium":
      cssWidth = 800;
      cssSize = 16;
      break;
    case "large":
      cssWidth = 950;
      cssSize = 18;
      break;
  }
  fullWidth = (0.714 + 2.857) * cssSize + cssWidth;
  if(document.body.offsetWidth>fullWidth) {
    document.getElementById("text").style.width = String(cssWidth) + "px";
  }
 
}
 
function qIE() {
  switch (document.getElementsByTagName("html")[0].lang) {
    case "de":
      openingQuote = "\u00BB";
      closingQuote = "\u00AB";
      break;
    case "en":
      openingQuote = "\u201C";
      closingQuote = "\u201D";
      break;
    default:
      openingQuote = "\u201C";
      closingQuote = "\u201D";
      break;
  }
  if(document.getElementsByTagName("q")) {
    for (i=0; i<document.getElementsByTagName("q").length; i++) {
      document.getElementsByTagName("q")[i].firstChild.data = openingQuote + document.getElementsByTagName("q")[i].firstChild.data;
      document.getElementsByTagName("q")[i].lastChild.data += closingQuote;
    }
  }
}
 
fixIE = function() {
  if(document.all && document.getElementById) {
    widthIE();
    hoverIE();
    qIE();
  }
}
 
window.onload=fixIE;
