

window.addEvent('domready', function(){


    $('myOtherElement').addEvents({
        'mouseenter': function(){
            // Always sets the duration of the tween to 1000 ms and a bouncing transition
            // And then tweens the height of the element
            this.set('tween', {
                duration: 1000,
                transition: Fx.Transitions.Back.easeInOut  // This could have been also 'bounce:out'
            }).tween('width', '550px');
        },
        'mouseleave': function(){
            // Resets the tween and changes the element back to its original size
            this.set('tween', {}).tween('width', '200px');
        }
    });
});


//*******Ouverture XMLHttpRequest*******//
    
            var xhr = null; 
     
            function getXhr(){
                if(window.XMLHttpRequest)
                {
                   xhr = new XMLHttpRequest(); 
                }
                else if(window.ActiveXObject){ // Internet Explorer 
                   try {
                            xhr = new ActiveXObject("Msxml2.XMLHTTP");
                        } catch (e) {
                            xhr = new ActiveXObject("Microsoft.XMLHTTP");
                        }
                }
                else { 
                   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
                   xhr = false;  
                } 
            }
/**********************Fonction de l'affichage du formulaire manuel**************************/  
            function save_news()
            {
                getXhr();   
                xhr.onreadystatechange = function()
                {
                    if(xhr.readyState == 4){
                        leselect = xhr.responseText;
                        document.getElementById('log_res').innerHTML = leselect;
                         /* if(xhr.status  != 200)
                             document.getElementById('log_res').innerHTML = xhr.status;  */
                    }
                    else if(xhr.readyState == 1)
                    {
                        document.getElementById('log_res').innerHTML = '<img src="images/ajax-loader.gif"  alt=""/>';
                    }

                }
                adresse=document.myForm.adresse.value;
                var regexp = new RegExp("^[a-zA-Z0-9_\\-\\.]{3,}@[a-zA-Z0-9\\-_]{2,}\\.[a-zA-Z]{2,4}$", "g");
                MailValid="true";
                if (!regexp.test(adresse))
                {
                    MailValid="false";
                }
                else
                {
                    MailValid="true";
                }
                xhr.open("POST","newsletter.php",true);
                xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
                xhr.send("adresse="+adresse+"&MailValid="+MailValid);
                return false;
            }


/****************************************** FIN *******************************************/

/**********************Fonction de l'affichage de la galerie**************************/
            function aff_galerie(galerie_type,num_page,etat,ss_menu,p)
            {
                getXhr();   
                xhr.onreadystatechange = function()
                {
                    if(xhr.readyState == 4){
                        leselect = xhr.responseText;
                        document.getElementById('aff_gal').innerHTML = leselect;
                    }
                    else if(xhr.readyState == 1)
                    {
                        document.getElementById('aff_gal').innerHTML = '<table width="100%" bgcolor="#000000"><tr><td width="100%" height="600px" align="middle" valign="top"><br/><img src="images/ajax-loader2.gif"  alt=""/></td></tr></table>';
                    }

                }
                //alert (galerie_type);
                if (galerie_type=="simple") xhr.open("POST","include_galerie_simple.php",true);
                else  xhr.open("POST","include_galerie_moo.php",true);

                xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
                xhr.send("galerie_type="+galerie_type+"&num_page="+num_page+"&etat="+etat+"&ss_menu="+ss_menu+"&p="+p);
            }


/****************************************** FIN *******************************************/
