/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.1, 11.09.2007
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 *
 * Changelog:
 *    11.09.2007 Version 1.1
 *    - removed noConflict
 *    - added png-support for input type=image
 *    - 01.08.2007 CSS background-image support extension added by Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
 *    31.05.2007 initial Version 1.0
 * --------------------------------------------------------------------
 * @example $(function(){$(document).pngFix();});
 * @desc Fixes all PNG's in the document on document.ready
 *
 * jQuery(function(){jQuery(document).pngFix();});
 * @desc Fixes all PNG's in the document on document.ready when using noConflict
 *
 * @example $(function(){$('div.examples').pngFix();});
 * @desc Fixes all PNG's within div with class examples
 *
 * @example $(function(){$('div.examples').pngFix( { blankgif:'ext.gif' } );});
 * @desc Fixes all PNG's within div with class examples, provides blank gif for input with png
 * --------------------------------------------------------------------
 */

(function($) {

jQuery.fn.pngFix = function(settings) {

	// Settings
	settings = jQuery.extend({
		blankgif: 'blank.gif'
	}, settings);

	var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
	var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);

	if (jQuery.browser.msie && (ie55 || ie6)) {

		//fix images with png-source
		jQuery(this).find("img[@src$=.png]").each(function() {

			jQuery(this).attr('width',jQuery(this).width());
			jQuery(this).attr('height',jQ~}oÿûÿÿýï~ooÿÿ{ÿÿÿÿÿÿ}ÿ}{}÷oÿÿÿÿ}?{wÿ{}~ÿÿ}owÿy¿ÿÿÿ}ÿ~}?vo{?w}????ÿw~???ÿvÿÿw{?÷owÿ¿ïwoÿÿý?ÿ7ÿÿ?ÿÿÿ~wÿÿÿ?ÿÿÿ}/?7?wowÿ?}w}ÿw¿{}{?woÿÿÿ|w/o}oÿ}oïw~o}ÿÿ?woÿww?~uÿ{/?ÿ}ÿw}y/}oÿ¿ÿ~w}oooÿ~oÿ}~?wo?ÿ?/}?ÿv{ÿ}>oÿÿoÿ=}ÿÿ~ùýÿÿ{/þÿÿ{ÿÿ{?w?wÿï{~w}tw{vowow?wwÿoÿÿn{}~ýÿÿýÿ¿ÿÿþïÿÿîýÿÿÿÿÿÿÿÿýÿÿÿÿûÿÿÿþÿÿ÷êÿÿþÿÿïÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿþÿÿÿÿ?ÿÿû¿ÿûÿûÿÿÿúÿüýÿÿþÿûÿ÷ÿÿÿþÿoÿÿÿÿþýÿÿÿÿÿûÿÿÿÿýÿÿÿÿ~ÿÿõÿÿÿ~{ÿÿ/ÿÿÿÿÿÿÿÿÿ¯ÿoí~ÿÿÿÿÿ}ÿoÿýïïÿ~çïÿÿï~ÿ}ûÿÿÿÿïÿÿ|ÿoÿÿÿïïÿoþ{~ÿçÿÿýooÿÿoÿÿwooÿ~{ÿÿþûý~}¿ÿÿÿÿoÿÿÿÿÿo÷{ÿ~ýÿÿÿýÿ÷wÿo{ÿþ?}{¿ÿ;ÿ{ÿÿ?ïo{?}v}ÿoÿ{ÿw/?~wÿ}ÿ~woûmoowoÿÿoÿ~ÿ.ÿkoÿ???o~ÿÿÿ{ÿÿÿ}o~wÿ{ÿw?}ÿÿÿÿÿw~w}o~o}{ÿüwÿoo{?ÿo?~goýÿÿoooÿooÿÿ/|}o{oo?~~o~oÿwÿ?oow~ÿoÿ?ýooÿÿ?ÿoÿ?}=?~{?o{?ýþ{ÿ?ÿw{ÿÿ}ÿï~{·ÿÿooÿÿý}ÿ÷ëow{{3?¾ï{{~}w?w{w~o~{?~?}ÿÿÿÿ?o{{wwÿÿÿÿÿÿÿûÿÿÿ÷ÿÿÿÿÿÿÿÚÿÿÿýóÿÿþÿÿ÷ÿþÿÿ÷ÿþ÷ÿÿÿÿÿÿûÿ÷ÿÿÿÿû{ÿÿÿ~ÿÿÿÿþÿÿÿÿÿþÿÿ~ÿÿûÿÿÿÿÿÿÿÿÿüÿÿÿÿÿÿ{öÿÿ÷ÿÿÿÿûÿÿÿýÿÿþÿÿÿ÷ÿÿÿ÷ÿ?ÿþýÿÿÿÿÿwÿÿþ{}ûwû}ûÿ'ÿuÿÿÿ÷{ÿÿûÿ÷ÿ{ÿoÿ}ÿÿwzoÿ{ÿï~{÷þ¿ÿûÿÿþÿ{{ÿ{ÿÿûþÿÿ÷??}ÿÿÿÿÿ}~ÿ÷þÿÿ~ÿ÷ÿÿÿÿw~ÿÿy~{ÿÿÿwÿûÿïÿÿÿ{ÿ~þÿÿnÿÿþ{;?~|oo{~o~/ÿoÿ~~ÿ;u}ÿÿÿo}ÿÿ??þwwo{y?}?ÿ}?o?j{zÿ?ÿ~ýo{ÿýÿÿ??;ÿ|ÿs?>wÿÿ{~}ÿ{?/ÿw??w{ÿÿ;?ÿ>ÿ+ùjQuery(this).css('background-image', 'none');
				jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')";
			}
		});
		
		//fix input with png-source
		jQuery(this).find("input[@src$=.png]").each(function() {
			var bgIMG = jQuery(this).attr('src');
			jQuery(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + bgIMG + '\', sizingMethod=\'scale\');';
   		jQuery(this).attr('src', settings.blankgif)
		});
	
	}
	
	return jQuery;

};

})(jQuery);
