jQuery.fn.supersleight = function(settings) {
	settings = jQuery.extend({
		imgs: true,
		backgrounds: true,
		shim: 'images/x.gif',
		apply_positioning: true
	}, settings);
	
	return this.each(function(){
    jQuery(this).find('*').andSelf().each(function(i,obj) {
      var self = jQuery(obj);
      // background pngs
      if (settings.backgrounds && self.css('background-image').match(/\.png/i) !== null) {
        var bg = self.css('background-image');
        var src = bg.substring(5,bg.length-2);
        var mode = (self.css('background-repeat') == 'no-repeat' ? 'crop' : 'scale');
        var styles = {
          'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')",
          'background-image': 'url('+settings.shim+')'
        };
        self.css(styles);
      };
      // image elements
      if (settings.imgs && self.is('img[src$=png]')){
        if (self.width()==0) {
          self.one('load', function(){
            var self = $(this);
            var styles = {
              'width': self.width() + 'px',
              'height': self.height() + 'px',
              'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + self.attr('src') + "', sizingMethod='scale')"
            };
            self.css(styles).attr('src', settings.shim);
          });
        } else {
          var styles = {
            'width': self.width() + 'px',
            'height': self.height() + 'px',
            'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + self.attr('src') + "', sizingMethod='scale')"
          };
          self.css(styles).attr('src', settings.shim);
        };
      };
      // apply position to 'active' elements
      if (settings.apply_positioning && self.is('a, input') && (self.css('position') === '' || self.css('position') == 'static')){
        self.css('position', 'relative');
      };
    });
	});
};

$(document).ready(function(){
  if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 7 && parseInt(jQuery.browser.version, 10) > 4) {
    $('body').supersleight();
    $("#nav_main ul>li>ul>li>a").css({
      'zoom' : 1
    });
  }

  $("div.thumb").hover(function(){
    var info=$(this).find("div.info");
    info.stop().animate({bottom:"5px", opacity: 0.7}, 500);
  }, function(){
    var info=$(this).find("div.info");
    info.stop().animate({bottom:"-85px", opacity: 0}, 500);
  }); 
  
  $("#nav_main ul>li").hover(function(event){
    $(this).addClass("hover");
  }, function() {
    $(this).removeClass("hover");
  });


  $("#nav_main ul>li>a").css({
    '-moz-border-radius'    : '6px',
    '-webkit-border-radius' : '6px',
    'border-radius'         : '6px'
  });

  $("#nav_main ul>li>ul").css({
    '-moz-border-radius-bottomleft'   :'6px',
    '-moz-border-radius-bottomright'  :'6px',
    '-moz-border-radius-topleft'      :'0px',
    '-moz-border-radius-topright'     :'6px',
    '-webkit-border-bottom-left-radius'   : '6px',
    '-webkit-border-bottom-right-radius'  : '6px',
    '-webkit-border-top-left-radius'      : '0px',
    '-webkit-border-top-right-radius'     : '6px',
    'border-radius-bottomleft'   :'6px',
    'border-radius-bottomright'  :'6px',
    'border-radius-topleft'      :'0px',
    'border-radius-topright'     :'6px'
  });
  
});
