// autoload-stuff
window.addEvent('domready', function() {
  // set the height for maincontainer
  function heights(){
    // menuHeight = contentHeight, min-height IE Hackstuff
    var contentHeight = $('content').getSize().size.y;
    var rightHeight = $('right').getSize().size.y;
    // get the highest value  
    var max = Math.max(rightHeight, contentHeight);
    
    // minus 75 because of some stupid margin-bug
    // and even weirder IE-Bug with totally absurd values
    $$('#right', '#content').each(function(e){
      e.setStyles('height: ' + (max - 75) + 'px;');
    });
  }
  heights.periodical(1000);

  // much more beautiful for anchors
  new SmoothScroll();
  
  // Finally we add PNG-Support for IE6 - ootools-style :-)
  // remembers the id, classes, alt and title tag of the image
  // and shows a cursor-hand if is contained in a link
  // does not affect background-pngs - do this in ie6.css instead
  if (window.ie6) {
    $$('img').each(function(i) {
      iSrc = i.getProperty('src');
      iWidth = i.getSize().size.x;
      iHeight = i.getSize().size.y;
      iID = i.getProperty('id');
      iClass = i.getProperty('class');
      iTitle = i.getProperty('title') + " " + i.getProperty('alt');
      iStyle = "display: inline-block; ";
      if (i.getParent().getProperty('href') !== "") {
        iStyle += "cursor: pointer; "
      }
      var iName = iSrc.toLowerCase();
      if (iName.substring(iName.length - 3, iName.length) == "png") {
        var strNewHTML = '<span id="' + iID + 
                        '" class="'+ iClass + 
                        '" title="' + iTitle +
                        '" style="' + iStyle +
                        'width: ' + iWidth + 
                        'px; height: ' + iHeight + 
                        'px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' + 
                        "(src=\'" + iSrc + "\', sizingMethod='scale');\"></span>";
        i.outerHTML = strNewHTML;
      }
    });
  }
  if ($('searchformInput')) {
    $('searchformInput').addEvent('click', function(){
      $('searchformInput').setProperty('value', '')
    });
  }
  
});