(function($) {
	
	$.reservationToggle = function( imagePath ) {
		
		$(".fullDescription").hide();
		
		$(".descriptionToggle").click(function () {
			
			// Get parent td element
			$parentElem = $(this).parent().parent();

			// Retrieve current result stored in id attribute
      		$currentDescriptionId = $($parentElem).attr("id");
      		
      		// Get div where description is stored
      		$descriptionElem = $parentElem.find(".fullDescription");
      		
      		// Set link HTML
      		if( $($descriptionElem).is(":visible") ){
	      		$(this).html("View Description&nbsp;<img src=\"/b2/sitemaster/367/common/images/arrow_right.gif\" alt=\"View Description\" title=\"View Description\"/>");
	      	}
	      	else{
	      		$(this).html("Close Description&nbsp;<img src=\"/b2/sitemaster/367/common/images/arrow_up.gif\" alt=\"View Description\" title=\"View Description\"/>");
	      	}

      		// Show/hide description
		    $($descriptionElem).slideToggle();

	  	});
		
	}
	
}) (jQuery);

(function($) {
	
	$.getDate = function( dateStr ) {
		
		$date = dateStr.split("/");
		$("#day").val($date[1]);
		$("#month").val($date[0]);
		$("#year").val($date[2]);
		
	}
	
}) (jQuery);

(function($) {
	
	$.populateDate = function( prepopulateDate ) {
		
		if( prepopulateDate ) {
			//ABERN 09/14/2009 --added if-else and the if(true) section
			if ($.cookie("cookie[month]") && $.cookie("cookie[day]") && $.cookie("cookie[year]")) {
				$month = $.cookie("cookie[month]");
				$day = $.cookie("cookie[day]");
				$year = $.cookie("cookie[year]");
				
				$("#datepicker").val($month+"/"+$day+"/"+$year);	
				
				$("#nightstayInput").val(jQuery.url.param("nightstay"));
			} else {
				//original begin
				$date = new Date();
				$month = parseInt($date.getMonth(),10)+1 < 10 ? "0"+(parseInt($date.getMonth(),10)+1) : parseInt($date.getMonth(),10)+1;
				$day = $date.getDate() < 10 ? "0"+$date.getDate() : $date.getDate();
				$year = $date.getFullYear();
				
				$("#datepicker").val($month+"/"+$day+"/"+$year);
				//original end
			}
		
		}
		
	}
	
}) (jQuery);
