var blank = new Image();
blank.src = '/oryx/images/web/blank.gif';

 $(document).ready(function() {
    /**
     * Fix pngs in IE
     * */
    var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
    if (badBrowser) {
     // get all pngs on page
     $('img[src$=.png]').each(function() {
       if (!this.complete) {
         this.onload = function() {fixPng(this)};
       } else {
         fixPng(this);
       }
     });
    }


    /**
     * Rollover buttons
     * */
    $('a.rollover').mouseover(function() {
        $(this).removeClass('rollover');
        rolloverIn(this);
    });
    $('a.rollover').mouseout(function() {
        rolloverOut(this);
    });

 });

 function rolloverIn(c) {
    var s = $(c)[0].className;
    if (s[s.length - 1] != '_') {
        $(c).removeClass(s);
        $(c).addClass(s + "_");
    }
 }

 function rolloverOut(c) {
    var s = $(c)[0].className;
    if (s[s.length - 1] == '_') {
        $(c).removeClass(s);
        $(c).addClass(s.substring(0, s.length - 1));
    }
 }


 function fixPng(png) {
   // get src
   var src = png.src;
   // set width and height
   if (!png.style.width) {png.style.width = $(png).width();}
   if (!png.style.height) {png.style.height = $(png).height();}
   // replace by blank image
   png.onload = function() { };
   png.src = blank.src;
   // set filter (display original image)
   png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
 }



