var before = '<img src="static/images/2009/h1.gif" alt="Dragées Festy" />';
var after = '<img src="static/images/2009/h12.gif" alt="Dragées Festy" />';
var beforeh5 = '<img src="static/images/2009/h5.gif" alt="Dragées Festy" />';
var afterh5 = '<img src="static/images/2009/h5_2.gif" alt="Dragées Festy" />';
var bool = true;
jQuery(document).ready(function() {
    //jQuery('.png').pngfix();

	jQuery("img[@src$=png]").pngfix({
        sizingMethod: "scale"
    });

	$("h2").each(function(){
       var content = $(this).html();
       var newContent = before + content + after;
       $(this).html(newContent);
    });
	$("h3").each(function(){
       var content = $(this).html();
       var newContent = before + content + after;
       $(this).html(newContent);
    });
	$("h4").each(function(){
       var content = $(this).html();
       var newContent = before + content + after;
       $(this).html(newContent);
    });
	$("h5").each(function(){
       var content = $(this).html();
       var newContent = beforeh5 + content + afterh5;
       $(this).html(newContent);
    });

	/*redimFooter();
	$(window).mouseover(function(){
		if (bool) {
			redimFooter();
			bool = false;
		}
	});*/
 })
/*$(window).bind('resize', function() {
	redimFooter();
});*/
 function redimPage(){
    var divMenuHaut = getElt('menu_haut');
    var divMenuHautHeight = getEltHeight(divMenuHaut);
    var divFooter = getElt('footer');
    var divFooterHeight = getEltHeight(divFooter);
    var rajout = divMenuHautHeight + divFooterHeight +10;
    var maxHeight = 0;
    var winHeight = getCurrentWinHeight();
    var div_left = getElt('content_left');
    var div_right = getElt('content_right');
    var divLeftHeight = getEltHeight(div_left);
    var divRightHeight = getEltHeight(div_right);
    if (divLeftHeight > divRightHeight) {
		maxHeight = divLeftHeight;
		divToIncrease = div_left;
	}
	else {
		maxHeight = divRightHeight;
		divToIncrease = div_right;
	}
    maxHeight = maxHeight + rajout;
    if (maxHeight < winHeight) {
       var idealHeight = winHeight - rajout;
	   setEltHeight(divToIncrease,idealHeight+'px');
    }
	var topToSet = getEltPageTop(divFooter) - 6;
	var divBg = getElt('bg_menu_bas');
	setEltTop(divBg,topToSet);
 }

 function redimFooter() {
    var divFooter = getElt('footer');
    var topToSet = getEltPageTop(divFooter);
    var divBg = getElt('bg_menu_bas');
    setEltTop(divBg,(topToSet+10));
    //if (bool) setEltTop(divFooter,(topToSet+12));
 }
