jQuery(document).ready(function() {
    jQuery('#text_left').children().first().css('padding', '0 0 18px 0');
    
    //jQuery('#text_left').children('ul.menu_level_2').children('li').last().children('a').css('border','none');
    
    var active_content_wrapper_bg = jQuery('#content_wrapper').css('background-image');
    jQuery('li.meta_dacia').hover(function() {
        jQuery('#content_wrapper').css('background','url("themes/autohaus_10/images/content_wrapper_dacia.png") repeat-x');
    }, function() {
        jQuery('#content_wrapper').css('background',active_content_wrapper_bg + ' repeat-x');
    });
    jQuery('li.meta_renault').hover(function() {
        jQuery('#content_wrapper').css('background','url("themes/autohaus_10/images/content_wrapper_renault.png") repeat-x');
    }, function() {
        jQuery('#content_wrapper').css('background',active_content_wrapper_bg + ' repeat-x');
    });
    jQuery('li.meta_ford').hover(function() {
        jQuery('#content_wrapper').css('background','url("themes/autohaus_10/images/content_wrapper_ford.png") repeat-x');
    }, function() {
        jQuery('#content_wrapper').css('background',active_content_wrapper_bg + ' repeat-x');
    });
    
    $('a').click(function() {
        if($(this).attr('rel')=='popup') {
            var href = $(this).attr('href');
            var title = $(this).attr('title');
            var fenster;
            $(this).removeAttr('href');
            fenster = window.open(href, title, "width=1000,height=500,status=yes,scrollbars=yes,resizable=yes");
            fenster.focus(); 
        }    
    });
    
    $('#menubuilder2').attr('class','menu clearfix');
    
    $('#menubuilder2 li').each(function() {
        if($(this).children('ul').length>0) {
           $(this).children('a').attr('class', 'sub_sub');
        } 
    });
});
