/* Do Initialization */
$(document).ready(function() {
	if($("form[name^='frmBookingInfo']").length)
	{
		$("form[name^='frmBookingInfo']").each(function(i, el){
			$(el).find("select").bind("change", function(){
				$(el).find("input[type=submit]").hide();
				$(el).find("input[type=button]").show();
			});
		});
	}
});

function recalculateCost(frmNo)
{
	$('#loader'+frmNo).show();
	xajax_ReservationAjaxCall("Reservation", "ReCalculateCost", xajax.getFormValues('frmBookingInfo'+frmNo));
}

function showNewCost(Cost, frmNo) {
	$('#cost'+frmNo).text(Cost);
	$('#frmBookingInfo'+frmNo+" input[type=submit]").show();
	$('#frmBookingInfo'+frmNo+" input[type=button]").hide();
	$('#loader'+frmNo).hide();
}

/* Reservation submision */
function onReservation_Submit2(frm)
{
	with(frm)
	{	
		if(!IsEmpty(rreserv_cust_first_name, JSM_Please_Enter_First_Name))
		{			
			return false;
		}	
		if(!IsEmpty(rreserv_cust_last_name, JSM_Please_Enter_Last_Name))
		{			
			return false;
		}	
		if(!IsEmpty(rreserv_cust_address, JSM_Please_Enter_Address))
		{			
			return false;
		}
		if(!IsEmpty(rreserv_cust_city, JSM_Please_Enter_City))
		{			
			return false;
		}
		if(!IsEmpty(rreserv_cust_state, JSM_Please_Enter_State))
		{			
			return false;
		}
		if(!IsEmpty(rreserv_cust_zip, JSM_Please_Enter_Zip))
		{			
			return false;
		}
		if(!IsEmpty(rreserv_cust_country, JSM_Please_Select_Country))
		{			
			return false;
		}
		if(!IsEmpty(rreserv_cust_email, JSM_Please_Enter_Email))
		{			
			return false;
		}
		else if(!IsEmail(rreserv_cust_email, JSM_Please_Enter_Valid_Email))
		{			
			return false;
		}		
		if(!IsEmpty(rreserv_cust_mobile, JSM_Please_Enter_Mobile))
		{			
			return false;
		}
		if(!IsEmpty(code_of_image, JSM_Please_Enter_Spam_Verification))
		{			
			return false;
		}
		return true;
	}	
}
