$(function() {
		 var imgPath = '/img/motels/';
		 var buttons = [
			"search-button"
			,"signup-button"
			,"submit-button"
		 ];
		 for(i=0;i<buttons.length;i++){
				if($('#'+buttons[i])){
					$('#'+buttons[i]).hover(function() {
						 $(this).attr('src', imgPath+$(this).attr('id')+'-over.png');
						 }, function() {
						 $(this).attr('src', imgPath+$(this).attr('id')+'.png');
						 });
				};
		 };
});
/*-------------------------------------------------------------------------*/
function wipe(el) {
	if($(el).attr('value') == $(el).attr('title')) $(el).attr('value','');
}
/*-------------------------------------------------------------------------*/
function calculateDate(dt, el)
{
	var days = $('#'+el).val();
	var checkin = new Date();
	var date = $('#'+dt).val().split("/");
	
	checkin.setYear(date[2]);
	checkin.setMonth(date[1]-1);
	checkin.setDate(date[0]);
	
	checkin.setDate(checkin.getDate() + parseInt(days));
	
	var coDay = (parseInt(checkin.getDate()) < 10 ? "0" : "" ) + checkin.getDate();
	var coMon = (parseInt(checkin.getMonth()) < 9 ? "0" : "" ) + (checkin.getMonth()+1);

	var formattedDate = ' ' + coDay + '/' + coMon + '/' + checkin.getFullYear();
	$('#departureDateDisplay').text(formattedDate);
};
