
$(function() {
	drawPopust();

});

function drawPopust() {
	$(".izdelekPopust").each(function() {
		var popust=$(this).html();
		if (popust) {
			var flashObj = $.flash.create({
				swf: '/themes/ebatt/img/popust.swf',
				flashvars: {
					'popust': popust
				},
				wmode: 'transparent',
				width: 58,
				height: 58
			});
			$(this).html(flashObj);
		}
	});
	setTimeout("equalH()",100);
}

$.fn.equalHeight = function () {
    var height        = 0;
    var maxHeight    = 0;

    // Store the tallest element's height
    this.each(function () {
        height        = $(this).outerHeight();
        maxHeight    = (height > maxHeight) ? height : maxHeight;
    });

    // Set element's min-height to tallest element's height
    return this.each(function () {
        var t            = $(this);
        var minHeight    = maxHeight - (t.outerHeight() - t.height());
        var property    = $.browser.msie && $.browser.version < 7 ? 'height' : 'min-height';

        t.css(property, minHeight + 'px');
    });
};

function equalH() {
	$('ul#product_list .prodPrices').equalHeight();
	$('ul#product_list li').equalHeight();
	$('ul#product_list h3').equalHeight();
	$('.product_list_small h3').equalHeight();
	$('.ajax_block_product').equalHeight();
	var height        = 0;
    var maxHeight    = 0;

    // Store the tallest element's height
    $('ul#product_list li').each(function () {
        height        = $(this).outerHeight();
        maxHeight    = (height > maxHeight) ? height : maxHeight;
    });
}
$(document).ready(function(){
	equalH();
}); 


function initCufon() {
	Cufon.replace('.avant-m', { fontFamily: 'Avant-medium', hover: true });
	Cufon.replace('.avant-b', { fontFamily: 'Avant-book', hover: true });
}

$(document).ready(function(){
	initCufon();
});

