// autoload-stuff
window.addEvent('domready', function() {
  
  // menuHeight = contentHeight, min-height IE Hackstuff
  var contentHeight = $('content').getSize().size.y;
  var leftHeight = $('leftMenu').getSize().size.y;
  var max = Math.max(leftHeight, contentHeight);
  
  if (max < 450) {
    max = 450;
  }
  
  $$('#leftMenu, #content').each(function(e) {
    e.setStyles(
      'min-height: ' + (max+40) + 'px;' +
      'height: auto !important;' + 
      'height: ' + (max+40) + 'px;'
    );
  });
  
  // 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;
      }
    });
  }
  */
  // IMG Gallery stuff
  $$('.csc-textpic-imagewrap, .csc-textpic-imagerow').each(function(e){
    if (e.getStyle('width') != '') {
      e.setStyle('width', 'auto');
    }
  });
  
});
