
$(document).ready(function(){

	$('.inv_small_container').live('mouseover mouseout', function(event) {
		  if (event.type == 'mouseover') {
				$(this).css('background-color', '#bee9ff');
				
		  } else {
				 $(this).css('background-color', '#fff');
		  }
		}); 
		
	$('.menu').hover( 
		  function () {
			var name = $(this).attr("name").match(/[^\.]+/) + "_over";
				$(this).attr("src", "images/menu/" + name + ".png");

		  }, 
		  function () {
			 var name = $(this).attr("name");
			   $(this).attr("src", "images/menu/" + name + ".png");

		  }
		  
		);
		$('#logout').live('mouseover mouseout', function(event) {
		  if (event.type == 'mouseover') {
				$(this).css('background-color', '#fff');
		  } else {
				$(this).css('background', 'none');
		  }
		}); 
		
		
	 $('.over').live('mouseover mouseout', function(event) {
		  if (event.type == 'mouseover') {
				var name = $(this).attr("name").match(/[^\.]+/) + "_over";
				$(this).attr("src", "images/" + name + ".gif");
		  } else {
				var name = $(this).attr("name");
			   $(this).attr("src", "images/" + name + ".gif");
		  }
		}); 
		
		 $('.submit_offer_final').live('mouseover mouseout', function(event) {
		  if (event.type == 'mouseover') {
				var name = $(this).attr("name").match(/[^\.]+/) + "_over";
				$(this).attr("src", "images/" + name + ".gif");
		  } else {
				var name = $(this).attr("name");
			   $(this).attr("src", "images/" + name + ".gif");
		  }
		}); 
		
		 $('.make_offer').live('mouseover mouseout', function(event) {
		  if (event.type == 'mouseover') {
				var name = $(this).attr("name").match(/[^\.]+/) + "_over";
				$(this).attr("src", "images/" + name + ".gif");
		  } else {
				var name = $(this).attr("name");
			   $(this).attr("src", "images/" + name + ".gif");
		  }
		}); 
	
		
		$('.inventory').live('mouseover mouseout', function(event) {
		  if (event.type == 'mouseover') {
				$(this).css('background-color', '#fff7e1');
				$(this).css('border-left', '1px solid #ccc');
				$(this).css('border-right', '1px solid #ccc');
				$(this).css('border-top', '1px solid #ccc');
		  } else {
				$(this).css('background-color', '#fff');
			   $(this).css('border-left', '1px solid #fff');
			   $(this).css('border-right', '1px solid #fff');
			   $(this).css('border-top', '1px solid #fff');
		  }
		});
		
		$('.inventory_classifieds').live('mouseover mouseout', function(event) {
		  if (event.type == 'mouseover') {
				$(this).css('background-color', '#fff7e1');
				$(this).css('border-left', '1px solid #ccc');
				$(this).css('border-right', '1px solid #ccc');
				$(this).css('border-top', '1px solid #ccc');
		  } else {
				$(this).css('background-color', '#fff');
			   $(this).css('border-left', '1px solid #fff');
			   $(this).css('border-right', '1px solid #fff');
			   $(this).css('border-top', '1px solid #fff');
		  }
		});

		
		
		(function($) {
			  var cache = [];
			  // Arguments are image paths relative to the current page.
			  $.preLoadImages = function() {
				var args_len = arguments.length;
				for (var i = args_len; i--;) {
				  var cacheImage = document.createElement('img');
				  cacheImage.src = arguments[i];
				  cache.push(cacheImage);
				}
			  }
			})(jQuery)

			jQuery.preLoadImages("images/menu/1_over.png", "images/menu/2_over.png", "images/menu/3_over.png", "images/menu/4_over.png", "images/menu/5_over.png", "images/print_inventory_button_over.gif", "images/current_models_over.gif", "images/submit_offer_over.gif", "images/make_offer_over.gif");
	

});
