$(document).ready(function() {   
	
	var width = jQuery('body').width();
    var height = jQuery(window).height();
    var left = (width - 1004)/2 + 'px';
    var wrapper = (width - 1004)/2 + 260 + 'px';
    var menu_height = (height - 191) + 'px';
    $('#top').css('margin-left',left);
    if ($.browser.msie && $.browser.version.substring(0,1) === '6') {
        $('#left').css('margin-left',(width - 1004)/4 + 'px');
        $('#left').css('height',menu_height);
    }
    else {
        $('#left').css('margin-left',left);
        $('#left').css('height',menu_height);
        $('#wrapper').css('margin-left',wrapper);
    }
            
    $(function() {
        $('#left').jScrollPane({
            showArrows: true,
            'verticalDragMinHeight': 0,
            'verticalDragMaxHeight': 58                 
        });
    });    

    $('#brands a').mouseover(function() {
    	$(this).children('a img').attr('src',$(this).children('a input.c').val());
    });
    $('#brands a').mouseout(function() {
    	$(this).children('a img').attr('src',$(this).children('a input.bw').val());
    });
	
    $('.dropbox').mouseover(function(){
    	$('.start').attr('class','start menu-item-start');
    	$('.item').attr('class','item menu-item');
    	$('.end').attr('class','end menu-item-end');
    	var split = $(this).attr('id');
    	var id = split;
    	$('#start' + id).attr('class','start menu-item-active-start');
    	$(this).attr('class','item menu-item-active');
    	$('#end' + id).attr('class','end menu-item-active-end');
    });
    
    $('.dropbox').mouseout(function(){
    	$('.start').attr('class','start menu-item-start');
    	$('.item').attr('class','item menu-item');
    	$('.end').attr('class','end menu-item-end');
    	var split = $(this).attr('id');
    	var id = split;
    	$('#start' + id).attr('class','start menu-item-start');
    	$(this).attr('class','item menu-item');
    	$('#end' + id).attr('class','end menu-item-end');
    });
    
    $('#menu ul li').hover(
		function() {
			var menu_id = $(this).attr('id');
			$('ul#submenu-'+menu_id).fadeIn();
		},
		
		function() {
			var menu_id = $(this).attr('id');
			$('ul#submenu-'+menu_id).hide();
		}
	);    	
});
