 // preload images
 jQuery.preloadImages = function(className){
	 var preload_image_object = new Image();
	 var image_url = new Array();
	 
	 $(className).each(function(){
		$replaceBy = $(this).attr("src").replace(/([^/]+)_[a-z]((\.gif)|(\.jpg))$/g, "$1_on$2");
	 	image_url.push($replaceBy);
	 });
	 
	 for (var j = 0; j < image_url.length; j++) { 
		 preload_image_object.src = image_url[j];
	 }
 };

$(document).ready(function() { 
	// swap menu buttons
	$(".button").hover(
		function() {
			$replaceBy = $(this).attr("src").replace(/([^/]+)_off((\.gif)|(\.jpg))$/g, "$1_on$2");
			$(this).attr("src", $replaceBy);
		},
		function() {
			$replaceBy = $(this).attr("src").replace(/([^/]+)_on((\.gif)|(\.jpg))$/g, "$1_off$2");
			$(this).attr("src", $replaceBy);
		}
	)

	// preload image
	//$.preloadImages(".button");	
 });
 
 
