$(document).ready(function(){
//function initRollOverImages() {
	var image_cache = new Object();
	
	$(".rollover a img").not("[src*='-on.']").each(function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '-on' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(
			function() { 
				this.src = imgsrc_on;
				if (this.id != 'amen') {
					$('#amendrop').hide('fast'); 
				}
			},
			function() { 
				this.src = imgsrc; 
			}
		);

	});
	
	$("img.rollover").not("[src*='-on.']").each(function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '-on' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(
			function() { 
				this.src = imgsrc_on;
				$('#amendrop').hide('fast'); 
			},
			function() { 
				this.src = imgsrc; 
			}
		);

	});
	

	$('#amendrop').hide();
	
	$('#amenities').mouseover(
		function() {
      		$('#amendrop').show('fast');
		}
		
	);

	$('#amendrop').hover(
		function() {
      		$('#amendrop').show('');
		},
		function(){
			$('#amendrop').hide('');
		}
	);
	
	$(".rollover a img").not('#amenities').mouseover(
		function() {
      		$('#amendrop').hide();
		}
		
	);
	
	$("#mainPic").mouseover(
		function() {
      		$('#amendrop').hide();
		}
		
	);
	
	$.ajaxSettings.cache = false;
	
});
