/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.2, 09.03.2009
 * 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)
 * --------------------------------------------------------------------
 */

(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 css background pngs
		jQuery("#login-popup, #banner-box").each(function(){
			var bgIMG = jQuery(this).css('background-image');
			if(bgIMG.indexOf(".png")!=-1){
				$('a', this).not('a.close').css({'position': 'relative'});
                var width  = $(this).width(),
				    height = $(this).height();
                $(this).wrapInner('<div></div>');
                $('div', this).width(width).height(height);
                var iebg = bgIMG.split('url("')[1].split('")')[0];
				jQuery(this).css('background-image', 'none');
				jQuery('div', this).get(0).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "', sizingMethod='crop')";
			}
		});

		jQuery("div.t-date, div.t-time, div.date-top, div.date-bottom, #probehle-vyherce, #tutofka-prihlasit-se, #carousel-video a.play, #hp-tutofka").each(function(){
			var bgIMG = jQuery(this).css('background-image');
			if(bgIMG.indexOf(".png")!=-1){
				$('a', this).not('a.close').css({'position': 'relative'});
                /*var width  = $(this).width(),
				    height = $(this).height();
                $(this).wrapInner('<div></div>');
                $('div', this).width(width).height(height);*/
                var iebg = bgIMG.split('url("')[1].split('")')[0];
				jQuery(this).css('background-image', 'none');
				jQuery(this).get(0).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "', sizingMethod='crop')";
			}
		});

			
	}
	
	return jQuery;

};

})(jQuery);

