var errTxt = '';
var harborData = '<table width="100%" id="harborTable"><tr><td align="left" width="36%">Cruise Ship Details<span class="error">*</span></td><td align="center" width="1%">:</td><td align="left" width="63%"><input type="text" name="d_ship_name" id="d_ship_name" class="textfield2" /></td></tr></table>';

var hotelData = '<table width="100%"><tr><td width="36%" align="left" id="table2_row"> Hotel or Property name<span class="error">*</span></td><td width="1%" align="center">:</td><td width="63%" align="left"><input type="text" name="d_hotel_property_name" id="d_hotel_property_name" class="textfield2" /></td></tr><tr><td align="left" id="table2_row"> Address</td><td align="center">:</td><td align="left"><input type="text" name="d_hotel_address" id="d_hotel_address" class="textfield2" /></td></tr></table>';

var airportData = '<table width="100%"><tbody><tr><td width="36%" align="left" id="table2_row"> Arriving From</td><td width="2%" align="center">:</td><td width="64%" align="left"><input type="text" class="textfield2" id="d_arriving_from" name="arriving_from"/></td></tr><tr><td width="36%" align="left"> Airline Name<span class="error">*</span></td><td width="2%" align="center">:</td><td width="64%" align="left"><label><input type="text" class="textfield2" id="d_airline_name" name="airline_name"/></label></td></tr><tr><td width="36%" align="left"> Flight Number<span class="error">*</span></td><td width="2%" align="center">:</td><td width="64%" align="left"><input type="text" class="textfield2" id="d_flight_no" name="flight_no"/></td></tr><tr><td width="36%" align="left"> Flight Scheduled Arrival Time</td><td width="2%" align="center">:</td><td width="64%" align="left"><label><select class="selectarrival bookingElement" id="d_flight_arrhrs" name="flight_arrhrs"><option value="">Hrs</option><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option></select></label><label><select class="selectarrival bookingElement" id="d_flight_arrmin" name="flight_arrmin"><option value="">Min</option><option value="00">00</option><option value="5">5</option><option value="10">10</option><option value="15">15</option><option value="20">20</option><option value="25">25</option><option value="30">30</option><option value="35">35</option><option value="40">40</option><option value="45">45</option><option value="50">50</option><option value="55">55</option></select></label><span style="display: none;" id="d_timeSpan" class="error"><br/>This field is required.</span></td></tr></tbody></table>';

var pickupHotelData = '<table width="100%"><tr><td width="36%" align="left">Pick Up Hotel or Property name<span class="error">*</span></td><td width="1%" align="center">:</td><td width="63%" align="left"><input type="text" name="hotel_property_name" id="hotel_property_name" class="textfield2" /></td></tr><tr><td align="left" id="table2_row">Pick Up Address</td><td align="center">:</td><td align="left"><input type="text" name="hotel_address" id="hotel_address" class="textfield2" /></td></tr></table>';

var pickupharborData = '<table width="100%" id="harborTable"><tr><td align="left" width="36%">Cruise Ship Details<span class="error">*</span></td><td align="center" width="1%">:</td><td align="left" width="63%"><input type="text" name="ship_name" id="ship_name" class="textfield2" /></td></tr></table>';

//var pickupairportData = '<table width="100%"><tbody><tr><td width="36%" align="left" id="table2_row"> Arriving From</td><td width="2%" align="center">:</td><td width="64%" align="left"><input type="text" class="textfield2" id="arriving_from" name="arriving_from"/></td></tr><tr><td width="36%" align="left" id="table2_row"> Airline Name<span class="error">*</span></td><td width="2%" align="center">:</td><td width="64%" align="left"><label><input type="text" class="textfield2" id="airline_name" name="airline_name"/></label></td></tr><tr><td width="36%" align="left" id="table2_row"> Flight Number<span class="error">*</span></td><td width="2%" align="center">:</td><td width="64%" align="left"><input type="text" class="textfield2" id="flight_no" name="flight_no"/></td></tr><tr><td width="36%" align="left" id="table2_row"> Flight Scheduled Arrival Time</td><td width="2%" align="center">:</td><td width="64%" align="left"><label><select class="selectarrival bookingElement" id="flight_arrhrs" name="flight_arrhrs"><option value="">Hrs</option><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option></select></label><label><select class="selectarrival bookingElement" id="flight_arrmin" name="flight_arrmin"><option value="">Min</option><option value="00">00</option><option value="5">5</option><option value="10">10</option><option value="15">15</option><option value="20">20</option><option value="25">25</option><option value="30">30</option><option value="35">35</option><option value="40">40</option><option value="45">45</option><option value="50">50</option><option value="55">55</option></select></label><span style="display: none;" id="timeSpan" class="error"><br/>This field is required.</span></td></tr></tbody></table>';

var pickupairportData = '<table width="100%"><tbody><tr><td width="36%" align="left" id="table2_row"> Arriving From</td><td width="2%" align="center">:</td><td width="64%" align="left"><input type="text" class="textfield2" id="arriving_from" name="arriving_from"/></td></tr><tr><td width="36%" align="left" id="table2_row"> Airline Name<span class="error">*</span></td><td width="2%" align="center">:</td><td width="64%" align="left"><label><input type="text" class="textfield2" id="airline_name" name="airline_name"/></label></td></tr><tr><td width="36%" align="left" id="table2_row"> Flight Number<span class="error">*</span></td><td width="2%" align="center">:</td><td width="64%" align="left"><input type="text" class="textfield2" id="flight_no" name="flight_no"/></td></tr></tbody></table>';


$(document).ready(function(){
	$("#bookingFrm").validate({
		rules: {
			booking_from: {
					required: true
				},
			booking_to: {
					required: true
				},
			airline_name: {
					required: true
				},
			flight_no: {
				required: true
			},
			hotel_property_name: {
				required: true
			},
			no_of_passengers: {
				required: true
			},
			first_name: {
				required: true
			},
			last_name: {
				required: true
			},
			dialing_code: {
				required: true
			},
			home_phone: {
				required: true
			},
			mobile_no: {
				required: true
			},
			bookingTypeTxt: {
				required: true
			},
			email: {
					required: true,
					email: true
				}
			}
		});
	
	$('#bookingFrm').submit(function(){
		var errors = 0;
		if((!checkEmpty('booking_day')) || (!checkEmpty('booking_month')) || (!checkEmpty('booking_year'))){
			$('#dateSpan').show();
		}
		else{
			$('#dateSpan').hide();
		}
		/*if((!checkEmpty('flight_arrhrs')) || (!checkEmpty('flight_arrmin'))){
			$('#timeSpan').show();
		}
		else{
			$('#timeSpan').hide();
		}*/
		
		if((!checkEmpty('oneway_pickuphrs')) || (!checkEmpty('oneway_pickupmin'))){
			$('#ptimeSpan').show();
		}
		else{
			$('#ptimeSpan').hide();
		}
		
		
		if ($("#creditCard").is(':checked')) {
			if(!checkEmpty('cardholder_name')){
				errors = 1
				$('#cardHSpan').show();
			}
			else{
				$('#cardHSpan').hide();
			}
			
			if(!checkEmpty('credit_card_type')){
				errors = 1
				$('#cardTSpan').show();
			}
			else{
				$('#cardTSpan').hide();
			}
			
			if(!checkEmpty('credit_card_number')){
				errors = 1
				$('#cardNSpan').html('<br />This field is required.');
				$('#cardNSpan').show();
			}
			else{
				var ct = $('#credit_card_type').val();
				var cn = $('#credit_card_number').val();
				var nos = 16;
				if( ct == 'American Express'){
					if( cn.length != 15){
						errors = 1
						$('#cardNSpan').html('<br />This field is must have 15 characters.');
						$('#cardNSpan').show();
					}
					else{
						$('#cardNSpan').hide();	
					}
				}
				else{
					if( cn.length != 16){
						errors = 1
						$('#cardNSpan').html('<br />This field is must have 16 characters.');
						$('#cardNSpan').show();
					}
					else{
						$('#cardNSpan').hide();	
					}
				}
				
			}
			
			if((!checkEmpty('card_e_day')) || (!checkEmpty('card_e_month')) || (!checkEmpty('card_e_year'))){
				errors = 1
				$('#cardESpan').show();
			}
			else{
				$('#cardESpan').hide();
			}
			
			if(!checkEmpty('cvv_number')){
				errors = 1
				$('#cardVSpan').show();
			}
			else{
				$('#cardVSpan').hide();
			}
		}
		
		if(errors == 1){
			
			return false;
		}
	});
	
	$('#makeBookingFrm').submit(function(){
		var errors = 0;
		if ($("#creditCard").is(':checked')) {
		if((!checkEmpty('card_e_month')) || (!checkEmpty('card_e_year'))){
			errors = 1
				$('#cardESpan').show();
			}
			else{
				$('#cardESpan').hide();
			}		
		
		if ($("#creditCard").is(':checked')) {
			if(!checkEmpty('cardholder_name')){
				errors = 1
				$('#cardHSpan').show();
			}
			else{
				$('#cardHSpan').hide();
			}
			
			if(!checkEmpty('credit_card_type')){
				errors = 1
				$('#cardTSpan').show();
			}
			else{
				$('#cardTSpan').hide();
			}
			
			if(!checkEmpty('credit_card_number')){
				errors = 1
				$('#cardNSpan').html('<br />This field is required.');
				$('#cardNSpan').show();
			}
			else{
				var ct = $('#credit_card_type').val();
				var cn = $('#credit_card_number').val();
				var nos = 16;
				if( ct == 'American Express'){
					if( cn.length != 15){
						errors = 1
						$('#cardNSpan').html('<br />This field is must have 15 characters.');
						$('#cardNSpan').show();
					}
					else{
						$('#cardNSpan').hide();	
					}
				}
				else{
					if( cn.length != 16){
						errors = 1
						$('#cardNSpan').html('<br />This field is must have 16 characters.');
						$('#cardNSpan').show();
					}
					else{
						$('#cardNSpan').hide();	
					}
				}
				
			}
			
			if(!checkEmpty('cvv_number')){
				errors = 1
				$('#cardVSpan').show();
			}
			else{
				$('#cardVSpan').hide();
			}
		}
		
		if(errors == 1){
			return false;
		}
		}
	});
	
	$('#areaFrom').change(function(){
		var af= $('#areaFrom').val();
		$.post("get-to-area.php", { areafrom: af,areatype:1},function(areato){
			$('#areaToLabel').html(areato);
			
			$('#areaTo').bind('change', function() {
  				$('#getPriceButton').attr("alt","1");
				var imageUrl = 'images/getprice.jpg';
				$('#getPriceButton').css('background-image', 'url(' + imageUrl + ')');
			});

		});
	});
	
	$('#booking_from').change(function(){
		var af= $('#booking_from').val();
			$.post("get-to-area.php", { areafrom: af,areatype:2},function(areato){
				$('#bookingToTd').html(areato);			
				$('#booking_to').bind('change', function() {
					var af = $('#booking_from').val();
					var at = $('#booking_to').val();
					var owhrs = $('#flight_arrhrs').val();
					var owmin = $('#flight_arrmin').val();
					var pass = $('#no_of_passengers').val();
					$.post("get-quote.php", { passengers: pass, areaFrom: af, areaTo: at, o_time_hrs: owhrs, o_time_min: owmin},function(quote){
						var quoteArr = quote.split("|");
						quote = quoteArr[0];
						if(parseInt(quote) > 0){
							$('#price').val('€'+quote);
						}
					});
					
		var toName = $('#booking_to').val();
		var pattern1=/Airport/gi;
		var pattern2=/harbour/gi;
		var pattern3=/Terminal/gi;
		var pattern4=/Civitavecchia port/gi;
		if(!toName.match(pattern1)){
			$('#F_DepTimeData').hide();
			if(toName.match(pattern2)){
				$('#destinationDataTd').html(harborData);
				$('#destinationDataTdHead').show();
			}
			else if(toName.match(pattern3)){
				$('#destinationDataTd').html(harborData);
				$('#destinationDataTdHead').show();
			}
			else if(toName.match(pattern4)){
				$('#destinationDataTd').html(harborData);
				$('#destinationDataTdHead').show();
			}
			else{
				$('#destinationDataTd').html(hotelData);
				$('#destinationDataTdHead').show();
			}
			
		}
		else{
			$('#destinationDataTd').html('')
			$('#destinationDataTdHead').hide();
			$('#F_DepTimeData').show();
		}
				
					return false;
				});
				
				var fromName = $('#booking_from').val();
		
		var fpattern1=/Airport/gi;
		var fpattern2=/harbour/gi;
		var fpattern3=/Terminal/gi;
		var fpattern4=/Civitavecchia port/gi;
		
			if(fromName.match(fpattern1)){
				$('#pickUpDataTd').html(pickupairportData);
				$('#flightDepTimeData').show();
				//$('#arrivalTxt').show();
				$('#arrivalTxt').html("Flight Scheduled Arrival Time");
			}
			else if(fromName.match(fpattern2)){
				$('#pickUpDataTd').html(pickupharborData);
				$('#flightDepTimeData').hide();
				//$('#arrivalTxt').hide();
				$('#arrivalTxt').html("Pick-up Time");
			}
			else if(fromName.match(fpattern3)){
				$('#pickUpDataTd').html(pickupharborData);
				$('#flightDepTimeData').hide();
				//$('#arrivalTxt').hide();
				$('#arrivalTxt').html("Pick-up Time");
			}
			else if(fromName.match(fpattern4)){
				$('#pickUpDataTd').html(pickupharborData);
				$('#flightDepTimeData').hide();
				//$('#arrivalTxt').hide();
				$('#arrivalTxt').html("Pick-up Time");
			}
			else{
				$('#pickUpDataTd').html(pickupHotelData);
				$('#flightDepTimeData').hide();
				//$('#arrivalTxt').hide();
				$('#arrivalTxt').html("Pick-up Time");
			}
			
		

			});
		});
		
		$('.tripradioCls').change(function(){
			
			if ($("#onewaytrip").is(':checked')) {
				$('#returnDataTable').hide();
			}
			if ($("#roundtrip").is(':checked')) {
				$('#returnDataTable').show();
			}
		});
	
	$('#getPriceButton').click(function(){
		var errors = 0;
			if(!checkEmpty('areaFrom')){
				$("#dialogMessageIcon").addClass("ui-icon-alert");
				$("#dialogMessage").html($('#areaFrom').attr("title"));
				$(function() {
					$( "#dialog:ui-dialog" ).dialog( "destroy" );
					$( "#dialog-message" ).dialog({
						modal: true,
						width:360,
						height:145,
						buttons: {
							Ok: function() {
								$( this ).dialog( "close" );
							}
						}
					});
				});
				errors = 1;
				return false;
			}
			
			if(!checkEmpty('areaTo')){
				$("#dialogMessageIcon").addClass("ui-icon-alert");
				$("#dialogMessage").html($('#areaTo').attr("title"));
				$(function() {
					$( "#dialog:ui-dialog" ).dialog( "destroy" );
					$( "#dialog-message" ).dialog({
						modal: true,
						width:360,
						height:145,
						buttons: {
							Ok: function() {
								$( this ).dialog( "close" );
							}
						}
					});
				});
				errors = 1;
				return false;
			}
			
			if(!checkEmpty('passengers')){
				$("#dialogMessageIcon").addClass("ui-icon-alert");
				$("#dialogMessage").html($('#passengers').attr("title"));
				$(function() {
					$( "#dialog:ui-dialog" ).dialog( "destroy" );
					$( "#dialog-message" ).dialog({
						modal: true,
						width:360,
						height:145,
						buttons: {
							Ok: function() {
								$( this ).dialog( "close" );
							}
						}
					});
				});
				errors = 1;
				return false;
			}
			
			if(!checkEmpty('o_time_hrs')){
				$("#dialogMessageIcon").addClass("ui-icon-alert");
				$("#dialogMessage").html($('#o_time_hrs').attr("title"));
				$(function() {
					$( "#dialog:ui-dialog" ).dialog( "destroy" );
					$( "#dialog-message" ).dialog({
						modal: true,
						width:360,
						height:145,
						buttons: {
							Ok: function() {
								$( this ).dialog( "close" );
							}
						}
					});
				});
				errors = 1;
				return false;
			}
			
			if ($("#r_radio").is(':checked')) {
				if(!checkEmpty('r_time_hrs')){
					$("#dialogMessageIcon").addClass("ui-icon-alert");
					$("#dialogMessage").html($('#r_time_hrs').attr("title"));
					$(function() {
						$( "#dialog:ui-dialog" ).dialog( "destroy" );
						$( "#dialog-message" ).dialog({
							modal: true,
							width:360,
							height:145,
							buttons: {
								Ok: function() {
									$( this ).dialog( "close" );
								}
							}
						});
					});
					errors = 1
					return false;
				}
			}
			
			if(errors == 1){
				return false;
			}
		if($('#getPriceButton').attr("alt") == 1){
			var quoteValue= '<span style="border: 1px solid #777777; padding:3px;">No Service Available</span>';
			$.post("get-quote.php", $("#quoteFrm").serialize(),function(quote){
				var quoteArr = quote.split("|");
				quote = quoteArr[0];
				if(parseInt(quote) > 0){
					quoteValue = '<span style="border: 1px solid #777777; padding:3px;">&euro;'+quote+'</span>';
					$('#quotePrice').val(quote);
					$('#travelTimeSpan').html(quoteArr[4]);
					$('#getPriceButton').attr("alt","2");
					var imageUrl = 'images/getbooked.jpg';
					$('#getPriceButton').css('background-image', 'url(' + imageUrl + ')');
					
					if((quoteArr[1] == 1) && (quoteArr[2] == 1) && (quoteArr[3] == 1)){
						$('.serviceTxtCls').hide();
						$('#serviceOnewayReturnNight').show();
					}
					else if((quoteArr[1] == 0) && (quoteArr[2] == 1) && (quoteArr[3] == 1)){
						$('.serviceTxtCls').hide();
						$('#serviceReturnNight2').show();
					}
					else if((quoteArr[1] == 1) && (quoteArr[2] == 0) && (quoteArr[3] == 1)){
						$('.serviceTxtCls').hide();
						$('#serviceOnewayNight2').show();
					}
					else if((quoteArr[1] == 1) && (quoteArr[2] == 0) && (quoteArr[3] == 0)){
						$('.serviceTxtCls').hide();
						$('#serviceOnewayNight').show();
					}
					else if((quoteArr[1] == 0) && (quoteArr[2] == 0) && (quoteArr[3] == 1)){
						$('.serviceTxtCls').hide();
						$('#serviceOnewayReturn').show();
						
					}
					else if((quoteArr[1] == 0) && (quoteArr[2] == 0) && (quoteArr[3] == 0)){
						$('.serviceTxtCls').hide();
						$('#serviceOneway').show();
						
					}
					else{}
					$('#tripTime').show();
				}
				$('#viewQuotePrice').html(quoteValue);
			});
		}
		else if($('#getPriceButton').attr("alt") == 2){
			$("#quoteFrm").submit();
		}
		else{
			return false;
		}
		return false;
	});
	
	
		$('.bookingElement').change(function(){
			var af = $('#booking_from').val();
			var at = $('#booking_to').val();
			var owhrs = $('#oneway_pickuphrs').val();
			var owmin = $('#oneway_pickupmin').val();
			var rthrs = '';
			var rtmin = '';
			if ($("#roundtrip").is(':checked')) {
				rthrs = $('#pickup_hrs').val();
				rtmin = $('#pickup_min').val();
			}
			
			var pass = $('#no_of_passengers').val();
			$.post("get-quote.php", { passengers: pass, areaFrom: af, areaTo: at, o_time_hrs: owhrs, o_time_min: owmin, r_time_hrs: rthrs, r_time_min: rtmin},function(quote){
				var quoteArr = quote.split("|");
				quote = quoteArr[0];
				if(parseInt(quoteArr[0]) > 0){
					$('#price').val('€'+quoteArr[0]);
				}
			});
		
		return false;
	});
	
	$('#payBookingFrm').submit(function(){
		$( "#dialog-throbber" ).dialog({
			height: 90,
			width: 423,
			modal: true
		});
	});
	
	$('.hrsCls').click(function(){
		if(this.id == 'r_radio'){
			$('#r_time_hrs').removeAttr("disabled");
			$('#r_time_min').removeAttr("disabled");
		}
		else{
			$('#r_time_hrs').attr("disabled","disabled");
			$('#r_time_min').attr("disabled","disabled");	
		}
	});
	
	$('.priceElement').change(function(){
		$('#getPriceButton').attr("alt","1");
		var imageUrl = 'images/getprice.jpg';
		$('#getPriceButton').css('background-image', 'url(' + imageUrl + ')');
	});
	
	$('#booking_to').change(function(){
		var toName = $('#booking_to').val();
		
		var pattern1=/Airport/gi;
		var pattern2=/harbour/gi;
		var pattern3=/Terminal/gi;
		var pattern4=/Civitavecchia port/gi;
		if(!toName.match(pattern1)){
			$('#F_DepTimeData').hide();
			if(toName.match(pattern2)){
				$('#destinationDataTd').html(harborData);
				$('#destinationDataTdHead').show();
			}
			else if(toName.match(pattern3)){
				$('#destinationDataTd').html(harborData);
				$('#destinationDataTdHead').show();
			}
			else if(toName.match(pattern4)){
				$('#destinationDataTd').html(harborData);
				$('#destinationDataTdHead').show();
			}
			else{
				$('#destinationDataTd').html(hotelData);
				$('#destinationDataTdHead').show();
			}
			
		}
		else{
			$('#destinationDataTd').html('')
			$('#destinationDataTdHead').hide();
			$('#F_DepTimeData').show();
		}
	});
	
	
	$('.bookingTypeCls').click(function(e){
		$('#bookingTypeTxt').val(1);
		switch(this.id){
			case "creditCard":
				$("#creditCardDetailsTd").show();
				break;
			case "transferbooking":
				$("#creditCardDetailsTd").hide();
				showActualRate();
				break;
			default:
				$("#creditCardDetailsTd").hide();
				break;
		}
	});
	
	
	
	
});

function checkEmpty(element){
//	alert($('#'+element).val());
	var errflg = 0;
	errTxt = '';
	if(($('#'+element).val() == "")){
		errflg = 1;
		//errTxt = $('#'+element).attr("title")+"\n";
	}
	if(errflg == 1){
		return false;
	}
	else{
		return true;
	}
}

function showActualRate(){
		var totalAmt = parseInt($("#price").val().replace("€",""));
		var commission = 0;
		if((totalAmt >= 15) && (totalAmt <= 100)){
				commission = 3;
		}
		else if((totalAmt >= 101) && (totalAmt <= 200)){
			commission = 6;
		}
		else if((totalAmt >= 201) && (totalAmt <= 250)){
			commission = 9;
		}
		else if((totalAmt >= 251) && (totalAmt <= 300)){
			commission = 12;
		}
		else if((totalAmt >= 301) && (totalAmt <= 400)){
			commission = 15;
		}
		else if((totalAmt >= 401) && (totalAmt <= 500)){
			commission = 20;
		}
		else{
			commission = 0;
		}
		
		$('#commissionRates').val(commission);
		$("#dialogConfirmMessage").html("Actual amount including payment charges is<span style='color:#D70946;font-size:13px;'> €"+(totalAmt+commission)+"</span> includes <span style='color:#D70946;font-size:13px;'>€"+(commission)+"</span> as service charges. Do you want to continue?");	
		$(function() {
			$( "#dialog:ui-dialog" ).dialog( "destroy" );
			$( "#dialog-confirm" ).dialog({
				resizable: false,
				height:140,
				width:440,
				modal: true,
				buttons: {
					"Continue ": function() {
						//$("#price").val(totalAmt+commission);
						if($("#bookingFrm").length > 0){
							$("#bookingFrm").submit();
						}
						
						if($("#makeBookingFrm").length > 0){
							$("#makeBookingFrm").submit();
						}
						$( this ).dialog( "close" );

					},
					Cancel: function() {
						$( this ).dialog( "close" );
					}
				}
			});
		});
		return false;
		
		
		/*if(confirm("Actual amount including payment charges is €"+(totalAmt+commission)+". Do you want to continue?")){
			$("#price").val(totalAmt+commission);
			$("#bookingFrm").submit();
		}*/
	}
