$(function()
{
	$('.date-pick').datePicker()
	$('#start_date').bind(
		'dpClosed',
		function(e, selectedDates)
		{
			var d = selectedDates[0];
			if (d) {
				$('#end_date').dpSetStartDate(d.addDays(1).asString());
			}
		}
	);
	$('#end_date').bind(
		'dpClosed',
		function(e, selectedDates)
		{
			var d = selectedDates[0];
			if (d) {
				$('#start_date').dpSetEndDate(d.addDays(-1).asString());
			}
		}
	);
});

$(document).ready(function(){
	if ($('#red-circle').get(0)) {
		$('#red-circle').cycle({
			fx:	'fade',
			timeout: 5000,
			speed: 1000,
			sync: 0,
			pause: 1,
			slideExpr:'p',
			cleartype:0
		});
	}
});



function show_property_image (id) {
	$('#main-property-image').attr('src',property_thumbs[id].img_src);
}

function wpopUp(winURL,width,height) {
  var wwidth = (width) ? width : 800;
  var wheight = (height) ? height : 480;
  window.open(winURL,"popup","scrollbars=1,resizable=1,width=" + wwidth + ",height=" + wheight);
}

