/**
 * Weekly home helper js functions
 */

//attach the image swapping behaviour
$("document").ready(function(){
	//add the on click event to the small images
	$("a.small-image").attr("href","#main-image");
	$("img.small-image").click(function(){
		var main = $(this).attr('src');
		main = main.replace(/property_image_page_small/,'property_image_page_large');
		$("img.large-main-image").attr('src',main);
		return false;
	});
});
function weekly_home_lateavail_remove(nid) {
	document.body.style.cursor = 'wait';
  var params = 'nid=' + Drupal.encodeURIComponent(nid);

  $.ajax({
    type: "POST",
    async: true,
    url: Drupal.settings.weekly_home.late_availability_remove_url,
    data: params,
    dataType: "string",
    success: function (response) {
			$('#property-row-' + nid).remove();
			document.body.style.cursor = 'default';
    }
  });
};


