var slash = '/';
/***============================================================================
        S C R I P T A C U L O U S   S L I D E R S
==============================================================================*/
/***============================================================================
        R O L L O V E R S
==============================================================================*/
        function sfRollover() { 
                if (!document.getElementById) return;
                var imgOriginSrc;
                var imgTemp  = new Array();
                var imgAlpha = new Array();
                var imgarr = document.getElementsByTagName('img');
                for (var i = 0; i < imgarr.length; i++) {
                        if (imgarr[i].getAttribute('hsrc')) {
                                imgTemp[i]            = new Image();
                                imgTemp[i].src        = imgarr[i].getAttribute('hsrc');
                                imgarr[i].onmouseover = function() {
                                        imgOriginSrc = this.getAttribute('src');
                                        this.setAttribute('src',this.getAttribute('hsrc'));
                                };
                                imgarr[i].onmouseout = function() {this.setAttribute('src',imgOriginSrc);};
                        };
                };
        };
        
/***============================================================================
        M E N U
==============================================================================*/
        sfHover = 
                function() {
                        /*var sfEls = document.getElementById("menu").getElementsByTagName("LI");*/
                        var sfEls = $('menu').getElementsByTagName("LI");
                        for (var i=0; i<sfEls.length; i++) {
                                sfEls[i].onmouseover=
                                        function() { this.className+=" sfhover";};
                        
                                sfEls[i].onmouseout=
                                        function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), "");};
                        };
                };
        
        if (window.attachEvent) window.attachEvent("onload", sfHover);

/***============================================================================
        C H A R G E M E N T   D E   L A   P A G E
==============================================================================*/

        function onLoadPage() {
                sfRollover();
        };

        function onUnLoadPage() {
        };

        onload   = onLoadPage;
        onunload = onUnLoadPage;

        function browserNotification(){

                if ( !(document.getElementById && document.createElement)){

                        /*alert("pas ff");*/

                };

        };

/***============================================================================
        B R O W S E R S
==============================================================================*/

        var isIE      = ((navigator.userAgent.indexOf("MSIE")    >= 0) ? 1 : 0);
        var isFirefox = ((navigator.userAgent.indexOf("Firefox") >= 0) ? 1 : 0);
        var isSafari  = ((navigator.userAgent.indexOf("Safari")  >= 0 && navigator.vendor.indexOf("Apple")   >= 0) ? 1 : 0);

/***============================================================================
        D O M
==============================================================================*/


/***============================================================================
        F O N C T I O N S
==============================================================================*/

        function changeInPW(o, originalClassName){
                o.value = '';
                o.type = 'password';
                o.className = originalClassName;
        };

/***============================================================================
        F O N C T I O N N E M E N T   G E N E R A L
==============================================================================*/

        /*----------------------------------------------------------------------
         ne fait rien
        ----------------------------------------------------------------------*/
        function doNothing(){
                return null;
        };
        
        function f_36245(label){
                var v1_36245 = [];
                v1_36245[0] = 'info';
                v1_36245[1] = 'pirey';
                v1_36245[2] = 'ch';
                v1_36245[3] = (label=='' ? 'e-mail' : label);
                var t='<a href="mailto:' + v1_36245[0] + '@' + v1_36245[1] + '.' + v1_36245[2] + '?subject=' + v1_36245[3] + '">';
                return t+v1_36245[3]+"</a>";
        }

        /*----------------------------------------------------------------------
         formatte un texte
        ----------------------------------------------------------------------*/
        function contentDisplay(content) {
                
                content.replace( " "   ,"&nbsp;");
                
                content.replace( "\r\n","<br>");
                content.replace( "\r"  ,"<br>");
                content.replace( "\n"  ,"<br>");
                
                return content;
                
        };

        /*----------------------------------------------------------------------
         renvoie le code de la touche appuyee lors d'un evenement clavier
        ----------------------------------------------------------------------*/
        function getKeyCode(evenement){
                for (prop in evenement){
                        if(prop == 'which') return evenement.which;
                }

                return event.keyCode ? event.keyCode : event.charCode;
        };

        /***--------------------------------------------------------------------
                affiche ou cache des objets
        ----------------------------------------------------------------------*/

        function show_hide(obj)  { if (isDisplayed(obj)){hide(obj)         }else{show(obj)        } } ;
        function visibility(obj) { if (isVisible(obj)  ){invisible(obj)    }else{visible(obj)     } } ;
        function fade(obj, step) { if (isVisible(obj)  ){fadeOutObject(obj.id, step);}else{fadeInObject(obj.id, step);} } ;

        function visible(obj)    { obj.style.visibility = 'block';};
        function invisible(obj)  { obj.style.visibility = 'hidden';};
        function isVisible(obj)  { return obj.style.visibility != 'hidden';};

        function show(obj)       { obj.style.display = 'block';};
        function hide(obj)       { obj.style.display = 'none';     };
        function isDisplayed(obj){ return obj.style.display == 'block';     };


        function showTab(li, lis, tab, tabs){
                for (l=0; l < lis.length; l++) lis[l].className = '';
                li.className = 'selected';

                for (t=0; t < tabs.length; t++) hide(tabs[t]);
                show(tab);
        };

        function getParagraphs(a){

                var var2Return = '';
        
                for (i=0; i < a.length; i++) {
                        var2Return = var2Return + '<p class="error_title">' + a[i].error_number + '</p>' + '<p class="error_text">' + a[i].error_message + '</p>';
                }

                return var2Return;
        };


/***============================================================================
        D Y N A M I C
==============================================================================*/

	function x_image_src(o){
        
                var url         = ajaxURL + 'AJAXController';
                var params      = '';

                params      = 'method=image_src&photo='+o.id + '&album='+o.album;
                var ajax        = new Ajax.Request(
                        url,
                        {
                                method: 'post',
                                parameters: params,
                                onComplete: function(transport){
                                
                                        var datas = transport.responseText.replace(/^\s+/, "").replace(/\s+$/, "").evalJSON();
                                        $(o.a).href = datas.image_src;
                                }
                        }
                );
        
        };
        