
/**
 * @filesource: pub.js
 * @author: A. RUIZ
 * @email: adrien.ruiz083@gmail.com
 * @date: 06/08/10
 **/
 
$(document.body).ready (function () {
    var pub = $('div#pub');
    var page = $('div#page');
    var h_pub = pub.height ();
    var h_page = page.height ();
    
    if (h_pub > h_page) {
        var liste_produit = $('div.liste-produit');
        var cadre_page = $('div#page div.cadre-page');
        
        if (liste_produit.get (0)) {
            // Pour eviter tout decalage visuel durant le redimensionnement
            // notamment sous ie, on masque la liste, puis on l'affiche
            // lorsque tous les traitements sont termines!
            liste_produit.hide ();
            var h = liste_produit.height ()+h_pub-h_page+2;
            liste_produit.css ('height', h);
            liste_produit.show ();
        } else if (page.get (0)) {
            var h = cadre_page.height ()+h_pub-h_page+2;
            cadre_page.css ('height', h);
        }
    } else if (h_pub < h_page) pub.css ('height', h_page-2);
});

