var hideit=new Hash();

    function check_hide(myid){
    window.console.log("hide")
    if (myid==undefined) myid=this.id
    if (myid==undefined) return
    if (hideit.get(myid) == undefined) {
        var myid=myid
        hideit.set(myid,window.setTimeout(function() {
            $(myid).hide();
            hideit.unset(myid);
            $(myid+'link').setStyle({background:'none'})
        },300));            
    }
    }
    
    function check_show(myid,thisid){
    if (thisid!= undefined) $(thisid).setStyle({background:'#fff'})
    window.console.log("show")
    if (myid==undefined) myid=this.id
    if (myid==undefined) return
    window.console.log(myid)
    if (hideit.get(myid) != undefined)
        {
            window.clearTimeout(hideit.get(myid)); 
            hideit.unset(myid);
            }
    $(myid).show()
    }
    

    function check_hide2(){
    window.console.log("hide2")
    var myid=this.id
    if (myid==undefined) return
    if (hideit.get(myid) == undefined) {
        var myid=myid
        hideit.set(myid,window.setTimeout(function() {$(myid).hide();hideit.unset(myid);$(myid+'link').setStyle({background:'none'})},300));            
    }
    }
    
    function check_show2(){
    window.console.log("show 2")
    var  myid=this.id
    if (myid==undefined) return
    window.console.log(myid)
    if (hideit.get(myid) != undefined)
        {
            window.clearTimeout(hideit.get(myid)); 
            hideit.unset(myid);
            }
    $(myid).show()
    }

    function resize(){
        var width
        width=$('mybody').getWidth()-400
        width=width-(width%197)
        $('middle_col').setStyle({width:width+'px'})
        }
      
    function scroll_up(){
        if ($('menux').getHeight()+$('menux').positionedOffset()[1]>$('menuxcontainer').getHeight())  
        {
        new Effect.Move ($('menux'),{ x: 0, y: -80, mode: 'relative'});
        }
        return false;
    }
    
    function scroll_down() {
        if ($('menux').positionedOffset()[1]<0) 
        {
            new Effect.Move ($('menux'),{ x: 0, y: 80, mode: 'relative'})
        };
        return false;
    }

    Event.observe(window, "load", function(){

    $('instrumente','categorie','author','offer').each(function(button){
        if (button.hasClassName('submenu1')) 
            {
                button.onmouseout=check_hide2;
                button.onmouseover=check_show2;
            }
        });
    });
    
    Event.observe(window, 'load', resize);
    Event.observe(window, 'resize', resize);
