

/* pngfix	
-------------------------------------------------- */
(function($){

$.extend({
	ie6 : function(){
		if($.browser.msie && $.browser.version < 7 > -1){
			return true;
		}else{
			return false;
		}
	},
	alphaImage : function(elm, src){
		elm.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + src + ",sizingMethod=scale);width:" + elm.width + "px;height:" + elm.height + "px;display:block;";
		elm.src = '/share/images/blank.gif';
	}
});
$.fn.extend({
    pngfix : function() {
    	if( ! $.ie6() ){return;}
        return this.each(function() {
        	$.alphaImage(this, this.src);
        });
    },
    rollover : function(opt){
	    return this.each(function() {
    		var _src = this.src;
    		var _ftype = _src.substring(_src.lastIndexOf('.'), _src.length);
			var _hsrc = _src.replace(_ftype, opt.suffix + _ftype);
			new Image().src = _hsrc;
			var _this = $(this).data('src', _src).data('src_o', _hsrc);

			if($.ie6() && _src.indexOf('.png') > -1) {
				_this.hover(
					function() { $.alphaImage(this, _hsrc); },
					function() { $.alphaImage(this, _src); }
				);
			} else {
				_this.hover(
					function() { this.src = _hsrc; },
					function() { this.src = _src; }
				);
			}

		});
    }
});

})(jQuery);
