if( typeof(questiontype) == "undefined") { questiontype = "" } document.writeln(""); $(function() { var html = ""; html ="
"; html +="
"; html +="
"; html +="
from $99 USD P/P
"; html +="
Daily Departure
"; html +="
"; html +="
"; html +="
"; html +="

"; html +=" "; html +=" "; html +="

"; html +="

"; html +=" "; html +=" "; html +="

"; html +="

"; html +=" "; html +=" "; html +="

"; html +="

"; html +=" "; html +=" "; html +="

Total Price:
" html +="

"; html +="

"; html +=" "; html +=" "; if ( questiontype == 'contactus' ) { html +=" "; } html +=" "; html +="

"; html +="
"; html +=" "; html +="
"; html +="
"; html +="
"; $("#question-tour-pay").html(html); $("#formquestion").stick_in_parent({parent: "#mcontent"}); $("#questionBox .infoRequired p").show(); $("#questionBox .infoRequired label").inFieldLabels(); $("#Starting_Date").datepicker({ showAnim:"fadeIn", duration:0, minDate: 2, maxDate:"2y", numberOfMonths: 2, showButtonPanel: true }); $(document).on("click",".error", function() { $(this).parent("p").find(".arrowDownTest").remove(); }); $("#formquestion").validate({ rules: { realname:{ required: true, minlength: 1 }, yemail:{ required: true, email: true }, Starting_Date: { required: true, date: true }, padult: { required: true } }, messages: { realname: "Enter your name", yemail: "Enter your email address.", Starting_Date : "Select the starting date", padult: "Select the adults and infants number" }, errorLabelContainer: "#questionBox .infoRequired p .arrowDownTest", errorPlacement: function(error, element) { var error_tip = "
"; element.parent().append(error_tip); error.appendTo(element.parent().find(".arrowDownTest")); }, focusInvalid: true, submitHandler: function(form){ $("#pp_price").val(parseInt($("#pp_pricea").val()) + parseInt($("#pp_pricei").val())); //form.find(".arrowDownTest").show(); form.submit(); } //debug: true }); var adult_price = 0; $("#padult").change(function () { var adult_num = $(this).find("option:selected").val() || 0; adult_price = $(".redprice.pp-adult strong").text().replace("USD", "").replace("$", "").replace("US", ""); adult_price = adult_price * adult_num; $("#pp_pricea").val(adult_price); chgprice(); }); var infant_price = 0; $("#pinfant").change(function () { var infant_num = $(this).find("option:selected").val() || 0; infant_price = $(".redprice.pp-infant strong").text().replace("USD", "").replace("$", "").replace("US", ""); infant_price = infant_price * infant_num; $("#pp_pricei").val(infant_price); chgprice(); }); $("#Q_URL").val(location.href); //pay 判断 var ispay = $('#payform').val(); if(typeof ispay != 'undefined'){ //$('#formquestion').append(''); var acturl = $('#formquestion').attr('action') + '?type=pay'; $('#formquestion').attr('action', acturl); }else{ $('#formquestion .sendButton').val('Send'); } // var cli_no = $('#cli_no').val(); if(typeof cli_no != 'undefined'){ $("#padult").children('option').eq(0).text('Adults'); $('#pinfant').children('option').eq(0).text('Children'); $('#formquestion').append(''); } var cli_source = $('#cli_source').val(); if(typeof cli_source != 'undefined'){ $('#formquestion').append(''); } //--------------------------------------------------------------------------------------------------------------------------------------- }); function chgprice(){ $('#totalCost').show(); var totalprice = parseInt($("#pp_pricei").val()) + parseInt($("#pp_pricea").val()); //var ispay = $('#payform').val(); if(totalprice>0){ var str_cost = 'USD $ ' + totalprice.toString(); $('#totalCost strong').text(str_cost); } }