var IEFixes = {

  'fixPNG' : function() {
    for(var i=0; i<document.images.length; i++) {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
        var imgID = (img.id) ? "id='" + img.id + "' " : ""
        var imgClass = (img.className) ? "class='" + img.className + "' " : ""
        var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
        var imgStyle = "display:inline-block;" + img.style.cssText
        if (img.align == "left") imgStyle = "float:left;" + imgStyle
        if (img.align == "right") imgStyle = "float:right;" + imgStyle
        if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
        var strNewHTML = "<span " + imgID + imgClass + imgTitle
          + " src=\"" + img.src + "\" style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
          + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
          + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
        img.outerHTML = strNewHTML
        i = i-1
      }
    }
  },
 

  'fixFlicker' : function() {
    /* Try to fix the IE 6 flickering bug!
       Solution found on http://www.mister-pixel.com/
    */
    try {
      document.execCommand("BackgroundImageCache", false, true);
    } catch(e) {}
  },

  'submitHovers' : function() {
    $$('input.button').each( function(i) {
      if(i.hasClassName('default_button_main')){
        i.onmouseover = i.onfocus = function() { i.addClassName('buttonHover') };
        i.onmouseout  = i.onblur  = function() { i.removeClassName('buttonHover') };
      }
    });
  },
  
  'submitHoversSmall' : function() {
    $$('input.button').each( function(i) {
		  if(i.hasClassName('default_button_small')){
        i.onmouseover = i.onfocus = function() { i.addClassName('buttonHoverSmall') };
        i.onmouseout  = i.onblur  = function() { i.removeClassName('buttonHoverSmall') };
		  }
    });
  }
}

Event.observe(window,'load',function(){
  var av = navigator.appVersion;
  if (av.match(/MSIE/) && parseFloat(av.split('MSIE')[1]) < 7) {
    $H(IEFixes).each(function(f){
      (f.value)();
    });
  }
});


