$(document).ready(function(){

if ($.cookie('format') == '4:3' || $.cookie('format') == null) {
 chooseStyle('styles', 60);
 $("#wrapperRecherche a.quatre").addClass("select");
 $("#diaporama").remove();
 initSlide(960, 230);
  
} else if ($.cookie('format') == '16:9') {
 chooseStyle('styleLangue_wi', 60);
 $("#wrapperRecherche a.seize").addClass("select");
 initSlide(1397, 230);
  
}

$("#wrapperRecherche a.quatre").click(function() { setCookieFormat('4:3'); });
$("#wrapperRecherche a.seize").click(function() { setCookieFormat('16:9'); });

});




function setCookieFormat(valeur)
{
  $.cookie('format', valeur , { expires: 365 });
  location.reload();  
}

function initSlide(width, height)
{
    if ($("#scrollAccueil").size() > 0) {
        $("#scrollAccueil").slidable({
            width: width,
            height: height,
            vitesse : 1,
            arrowWidth : 50,
            shadow : true,
            shadowWidth : 7
        });
    }
}
