    var currentlightbox=""; 
    var Flag=MenuHandeling=menuVisible=false;
    menuUnVisible=true;
    function menuAppear(){
        if(!MenuHandeling && menuUnVisible){
            MenuHandeling=true;
            Effect.MoveBy(document.getElementById('topMenu'),0,347,{duration:1.2,afterFinishInternal: function(effect) {
                            document.getElementById('FFBug').style.display="";
                            MenuHandeling=false;
                            menuVisible=true;
                            menuUnVisible=false;                     
            }  });
        }
    }                         
    function menuHide(){
        if(!MenuHandeling && menuVisible){
            MenuHandeling=true; 
            document.getElementById('FFBug').style.display="none"; 
            Effect.MoveBy(document.getElementById('topMenu'),0,-347,{duration:1.2 ,afterFinishInternal: function(effect) {
                            MenuHandeling=false;
                            menuUnVisible=true; 
                            menuVisible=false;                                                                            
            }
            });
        }
    }  

    function over(w){
        new Effect.Appear(document.getElementById('a'+w), { duration: LBDuration, from: 0.0, to: 0.7 });  
        new Effect.Appear(document.getElementById('txt'+w), { duration: LBDuration, from: 0.0, to: 1 }); 
        currentlightbox=w;
    }
    
    function out(k){
        if(k!=""){ 
            for(var ii=1;ii<=k;ii++){   
                  if(document.getElementById('a'+ii))
                    document.getElementById('a'+ii).style.display="none";
                  if(document.getElementById('txt'+ii))      
                    document.getElementById('txt'+ii).style.display="none"; 
            }                                                                                                                                
        } 
    }
    
    function stopbubble(evt){
        if(evt.target)    
             evt.stopPropagation();  
        else
            event.cancelBubble=true;
        
    }             
    
    function subm(){
        mmail=arguments[0]?arguments[0]:'contactEmail';
        mmessage=arguments[1]?arguments[1]:'contactMessage';
        aauthor=arguments[2]?arguments[2]:'';
        eerstr=arguments[3]?arguments[3]:"\n Все поля являются необходимыми для заполнения.";
        fform=arguments[4]?arguments[4]:"contactForm";
                                                           
        if(submchecker(mmail,mmessage,aauthor,eerstr)){
           document.getElementById(fform).submit();
        }
    }
          
    function submchecker(mmail,mmessage,aauthor,eerstr){
        var errstring="";
        if($(aauthor)){
            if(aauthor!=''){    
                if($(aauthor).value.length<2){
                    errstring+='Введите имя\n';        
                }  
            }  
            
            var mail=$(mmail).value; 
            if($(mmail).value.length<2){
                errstring+='Введите e-mail\n';        
            }   
            else{
                if(mail.match('\\s*?[\\w-.]+@[\\w-]+(\\.[\\w-]+)+\\s*?')==null || mail.match('\\s*?[\\w-.]+@[\\w-]+(\\.[\\w-]+)*\\s*')[0]!=mail)
                    errstring+='Введите корректный e-mail\n';                
            } 
            if($(mmessage).value.length<2){
                errstring+='Введите комментарий\n';        
            }
            if(errstring){
                confirm(errstring+eerstr);
                return false;        
            }    
        } 
        return true;    
    }   