| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/myvisakit/public/js/ |
Upload File : |
$(document).ready(function () {
$(document).on('click', '.sendEnuiryPackage', function () {
var PkgSysId = $(this).attr('data-rv');
var packagetpid = $('#packagetpid_' + PkgSysId).val();
var packagedesname = $('#packagedesname_' + PkgSysId).val();
var packagedesid = $('#packagedesid_' + PkgSysId).val();
$('.msg').hide().html('');
$("#leadsend").val('0');
$('#packagesys_id').val(PkgSysId);
$('#package_tpid').val(packagetpid);
$('#Destinations').val(packagedesname);
$('#DestinationIDs').val(packagedesid);
});
$(document).on('click', '.sendRateEnuiryPackage', function () {
var PkgSysId = $(this).attr('data-rvs');
var PackageType = $('#packagetype_' + PkgSysId).val();
var GTXPkgId = $('#gtxpackage_' + PkgSysId).val();
var hotelcategoryid = $('#hotelcategoryid_' + PkgSysId).val();
var packagetpid = $('#packagetpid_' + PkgSysId).val();
var tourtype = $('#tourtype_' + PkgSysId).val();
var packagenamemodal = $('#packagename_' + PkgSysId).val();
var mealplantype = $('#mealplantype_' + PkgSysId).val();
var packagedesname = $('#packagedesname_' + PkgSysId).val();
$('.msgs').hide().html('');
$('.smsg1').hide().html('');
$("#leadsends").val('0');
$('#expandsave').hide();
$('#packagesys_ids').val(PkgSysId);
$('#packagetype_ids').val(PackageType);
$('#package_sids').val(GTXPkgId);
$('#package_hotelcategoryids').val(hotelcategoryid);
$('#package_mealplantypeids').val(mealplantype);
$('#package_tpids').val(packagetpid);
$('#package_tourtype_ids').val(tourtype);
$('#packagenamemodal').html(packagenamemodal);
$('#packagedesname').val(packagedesname);
$('#displaySendRateEnquiryForm').show();
$('.hidebutton').find('.sending1').show().html('Check Rate & Send Enquiry').attr('disabled', false);
$('.package_rate_enquiry #tableCost, .class-modify-enquiry').hide();
$('.package_rate_enquiry .smsg1').html('');
$('.inserted-room-row').remove();
$('.addmore').show();
$('.package_rate_enquiry #traveler_adult_1').val(1);
$('.package_rate_enquiry #traveler_kids_1 , .package_rate_enquiry #traveler_infant_1').val(0);
$('#itinerary_inputs').val(1);
$('#itinerary_rooms').val(2);
$('.hidebutton').find('.class-modify-enquiry').hide();
if ($('#check_TravelAgent').val() == 1) {
$('#Send_Enquiry').click();
}
});
$(document).on('click', '.selectedTpId', function () {
var PkgSysId = $('#PkgSysIdHTML').val();
var TpSysId = $(this).attr('dataTpId');
$('#packagetpid_' + PkgSysId).val(TpSysId);
});
$(document).on('click', '.removeit', function () {
var count = $('#itinerary_inputs').val();
var rooms = $('#itinerary_rooms').val();
if (count == 1) {
return false;
}
$('#itinerary_inputs').val(parseInt(count) - 1);
$('#itinerary_rooms').val(parseInt(rooms) - 1);
$('.room-rows-container').find('.inserted-room-row:last').remove();
});
$('.talktous input[name="mobile"]').keypress(function (e) {
if (e.which !== 8 && e.which !== 0 && (e.which < 48 || e.which > 57)) {
return false;
}
});
$(".talktous").on('submit', function (e) {
e.preventDefault();
var data = $(this).serialize();
var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
if ($('.talktous input[name="name"]').val() == '') {
$('.msg').html('Please enter your name').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous input[name="name"]').focus();
return false;
}
if ($('.talktous input[name="email"]').val() == '') {
$('.msg').html('Please enter your email id').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous input[name="email"]').focus();
return false;
}
if (!EmailReg.test($('.talktous input[name="email"]').val())) {
$('.msg').html('Please enter valid email address!!!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous input[name="email"]').focus();
return false;
}
if ($('.talktous input[name="mobile"]').val() == '') {
$('.msg').html('Please enter your Mobile').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous input[name="mobile"]').focus();
return false;
}
if (!$.isNumeric($('.talktous input[name="mobile"]').val())) {
$('.msg').html('Mobile should be numeric!!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous input[name="mobile"]').focus();
return false;
}
if ($('.talktous input[name="mobile"]').val().length != '10') {
$('.msg').html('Mobile should be 10 digit?').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous input[name="mobile"]').focus();
return false;
}
if ($('.talktous textarea[name="message"]').val() == '') {
$('.msg').html('Please enter your query!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous textarea[name="message"]').focus();
return false;
}
if ($('#authoriseme').prop('checked') === false)
{
$('.msg').html('Please accept and authorize for contact you?').css('color', 'red').fadeIn().delay(3000).fadeOut();
$('#authoriseme').focus();
return false;
}
$.ajax({url: SITEURL + 'cms/index/sendenquiry', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
$('.sendingP').val('Sending...').attr('disabled', 'disabled');
$('.submitbtn').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Sending...').attr('disabled', 'disabled');
}, success: function (result) {
if (result.status) {
$('.msg').html('Your query sent successfully.').css({'color': '#5cb85c'}).fadeIn().delay(10000).fadeOut();;
$('.sendingP').val('Send Enquiry').attr('disabled', false);
$('.submitbtn').html('Send Enquiry').attr('disabled', false);
} else {
$('.sendingP').val('Send Enquiry').attr('disabled', false);
$('.submitbtn').html('Send Enquiry').attr('disabled', false);
$('.msg').html(result.message)
}
// window.open(SITEURL+'thankyou.html','_blank' );
}, error: function (result) {
$('.sendingP').html('Send Enquiry').attr('disabled', false);
alert('Some error occured.');
}});
});
$(".talktous_contact").on('submit', function (e) {
e.preventDefault();
var data = $(this).serialize();
var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
if ($('.talktous_contact input[name="name"]').val() == '') {
$('.contact_msg').html('Please enter your name').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous_contact input[name="name"]').focus();
return false;
}
if ($('.talktous_contact input[name="email"]').val() == '') {
$('.contact_msg').html('Please enter your email id').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous_contact input[name="email"]').focus();
return false;
}
if (!EmailReg.test($('.talktous_contact input[name="email"]').val())) {
$('.contact_msg').html('Please enter valid email address!!!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous_contact input[name="email"]').focus();
return false;
}
if ($('.talktous_contact input[name="mobile"]').val() == '') {
$('.contact_msg').html('Please enter your Mobile').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous_contact input[name="mobile"]').focus();
return false;
}
if (!$.isNumeric($('.talktous_contact input[name="mobile"]').val())) {
$('.contact_msg').html('Mobile should be numeric!!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous_contact input[name="mobile"]').focus();
return false;
}
if ($('.talktous_contact input[name="mobile"]').val().length != '10') {
$('.contact_msg').html('Mobile should be 10 digit?').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.talktous_contact input[name="mobile"]').focus();
return false;
}
$.ajax({url: SITEURL + 'cms/index/sendenquiry', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
$('.contact_sendingP').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Sending...').attr('disabled', 'disabled');
}, success: function (result) {
if (result.status) {
$('.contact_msg').html('Your query sent successfully.').css({'color': '#5cb85c'}).fadeIn().delay(10000).fadeOut();;
$('.contact_sendingP').html('Submit').attr('disabled', false);
} else {
$('.contact_sendingP').html('Submit').attr('disabled', false);
$('.contact_msg').html(result.message)
}
//window.open(SITEURL+'thankyou.html','_blank' );
}, error: function (result) {
$('.contact_sendingP').html('Submit').attr('disabled', false);
alert('Some error occured.');
}});
});
$(".sending").on('click', function (e) {
var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
e.preventDefault();
var data = $(".package_enquiry").serialize();
var leadsend = $("#leadsend").val();
if ($('.package_enquiry input[name="email"]').val() == '') {
$('.msg').show().html('Please enter your email address').css('color', 'red');
$('.package_enquiry input[name="email"]').focus();
return false;
}
if (!EmailReg.test($('.package_enquiry input[name="email"]').val())) {
$('.msg').show().html('Please enter valid email address!!!').css('color', 'red');
$('.package_enquiry input[name="email"]').focus();
return false;
}
if ($('.package_enquiry input[name="mobile"]').val() == '') {
$('.msg').show().html('Please enter your mobile number').css('color', 'red');
$('.package_enquiry input[name="mobile"]').focus();
return false;
}
if ($('.package_enquiry input[name="mobile"]').val().length != '10') {
$('.msg').show().html('Mobile should be 10 digit?').css('color', 'red');
$('.package_enquiry input[name="mobile"]').focus();
return false;
}
if (!$.isNumeric($('.package_enquiry input[name="mobile"]').val())) {
$('.msg').show().html('Mobile should be numeric!!').css('color', 'red');
$('.package_enquiry input[name="mobile"]').focus();
return false;
}
if (leadsend == '0') {
$.ajax({url: SITEURL + 'cms/index/send-query-details', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
$('.sending').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Sending...').attr('disabled', 'disabled');
}, success: function (result) {
$("#leadsend").val('1');
$('.smsg').show().html(result.message).css('color', 'green');
$('.sending').hide();
}, error: function (result) {
$('.smsg').show().html('Sorry, System encountered some error.\n\ We will revert back with suitable suggestions.').css({'color': '#ff0000'});
}});
}
});
$(".sending1").on('click', function (e) {
var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
e.preventDefault();
var data = $(".package_rate_enquiry").serialize();
var leadsend = $("#leadsends").val();
if ($('.package_rate_enquiry input[name="email"]').val() == '') {
$('.msgs').show().html('Please enter your email address');
$('.package_rate_enquiry input[name="email"]').focus();
return false;
}
if (!EmailReg.test($('.package_rate_enquiry input[name="email"]').val())) {
$('.msgs').show().html('Please enter valid email address!!!');
$('.package_rate_enquiry input[name="email"]').focus();
return false;
}
if ($('.package_rate_enquiry input[name="mobile"]').val() == '') {
$('.msgs').show().html('Please enter your mobile number');
$('.package_rate_enquiry input[name="mobile"]').focus();
return false;
}
if ($('.package_rate_enquiry input[name="mobile"]').val().length != '10') {
$('.msgs').show().html('Mobile should be 10 digit?');
$('.package_rate_enquiry input[name="mobile"]').focus();
return false;
}
if (!$.isNumeric($('.package_rate_enquiry input[name="mobile"]').val())) {
$('.msgs').show().html('Mobile should be numeric!!');
$('.package_rate_enquiry input[name="mobile"]').focus();
return false;
}
if (leadsend == '0') {
if ($('#check_TravelAgent').val() == 1) {
$("#leadsends").val('1');
$('.package_rate_enquiry').find('.msgs').html('');
$('.sending1').html('Calculate Cost & Send Enquiry').attr('disabled', false);
$('#expandsave').show();
} else {
$.ajax({url: SITEURL + 'cms/index/sendenquiry', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
$('.sending1').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Sending...').attr('disabled', 'disabled');
}, success: function (result) {
$("#leadsends").val('1');
$('.package_rate_enquiry').find('.msgs').html('');
$('.sending1').html('Calculate Cost & Send Enquiry').attr('disabled', false);
$('#expandsave').show();
}, error: function (result) {
$('.smsg1').show().html('Sorry, System encountered some error.\n\ We will revert back with suitable suggestions.').css({'color': '#ff0000'});
}});
}
} else {
if ($('#check_TravelAgent').val() == 1) {
$('#expandsave').show();
}
if ($("#hidden_selected_hotel_cityid").val() == '') {
$('.msgs').show().html('Please enter traveling from');
$('.package_rate_enquiry input[name="from_destination_name"]').focus();
return false;
}
if ($("#travelerDatePicker").val() == '') {
$('.msgs').show().html('Please enter travel date');
$('.package_rate_enquiry input[name="date"]').focus();
return false;
}
$('.msgs').hide().html('');
$.ajax({url: SITEURL + 'gtxwebservices/send-enquiry/post', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
$('.sending1').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Getting Cost...').attr('disabled', 'disabled');
}, success: function (result) {
if ((result.status == 'success') && (result.availability == true)) {
$('.package_rate_enquiry .smsg1').show().html("Thanks! Your enquiry submitted successfully. Soon our expert will contact you.").css({'color': '#5cb85c'});
var priceTax = result.addtional['GSTAmount']; // Tax
var sumRoomWise = result.addtional['MyCost']; // TotalPrice
var priceGT = result.addtional['AmountWithGST']; // GrandTotal
if (priceTax == 0) {
$('#totalBasicCostTR , #totalTaxCostTR').hide();
$('#GSTI').show().html('GST (Included)');
} else {
$('#totalBasicCostTR , #totalTaxCostTR').show();
$('#GSTI').hide().html('');
}
var priceTaxFormatted, priceBCFormatted, priceGTFormatted = '';
priceTaxFormatted = ptMoneyFormatINR(priceTax, 2, null);
priceBCFormatted = ptMoneyFormatINR(sumRoomWise, 2, null);
priceGTFormatted = ptMoneyFormatINR((priceGT), 2, null);
$('#totalBasicCost').html(priceBCFormatted);
$('#totalTaxCost').html(priceTaxFormatted);
$('#totalGrandCost').html(priceGTFormatted);
$('#tableCost').slideDown();
}
else if ((result.status == 'success') && (result.availability == "false")) {
$('.smsg1').show().html("Thanks! Your enquiry submitted successfully. Soon our expert will contact you.").css({'color': '#5cb85c'});
}
else if ((result.status == false) && (result.availability == "false")) {
$('.package_rate_enquiry .smsg1').show().html('Sorry, This package is not available on selected date.\n\ But we will revert back with suitable suggestions.').css({'color': '#5cb85c'});
}
else {
$('.smsg1').show().html('Thanks! Your enquiry submitted successfully.\n\ We will revert back with suitable suggestions.').css({'color': '#5cb85c'});
}
$('.hidebutton').find('.sending1').hide();
$('.hidebutton').find('.class-modify-enquiry').show();
}, error: function (result) {
$('.smsg1').show().html('Sorry, System encountered some error.\n\ We will revert back with suitable suggestions.').css({'color': '#ff0000'});
$('.sending1').hide();
$('.hidebutton').find('.sending1').hide();
$('.hidebutton').find('.class-modify-enquiry').show();
}});
}
});
$('.addmore').click(function () {
var count = 1;
var room = 2;
count = parseInt($('#itinerary_inputs').val());
room = parseInt($('#itinerary_rooms').val());
CONST_PACKAGE_TRAVELER_MAX_ROOM = parseInt(CONST_PACKAGE_TRAVELER_MAX_ROOM);
if (room > CONST_PACKAGE_TRAVELER_MAX_ROOM) {
alert("Can not add more than " + CONST_PACKAGE_TRAVELER_MAX_ROOM + " rooms.");
return false;
}
$('.room-rows-container').append('<div class="col-lg-12 room-row inserted-room-row">' + '<div class="row">' + '<div class="col-lg-12 colspan-booking">' + '<div class="table-bordered"></div>' + '<label >Room ' + room + ' </label><button style="right:15px;" type="button" class="pull-right rounded text-danger removeit" aria-hidden="true" title="Remove Room">x</button>' + ' <input type="hidden" name="room[]" value="' + room + '" />' + '</div>' + ' <div class="cl"></div>' + '<div class="col-md-2 form-group">' + '<label class="Lable">Adults(+12Yrs)</label>' + '<select name="adult[]" id="traveler_adult_' + room + '" class="traveler_adult form-control" onchange="checkTravellers(this ,' + room + ');">' + '<option value="1"> 1</option>' + '<option value="2"> 2</option>' + '<option value="3"> 3</option>' + '</select>' + ' </div>' + '<div class="col-md-2 form-group" style="display: none" id="room-row-adult-bedtype-' + room + '"><label class="Lable">Adult Bedtype</label><select name="adult_bed_type[]" class="traveler_child form-control"><option value="">Select</option><option value="withoutbed">Without Bed</option><option value="extrabed">With Bed</option><option value="none">None</option></select></div><div class="col-md-2 form-group">' + '<label class="Lable">Kids(2 - 12Yrs)</label>' + '<select name="child[]" class="traveler_child form-control" id="traveler_kids_' + room + '" onchange="checkTravellers(this,' + room + ');">' + '<option value="0"> 0</option>' + '<option value="1"> 1</option>' + '<option value="2"> 2</option>' + '</select>' + ' </div>' + '<div class="col-md-2 form-group room-row-child-bedtype-' + room + '" style="display: none" id="room-row-child-bedtype-' + room + '-1"><label class="Lable">Child 1 Bedtype</label><select name="child1_bed_type[]" class="traveler_child form-control"><option value="">Select</option><option value="withoutbed">Without Bed</option><option value="extrabed">With Bed</option><option value="none">None</option></select></div><div class="col-md-2 form-group room-row-child-bedtype-' + room + '" style="display: none" id="room-row-child-bedtype-' + room + '-2"><label class="Lable">Child 2 Bedtype</label><select name="child2_bed_type[]" class="traveler_child form-control"><option value="">Select</option><option value="withoutbed">Without Bed</option><option value="extrabed">With Bed</option><option value="none">None</option></select></div> <div class="col-md-2 form-group">' + '<label class="Lable">Infant(0 - 2Yrs)</label>' + '<select name="infant[]" class="traveler_infant form-control" id="traveler_infant_' + room + '" onchange="checkTravellers(this,' + room + ');">' + '<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>' + '</select>' + '</div>' + '</div>');
$('#itinerary_inputs').val(parseInt(count) + 1);
$('#itinerary_rooms').val(parseInt(room) + 1);
});
$("#sendEnquiry").on('submit', function (e) {
e.preventDefault();
var data = $(this).serialize();
if ($.trim($('#sendEnquiry input[name="Destination"]').val()) === '') {
$('#msg').html('Please choose your desired destination.').css('color', 'red').fadeIn().delay(3000).fadeOut();
$('#sendEnquiry input[name="Destination"]').focus();
return false;
}
if ($.trim($('#sendEnquiry input[name="inputName"]').val()) === '') {
$('#msg').html('Please enter your name').css('color', 'red').fadeIn().delay(3000).fadeOut();
$('#sendEnquiry input[name="inputName"]').focus();
return false;
}
if ($.trim($('#sendEnquiry input[name="inputPhone"]').val()) === '') {
$('#msg').html('Please enter your contact number').css('color', 'red').fadeIn().delay(3000).fadeOut();
$('#sendEnquiry input[name="inputPhone"]').focus();
return false;
}
if ($.trim($('#sendEnquiry input[name="inputEmail"]').val()) === '') {
$('#msg').html('Please enter your Email-Id').css('color', 'red').fadeIn().delay(3000).fadeOut();
$('#sendEnquiry input[name="inputEmail"]').focus();
return false;
}
$('.sendEnquiry').attr('disabled', 'disabled');
$.ajax({
url: SITEURL + 'visa/index/send-query-details',
type: 'POST',
data: data,
dataType: 'json',
beforeSend: function () {
$('.sendEnquiry').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Please wait...');
},
success: function (result) {
if (result.status === true) {
$('#msg').html(result.message).css('color', 'green').fadeIn().delay(3000).fadeOut();
} else {
$('#msg').html(result.message).css('color', 'red').fadeIn().delay(3000).fadeOut();
}
},
error: function () {
$('.sendEnquiry').removeAttr('disabled', 'disabled');
$('.sendEnquiry').html('Send Enquiry');
alert('Oops unable to connect with server!!');
}
});
});
$("#subscribe-form").submit(function () {
var email = $.trim($("#send_email").val());
if (email.length == 0)
{
$("#eml").css('color', 'red').html("E-Mail Can't be Empty").fadeIn().delay(3000).fadeOut();
return false;
}
else {
var at = email.indexOf("@");
var dot = email.lastIndexOf(".");
if (at < 3 || dot - at < 3 || email.length - (dot) < 3)
{
$("#eml").css('color', 'red').html("Enter valid email address").fadeIn().delay(3000).fadeOut();
return false;
}
}
$.ajax({
url: SITEURL + 'index/save-letter',
type: 'POST',
data: {email: email},
dataType: 'json',
beforeSend: function () {
// alert("hello");
},
success: function (result) {
$("#eml").css('color', 'green').html("Thank you for subscribing with Visadeal");
return false;
},
error: function () {
alert('Oops unable to connect with server!!');
return false;
}
});
return false;
});
});
function checkTravellers(that, rownumber) {
var div = $(that).closest('.room-rows-container');
var totalpax = 0;
var adults = div.find('#traveler_adult_' + rownumber).val();
var kids = div.find('#traveler_kids_' + rownumber).val();
var infant = div.find('#traveler_infant_' + rownumber).val();
totalpax = parseInt(adults) + parseInt(kids) + parseInt(infant);
if (parseInt(totalpax) > 4) {
alert("Total pax can not be more than 4 in a room. Please modify travellers in room " + rownumber);
if ($(that).hasClass('traveler_adult'))
$(that).val(1); // reset the current value
else
$(that).val(0); // reset the current value
return false;
}
else {
if (parseInt(adults) == 3) {
div.find('#room-row-adult-bedtype-' + rownumber).show();
div.find('#room-row-adult-bedtype-' + rownumber + ' select').val('withoutbed');
} else {
div.find('#room-row-adult-bedtype-' + rownumber).hide();
div.find('#room-row-adult-bedtype-' + rownumber + ' select').val('');
}
div.find('.room-row-child-bedtype-' + rownumber).hide(); // hide all select box
if (parseInt(kids) > 0) {
for (var i = 1; i <= parseInt(kids); i++) {
div.find('#room-row-child-bedtype-' + rownumber + "-" + i).show();
}
}
}
}
function trimcontent(showChar) {
var moretext = "+More";
var lesstext = "-Less";
$('.more').each(function () {
var content = $(this).html();
if (content.length > showChar) {
var c = content.substr(0, showChar);
var h = content.substr(showChar, content.length - showChar);
var html = '<span class="defaultcontent" >' + c + '</span><span class="morecontent">' + h + '</span>\n\
<a href="javascript:void();" class="morelink btn-link btnmore">' + moretext + '</a>';
$(this).html(html);
}
});
$(".morelink").click(function () {
if ($(this).hasClass("less")) {
$(this).removeClass("less").html(moretext);
} else {
$(this).addClass("less").html(lesstext);
}
// $(this).parent().prev().toggle();
$(this).prev().toggle();
return false;
});
$('span.morecontent').hide();
$('.defaultcontent , .morecontent').css({'font-size': '12px', 'text-transform': 'none', 'font-weight': 'normal'});
}
function ptMoneyFormatINR(n, prec, currSign) {
if (prec == null)
prec = 2;
var n = ('' + parseFloat(n).toFixed(prec).toString()).split('.');
var num = n[0];
var dec = n[1];
var r, s, t;
if (num.length > 3) {
s = num.length % 3;
if (s) {
t = num.substring(0, s);
num = t + num.substring(s).replace(/(\d{3})/g, ",$1");
} else {
num = num.substring(s).replace(/(\d{3})/g, ",$1").substring(1);
}
}
// return(currSign == null ? "" : currSign + "") + num + '.' + dec;
return(currSign == null ? "" : currSign + "") + num;
}
function modify_enquiry(that)
{
$(that).hide();
$(that).prev().html('Check Rate & Send Enquiry').attr('disabled', false).show();
}
function submitVisaSearchForm(){
var visaSearchFormVal = $('#visaSearchCountry').val();
var VisaTravelDate = $('#VisaTravelDate').val();
$('#visaSearchCountry').css('border','1px solid #ccc');
$('#VisaTravelDate').css('border','1px solid #ccc');
if(visaSearchFormVal == '' ){
// $(".shakeThisDiv").effect("shake");
$('#visaSearchCountry').css('border','1px solid red');
return false;
}
if( VisaTravelDate == '' ){
// $(".shakeThisDiv1").effect("shake");
$('#VisaTravelDate').css('border','1px solid red');
return false;
}
var data = $('#visaSearchForm').serialize();
$.ajax({
url: SITEURL + 'index/searchvisa',
type: 'POST',
data: data,
dataType: 'json',
beforeSend: function () {
}, success: function (result) {
window.location.href = 'visa/'+getSeoName1(visaSearchFormVal).toLowerCase()+'-visa.html';
}, error: function (result) {
alert('Some error occured.');
}});
}
function getvisaSearchValue(that){
var des = $(that).val();
$('#put_select_destination').val(des);
}
$(document).ready(function () {
$(".insurance_form").on('submit', function (e) {
e.preventDefault();
var data = $(this).serialize();
var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
if ($('.insurance_form input[name="name"]').val() == '') {
$('.insmsg').html('Please enter your name').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.insurance_form input[name="name"]').focus();
return false;
}
if ($('.insurance_form input[name="email"]').val() == '') {
$('.insmsg').html('Please enter your email id').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.insurance_form input[name="email"]').focus();
return false;
}
if (!EmailReg.test($('.insurance_form input[name="email"]').val())) {
$('.insmsg').html('Please enter valid email address!!!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.insurance_form input[name="email"]').focus();
return false;
}
if ($('.insurance_form input[name="mobile"]').val() == '') {
$('.insmsg').html('Please enter your mobile number').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.insurance_form input[name="mobile"]').focus();
return false;
}
if (!$.isNumeric($('.insurance_form input[name="mobile"]').val())) {
$('.insmsg').html('Mobile should be numeric!!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.insurance_form input[name="mobile"]').focus();
return false;
}
if ($('.insurance_form input[name="mobile"]').val().length != '10') {
$('.insmsg').html('Mobile should be 10 digit?').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.insurance_form input[name="mobile"]').focus();
return false;
}
if ($('.insurance_form input[name="dateofBirth"]').val() == '') {
$('.insmsg').html('Please enter date of birth!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.insurance_form input[name="dateofBirth"]').focus();
return false;
}
if ($('.insurance_form input[name="noofDays"]').val() == '') {
$('.insmsg').html('Please enter no of days!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.insurance_form input[name="noofDays"]').focus();
return false;
}
if ($('.insurance_form input[name="destination"]').val() == '') {
$('.insmsg').html('Please enter country!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('.insurance_form input[name="destination"]').focus();
return false;
}
$.ajax({url: SITEURL + 'cms/index/sendenquiry', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
$('.send_ins').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Sending...').attr('disabled', 'disabled');
}, success: function (result) {
if (result.status) {
$('.insmsg').html('Your query sent successfully.').css({'color': '#5cb85c'}).fadeIn().delay(10000).fadeOut();;
$('.send_ins').html('Submit').attr('disabled', 'disabled');
} else {
$('.send_ins').html('Submit').attr('disabled', false);
$('.insmsg').html(result.message)
}
// window.open(SITEURL+'thankyou.html','_blank' );
}, error: function (result) {
$('.send_ins').html('Submit').attr('disabled', false);
alert('Some error occured.');
}});
});
$(".talktous_popup").on('submit', function (e) {
e.preventDefault();
var data = $(this).serialize();
var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
if ($('#pop_name').val() == '') {
$('.msgpop').html('Please enter your name').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('#pop_name').focus();
return false;
}
if ($('#pop_email').val() == '') {
$('.msgpop').html('Please enter your email id').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('#pop_email').focus();
return false;
}
if (!EmailReg.test($('#pop_email').val())) {
$('.msgpop').html('Please enter valid email address!!!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('#pop_email').focus();
return false;
}
if ($('#pop_mobile').val() == '') {
$('.msgpop').html('Please enter your Mobile').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('#pop_mobile').focus();
return false;
}
if (!$.isNumeric($('#pop_mobile').val())) {
$('.msgpop').html('Mobile should be numeric!!').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('#pop_mobile').focus();
return false;
}
if ($('#pop_mobile').val().length != '10') {
$('.msgpop').html('Mobile should be 10 digit?').css('color', 'red').fadeIn().delay(2000).fadeOut();
$('#pop_mobile').focus();
return false;
}
$.ajax({url: SITEURL + 'cms/index/sendenquiry', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
$('.submit_pop').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Sending...').attr('disabled', 'disabled');
}, success: function (result) {
if (result.status) {
$('.msgpop').html('Your query sent successfully.').css({'color': '#5cb85c'}).fadeIn().delay(10000).fadeOut();;
$('.submit_pop').html('Submit').attr('disabled', 'disabled');
} else {
$('.submit_pop').html('Submit').attr('disabled', false);
$('.msgpop').html(result.message)
}
}, error: function (result) {
$('.submit_pop').html('Submit').attr('disabled', false);
alert('Some error occured.');
}});
});
});
function getSeoName1(str) {
str = str.replace( /\s\s+/g, ' ' ).toLowerCase();
str = str.replace(/#|(|)|,|\/|_| +/g, '');
str = str.split(',').join('-');
str = str.split(' ').join('-');
return str.replace('--', '-');
}
function tottraveller() {
var adult = parseInt($('#adult').val());
var child = parseInt($('#child').val());
$('#tottravellerDiv').html(parseInt(adult)+parseInt(child));
$('#tarvellermainBox').hide();
}
function openSearch() {document.getElementById("mySidenavsearch").style.width = "100%";}
function closeSearch() {document.getElementById("mySidenavsearch").style.width = "0";}
$('#next').on("click", function() {
$(".visa_information").toggle("show_hiddenpart");
});
$('#next2').on("click", function() {
$(".visa_information").toggle("");
});
$("#hotel_travller_search").on("click", function(){
$(".room_boxcls").toggle()
});