   // behaviour rules
    var inc = 3;
    var u;
    var h;
    var up;
    var stay = 0;
    var interval;
    var start = 0;
    var limit = 360;
    
    function startScroll()
    {
        interval = setInterval('scroll()', 33);
    }
    
    function scroll()
    {
        var to  = parseInt(u.style.top);
        var go  = up ? (to - inc) : (to + inc);
        
        up ? 
            go <  limit - h ? stopScroll() : null :
            go >= 0 ? stopScroll() : null ;
        
        u.style.top = up ? 
            go >  limit - h ? go : to :
            go <= 0 ? go : to;
        
   //     $('debug').innerHTML = u.style.top;
    }
    
    function stopScroll()
    {
        clearInterval(interval);
    }
    
    
    var reset;
    function resetMenu(go)
    {
        u.style.top = start;
        clearInterval(reset);
    }
    
    var myrules = {
        '.select'  : function(element){
            element.onmouseover = function () {
            	if(stay < 1){
	                $('menu').style.visibility = 'visible';
	                clearInterval(reset);
                }
                },
                
            element.onclick = function () {
               if(stay < 1){
	                $('menu').style.visibility = 'visible';
	                clearInterval(reset);
	                stay = 1;
                }else{
	                $('menu').style.visibility = 'hidden';
	                reset = setInterval('resetMenu(1)', 200);
	                stay = 0;
                }
                },
            element.onmouseout  = function () {
               if(stay < 1){
	                $('menu').style.visibility = 'hidden';
	                reset = setInterval('resetMenu(1)', 200);
               }
                }
            }, 
        '.go'   : function(element){
            element.onmouseover = function () {
                up = this.id == 'dn';
                startScroll(); 
                },
            element.onmouseout  = function () {
                stopScroll();
                },
            element.onclick     = function () {
                return false;
                }
            },
        'a'     : function(element){
            element.onfocus = function () {
                this.blur();
                }
            }
        };

    Behaviour.register(myrules);
    
    
    Behaviour.addLoadEvent( function () {
        u           = $('ul');
        h           = $('ul').clientHeight;
        u.style.top = start;
        
    //    $('debug').innerHTML = h;
        });
