var catalog = new fConnector('catalog');

$(function(){

    /*$('.scroll-text').jScrollPane({scrollbarWidth:20});
    $('.jScrollPaneDrag').css('height', '32px');
    
    $('.go').click(function(evn){
        evn.preventDefault(); evn.stopPropagation();
        $('.layer1-inner').animate({'marginLeft':-980},650,'easeOutSine');
        $('.layer2-inner').animate({'marginLeft':-980},900,'easeOutSine');
        //$('body').hide().css('background', 'url(/templates/_ares/images/bg_02.png) repeat-x 0 115px').show(500);
        $('body').css('background', 'url(/templates/_ares/images/bg_02.png) repeat-x 0 115px');
    });  */
    
    
    $("table td > div").hover(function(){
        if($($(this).parents()[0]).find('div.popup').length){
            $('> a', this).addClass('selected');
            $($(this).parents()[0]).find('div.popup').css({display: "block"}).show(50);
        } /*else {
            $('> a', this).addClass('selected2');
        }   */
    },function(){
        if($($(this).parents()[0]).find('div.popup').length){
            if(!$('> a[href=' + window.location.href + ']', this).length){
                $('> a', this).removeClass('selected');
            } else if($('> a', this).attr('class').length > 1){
                $('> a', this).removeClass('selected');
            }            
            $($(this).parents()[0]).find('div.popup').css({display: "none"}).hide();
        } else {
            if(!$('> a[href=' + window.location.href + ']', this).length){
                $('> a', this).removeClass('selected2');
            }
        }   
    });
    
    $($('div.popup a.selected').parents()[2]).prev().addClass('selected2');
        
});
