$(document).ready(function(){

$.preloadImages = function() {
    for (var i = 0; i<arguments.length; i++) {
        img = new Image();
        img.src = arguments[i];
     }
    }
    $.preloadImages (
        "/i/menu/about_company-e_active.png",
        "/i/menu/about_company_active.png",
        "/i/menu/buyer_and_owner-e_active.png",
        "/i/menu/buyer_and_owner_active.png",
        "/i/menu/cars-e_active.png",
        "/i/menu/cars_active.png",
        "/i/menu/investors_and_partners-e_active.png",
        "/i/menu/investors_and_partners_active.png",
        "/i/menu/media-e_active.png",
        "/i/menu/media_active.png"
    );


		$(".menu-top .menu-item").mouseenter(
		function(){
    	  $(".menu-top .menu-item div").removeClass('show');
		  $(".menu-top .menu-item div").addClass('hide');
          $(this).addClass('active');
		  
     	newBGImage ="";
        IMGname = "";
		thisBG = $(this).css("background-image");
	    /*if ($.browser.webkit) { IMGname = $(this).css("background-image").replace('.png)','');  }
    		else { IMGname = thisBG.replace(/.png\"\)/gi,""); }*/
		IMGname = thisBG.replace(/.png\"\)/gi,"")
		 
		   if ($.browser.webkit) {newBGImage = ""; newBGImage = IMGname + '_active.png)'; }
		     else {newBGImage = ""; newBGImage = IMGname + '_active.png")';}
		 
		  $(this).css("background-image",newBGImage);
		  $(this).find('div').removeClass('hide');	
  		  $(this).find('div').addClass('show');  
		});
	  
	  $(".menu-top .menu-item").mouseleave(	
		function(){
			    $(this).find('div').removeClass('show');
				$(this).find('div').addClass('hide'); 
				$(this).removeClass('active');
				$(this).css("background-image",thisBG);
		});
	
	});

