function alternate() {
        $$('.slideEvenement').each(function (el) {
            jQuery("#" + $(el).id).jCarouselLite({
                auto:2000,
                circular:true,
                vertical: true,
                visible: 1,
                speed:2000
            });
        });
        $$('.slideJeuxCadeaux').each(function (el) {
            jQuery("#" + $(el).id).jCarouselLite({
                auto:2000,
                circular:true,
                vertical: true,
                visible: 1,
                speed:2000
            });
        });
    }
    var images = new Array();
    var imageObj = new Image();
    images[0]=gCONFIG["BASE_URL"] + "system/application/resources/images/vitrines/default/presentation_on.jpg";
    images[1]=gCONFIG["IMG1_COMMERCE"];
    images[2]=gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/default/evenements_on.jpg";
    images[3]=gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/default/avis_on.jpg";
    images[4]=gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/default/ami_on.jpg";
    for(i=0; i<=3; i++){
      imageObj.src=images[i];
    }
    function setImgSrc(prmObjImg, prmImgFileName){
        prmObjImg.src =gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/default/"+prmImgFileName;
    }
    function goToRecommandation(IdOrganisme) {
        document.location = gCONFIG["SITE_URL"]+"/organismes/afficher/" + IdOrganisme + "";
    }
    function goToElement(IdElement, IdElement2) {
        $$('.target').each(function (el) {
            if (IdElement2) {
                if((el.id == IdElement) || (el.id == IdElement2)) {
                    el.show();
                } else {
                    el.hide();
                }
            } else {
                if(el.id == IdElement) {
                    el.show();
                } else {
                    el.hide();
                }
            }
        });
        return false;
    }
    function processAjaxData(prmId, prmUrl, prmMethode, prmOutElmnt, prmCmpltFunction) {
        var updtParams = "";
        if (prmId != "") {
            updtParams = $(prmId).serialize();
        }
        var ouputElmt = $(prmOutElmnt);
        if (ouputElmt) {
            var AjaxRequest = new Ajax.Request(
                prmUrl, {
                    method: prmMethode,
                    parameters: updtParams,
                    asynchronous: true,
                    on404: function (xhr) {
                        ouputElmt.innerHTML = "
";
                    },
                    onFailure: function (xhr) {
                        ouputElmt.innerHTML = "";
                    },
                    onException: function (xhr, exception) {
                        ouputElmt.innerHTML = "";
                    },
                    onComplete: function (xhr, json) {
                        if (prmMethode == "GET") {
                            ouputElmt.innerHTML = xhr.responseText;
                        }
                        if (prmCmpltFunction != null){
                            eval(prmCmpltFunction);
                        }
                    }
                }
            );
        }
    }
    
function loadDynamicContent(zUrl, zDestID) {
    $(zDestID).innerHTML = "";
    new Ajax.Updater(zDestID,zUrl,{ asynchronous:true, evalScripts:true });
}
    
    function ietruebody(){
        return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
    }
    function getSize() {
      var myWidth = 0, myHeight = 0;
      if( typeof( window.innerWidth ) == 'number' ) {
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
      arrSize = new Array();
      arrSize[0] = myWidth;
      arrSize[1] = myHeight;
      return arrSize;
    }
    function getScrollXY() {
      var scrOfX = 0, scrOfY = 0;
      if( typeof( window.pageYOffset ) == 'number' ) {
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
      } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
      }
      return [ scrOfX, scrOfY ];
    }
    function open_fenetre_flottante(w,h,t) {
        mySize = getSize();
        
        var winWidht = screen.width;
        var winHeight = screen.height;
        var leftpos = (winWidht - w) / 2;
        var toppos = (winHeight - h) /2;
        var ie=document.all;
        var objPopUp = $("scontentmain");
        objPopUp.style.zIndex = "1000";
        objPopUp.style.width = w + "px";
        objPopUp.style.height = h + "px";
        wid = ietruebody().scrollLeft;
        hei = ietruebody().scrollTop;
        objPopUp.style.left = ((mySize[0] - w) / 2) + "px";
        objPopUp.style.top = ((mySize[1] - h) / 2) + hei + "px";
        
        if (ie) {
            $("popupcontent_a").style.width = (w) + "px";
        } else {
            $("popupcontent_a").style.width = (w - 2) + "px";
        }
        $("popupTitleText").innerHTML = t;
        objPopUp.style.display="block";
    }
    
    function close_fenetre_flottante() {
        var objPopUp = $("scontentmain");
        $("popupcontent").update("");
        objPopUp.style.zIndex = "0";
        objPopUp.style.width = "0px"; 
        objPopUp.style.display="none";
        if (document.getElementById('confirm_frame')) {
            document.getElementById('confirm_frame').style.display="none";
        }
        if (document.getElementById('div_fond_fenetre_popup')){
            if(document.getElementById('div_fond_fenetre_popup').style.display = "block"){
                cacherFonce2('div_fond_fenetre_popup', '', 'confirm_frame_popup');
            }
        }
    }
    function show_popup(zWidth, zHeight, zTitle, zUrl, zFunction) {
        if (zFunction == null){
            zFunction = "";
        }
        open_fenetre_flottante(zWidth, zHeight, zTitle);
        show_loading('popupcontent');
        updateModule(zUrl, "popupcontent", zFunction);
        new Draggable("scontentmain",{handle : 'handlePopupDragDrop'});
    }
    function show_loading(div) {
        if($(div)){
            var outDiv = $(div);
            outDiv.innerHTML = "";
        }
        
    }
    function updateModule(prmUrl, prmOutElmnt, prmCmpltFunction) {
        var UpdtModule = new Ajax.Updater(
            prmOutElmnt,
            prmUrl,
            {
                asynchronous:true,
                evalScripts:true,
                onComplete: function(xhr){
                    if ((prmCmpltFunction) && prmCmpltFunction != "") {
                        eval(prmCmpltFunction);
                    } 
                }
            }
        );
    }
    function popup_reglement_jeu(){
        afficherFonce2('div_fond_fenetre_popup', 'confirm_frame_popup', 800);
        show_popup(900,600, 'Réglement du jeu',gCONFIG["SITE_URL"]+'/accueil/popup_reglement_jeu/');
    }
    function refreshCaptchaPartage(prmFunction) {
        updateModule(gCONFIG["SITE_URL"] + "/partages/generate_captcha", "tdCaptchaPartage", prmFunction);
    }
    function frmPartageParMailIsValid(prmCaptcha) {
        msg = "";
        if(isEmpty($("MonPrenom").value)) {
            $("divErrorPartagePrenom").style.display= "block";
            msg += "1";
        } else {
            $("divErrorPartagePrenom").style.display= "none";
        }
        
        if(isEmpty($("MonNom").value)) {
            $("divErrorPartageNom").style.display= "block";
            msg += "1";
        } else {
            $("divErrorPartageNom").style.display= "none";
        }
        
        if(isEmpty($("MessageTitre").value)) {
            $("divErrorPartageTitre").style.display= "block";
            msg += "1";
        } else {
            $("divErrorPartageTitre").style.display= "none";
        }
        
        if(!isEmail($("MonEmail").value)) {
            $("divErrorPartageEmail").style.display= "block";
            msg += "1";
        } else {
            $("divErrorPartageEmail").style.display= "none";
        }
        
        if(!isEmail($("EmailDestinataire").value)) {
            $("divErrorPartageEmailDestinataire").style.display= "block";
            msg += "1";
        } else {
            $("divErrorPartageEmailDestinataire").style.display= "none";
        }
        
        if(isEmpty($("VotreMessage").value)) {
            $("divErrorPartageMessage").style.display= "block";
            msg += "1";
        } else {
            $("divErrorPartageMessage").style.display= "none";
        }
        
        if (msg == "") {
            return true;
        } else {
            return false;
        }
    }