$(document).ready(function() {

	$('#mainPhoto').cycle('fade');
	
	// Menu Image Replacement
	$('#navigation ul li a').each(function() {
		var thisID = $(this).attr('id');
		$(this).html('<img src="/media/layout/' + thisID + '.gif" alt="" />');
	});
	
	$('#navigation ul li a img').hover(
	function() {
		$(this).css('top', '-35px');
	},
	function() {
		$(this).css('top', '0');
	});
	
	/*$('div.resultThumb').click(function() {
		var thumbID = $(this).attr('rel');
		var regex = /^.*(?=-thumb)/;
		thumbID = thumbID.match(regex).toString();
		thumbID = '#' + thumbID + '-result';
		$(this).scrollTo(thumbID, 1000);
		return false;
	});*/
	
	$('img.gallery-thumb').hover(
	function () {
		var thisID = $(this).attr('id');
		var regex = /^.*(?=-thumb)/
		thisID = thisID.match(regex).toString();
		$('#otherPhoto img:visible').fadeOut(300);
		$('#otherPhoto img#' + thisID + '-main').fadeIn(300);
	},
	function() {
		//nada
	});
	
	$('ul#gallery-thumbs').hover(function() {
		//nada
	},
	function() {
		$('#otherPhoto img:visible').fadeOut(300);
		$('#otherPhoto img:first').fadeIn(300);
	});
	
	$('#email-friend-link').click(function(){
	window.open('/rentals/email.cfm','mywindow','width=600,height=280')
	return false; 
	});
	
	$('#more-info-link').click(function(){
	$('#more-info-number').slideToggle('slow');
	return false; 
	});
});