// JavaScript Document

$(document).ready(function(){	
	// Create the sliders
	$("#slider1").easySlider({
		controlsBefore:	'<p id="slider1controls" class="controls">',
		controlsAfter:	'</p>',
		prevText: '<img src=\"images/slideNavPrev.gif" alt="Previous button" />',
		nextText: '<img src=\"images/slideNavNext.gif" alt="Previous button" />',
		continuous: false
	});
	$("#slider2").easySlider({
		controlsBefore:	'<p id="slider2controls" class="controls">',
		controlsAfter:	'</p>',		
		prevId: 'prevBtn2',
		prevText: '<img src=\"images/slideNavPrev.gif" alt="Previous button" />',
		nextText: '<img src=\"images/slideNavNext.gif" alt="Previous button" />',
		nextId: 'nextBtn2',
		continuous: false
		
	});
// Catch if the display slide controls are clicked
$('#slideDisplayControls a').click(function(){
	// hide all the slides and show the correct one
	$(".slider").hide();
	$(".controls").hide();
	$("#" + $(this).attr("class")).show();
	$("#" + $(this).attr("class") + "controls").show();
	return false;
});

$(".slider").hide();
$(".controls").hide();
$("#slider1").show();
$("#slider1controls").show();

$('.propertyImage').reflect({height: 0.3, opacity: 0.6});

// activate/deactivate the slide swap buttons
$("#slideDisplayControls a").click(function(){
	// set all images to off
	$(".slider1 img").attr("src","images/slideNavRentals.gif");
	$(".slider2 img").attr("src","images/slideNavBuy.gif");
	// set selected image to on
	
	sliderOnNavImage = $("."+$(this).attr("class") + " img").attr("src");
	sliderOnNavImage = sliderOnNavImage.replace(".gif","");
	sliderOnNavImage = sliderOnNavImage + "On.gif";
	$("."+$(this).attr("class") + " img").attr("src", sliderOnNavImage);
	

});
});	