$(document).ready(function(){
	$("div#properties ul#rotate li").hide();
	$("div#properties ul#rotate li:first").show();
	$t = setTimeout('featuredProperties(1)', 10000);
	$("div#properties div.properties a").click(function(){
		clearTimeout($t);
		featuredProperties($(this).index());
	});
	$("img.expander").imgExpander();
});
function featuredProperties(propertyindex){
	previndex = propertyindex-1;
	if(previndex < 0)
		previndex = $("div#properties ul#rotate li").length-1;
	nextindex = propertyindex+1;
	if(nextindex == $("div#properties ul#rotate li").length)
		nextindex = 0;
	$("div#properties ul#rotate li:eq("+previndex+")").fadeOut(1000);
	$("div#properties ul#rotate li:eq("+propertyindex+")").fadeIn(1000);
	$("div#properties div.property").slideUp(500, function(){
		$("div#properties div.property")
			.html($("div#properties ul#rotate li:eq("+propertyindex+") img").attr('alt'))
			.slideDown(500);
	});
	$("div#properties div.properties a.active").removeClass('active');
	$("div#properties div.properties a:eq("+propertyindex+")").addClass('active');
	$t = setTimeout('featuredProperties('+nextindex+')', 10000);
}
