function restrict_name_input($)
{$('input.strict-name').change(remove_restricted_chars);}
function remove_restricted_chars(event)
{var input=$(this);var regexp=/[АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя]/g;var value=input.val();var output=value.replace(regexp,'');if(output!=value){input.val(output);var message=__('There were not acceptable characters in your name');var errCont=input.next('div');if(errCont.length==0){input.after('
'+message+'
');}else{$(errCont).text(message);}}}
jQuery(document).ready(restrict_name_input);function Eturas_Translator()
{this.loaded=false;this.dictionary={};}
Eturas_Translator.load=function(){var language=jQuery('link[rel=gettext]');if(language.length<1){console.error('link[rel=gettext] expected');Eturas_Translator.dictionary={};Eturas_Translator.loaded=true;return false;}
if(typeof this.started=='undefined'){this.started=jQuery.ajax({'url':language.attr('href')+'/c=?','async':false,'dataType':'jsonp','jsonpCallback':'Eturas_Translator.decode','cache':true,'method':'GET'});}};Eturas_Translator.decode=function(response){Eturas_Translator.dictionary=response;Eturas_Translator.loaded=true;};Eturas_Translator.locale=function(){var element=jQuery('link[rel=gettext]');if(element.length<1){return'eng';}
return element.attr('hreflang');}
Eturas_Translator.translate=function(input){if(!Eturas_Translator.loaded){Eturas_Translator.load();}
if(typeof Eturas_Translator.dictionary!='object'||typeof Eturas_Translator.dictionary[input]!='string'){return input;}
return Eturas_Translator.dictionary[input];};Eturas_Translator.translate_plural=function(singular,plural,property){if((property%100)==1){return Eturas_Translator.translate(singular).format(property);}
return Eturas_Translator.translate(plural).format(property);};if(typeof __=='undefined'){var __=Eturas_Translator.translate;};function selectedPayment(){var selected=null;var typeList=jQuery('a.payment-type');for(var i=0;i0){selected=typeList.first().attr('id').split('-');}}
if(selected){selected=selected[2];}
return selected;}
function showPayment(selected){if(!selected){selected=selectedPayment();}else{if(selected=='transfer'){$('#payment-13').attr('checked',true);}else if(selected=='cash'){$('#payment-12').attr('checked',true);}else if(selected=='cc'){if($('#payment-8').length>0){$('#payment-8').attr('checked',true);}else{$('#payment-28').attr('checked',true);}}}
if(selected=="online"||selected=="cc"){$("#total_price em").show();$('#osubmit1').show();$('#osubmit2').hide();}else{$("#total_price em").hide();$('#osubmit2').show();$('#osubmit1').hide();}
$("#tabs a").removeClass("act");$("#tabs a#payments-link-"+selected).addClass("act");$("div.payments").hide();$("#payments-"+selected).show().find("input:radio:first").trigger("click");if($('#OrdersOrder2Form').length){if(typeof flights.order2.totalPrice!=="undefined"){flights.order2.totalPrice();}}else{if(typeof flights.totalPrice!=="undefined"){flights.totalPrice();}}}
function showPayment2(selected){if(!selected){selected=selectedPayment();}else{if(selected=='transfer'){$('#OrdersPayment-typeTransfer').attr('checked',true);$('#order3-payment-li-online, #order3-payment-li-cc, #order3-payment-li-erip, #order3-payment-li-cash').removeClass('active');$('#order3-payment-li-transfer').addClass('active');}else if(selected=='cash'){$('#OrdersPayment-typeCash').attr('checked',true);$('#order3-payment-li-online, #order3-payment-li-cc, #order3-payment-li-erip, #order3-payment-li-transfer').removeClass('active');$('#order3-payment-li-cash').addClass('active');}else if(selected=='cc'){$('#OrdersPayment-typeCc').attr('checked',true);$('#order3-payment-li-online, #order3-payment-li-transfer, #order3-payment-li-erip, #order3-payment-li-cash').removeClass('active');$('#order3-payment-li-cc').addClass('active');}else if(selected=='online'){$('#OrdersPayment-typeOnline').attr('checked',true);$('#order3-payment-li-transfer, #order3-payment-li-cc, #order3-payment-li-erip, #order3-payment-li-cash').removeClass('active');$('#order3-payment-li-online').addClass('active');}else if(selected=='erip'){$('#OrdersPayment-typeErip').attr('checked',true);$('#order3-payment-li-transfer, #order3-payment-li-cc, #order3-payment-li-online, #order3-payment-li-cash').removeClass('active');$('#order3-payment-li-erip').addClass('active');}}
if(selected=='online'){$('#payments-online input:first').attr('checked',true);$('#order-submit').html(__('Pay'));}else if(selected=='cc'){$('#payments-cc input:first').attr('checked',true);$('#order-submit').html(__('Book'));}else{$('#order-submit').html(__('Book'));}
$('#tabs a').removeClass('act');$('#tabs a#payments-link-'+selected).addClass('act');$('div.order3-payments').hide();$('#payments-'+selected).show();if(typeof flights.totalPrice!='undefined'){flights.totalPrice();}}
jQuery(document).ready(function($){showPayment();});;(function(){Eturas=function(){};Eturas.resizeURL=document.referrer;Eturas.parentWindow=(window.parent&&window.parent.length);Eturas.updateIframeHeight_repeat=false;Eturas.updateIframeHeight_off=false;Eturas.updateIframeHeight=function(repeat){if(!Eturas.parentWindow)return;if(Eturas.updateIframeHeight_off)return;if(jQuery('div#main').length&&Eturas.parentWindow){newHeight=jQuery('div#main').height()+8;$.postmessage({target:window.parent,type:'new_resize',data:{height:""+newHeight+"",windowName:window.name,windowLocation:window.location.href.replace(window.location.hash,''),hash:window.location.hash.substring(1)},url:Eturas.resizeURL,success:function(data){jQuery('body').attr('setHeight',newHeight);newHeight_2=jQuery('div#main').height();Eturas.updateIframeHeight_repeat=true;}});if(!repeat)setTimeout("Eturas.updateIframeHeight(1);",200);}};Eturas.pageToTop=function(){if(Eturas.parentWindow){$.postmessage({target:window.parent,type:'top',data:{hash:window.location.hash.substring(1),windowName:window.name},success:function(data){},url:Eturas.resizeURL});}else{window.scroll(0,0);}};Eturas.pageToiFrameTop=function(tP,wName){if(Eturas.parentWindow){if(typeof wName=='undefined')wName=window.name;$.postmessage({target:window.parent,type:'iframeTop',data:{hash:window.location.hash.substring(1),windowName:wName,topPlius:tP},success:function(data){},url:Eturas.resizeURL});}else{window.scroll(0,tP);}};Eturas.callCustomScript=function(script_url){if(Eturas.parentWindow){if(typeof wName=='undefined')wName=window.name;$.postmessage({target:window.parent,type:'callCustomScript',data:{hash:window.location.hash.substring(1),windowName:wName,script_url:script_url},success:function(data){},url:Eturas.resizeURL});}};$(document).ready(function(){Eturas.updateIframeHeight();});})(window);;function print_r(array,return_val){var output="",pad_char=" ",pad_val=4,d=this.window.document;var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};var repeat_char=function(len,pad_char){var str="";for(var i=0;i0){cur_depth++;}
var base_pad=repeat_char(pad_val*cur_depth,pad_char);var thick_pad=repeat_char(pad_val*(cur_depth+1),pad_char);var str="";if(typeof obj==='object'&&obj!==null&&obj.constructor&&getFuncName(obj.constructor)!=='PHPJS_Resource'){str+="Array\n"+base_pad+"(\n";for(var key in obj){if(obj[key]instanceof Array){str+=thick_pad+"["+key+"] => "+formatArray(obj[key],cur_depth+1,pad_val,pad_char);}else{str+=thick_pad+"["+key+"] => "+obj[key]+"\n";}}
str+=base_pad+")\n";}else if(obj===null||obj===undefined){str='';}else{str=obj.toString();}
return str;};output=formatArray(array,0,pad_val,pad_char);if(return_val!==true){if(d.body){this.echo(output);}
else{try{d=XULDocument;this.echo(''+output+' ');}
catch(e){this.echo(output);}}
return true;}else{return output;}}
function echo(){var arg='',argc=arguments.length,argv=arguments,i=0;var win=this.window;var d=win.document;var ns_xhtml='http://www.w3.org/1999/xhtml';var ns_xul='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';var holder;var stringToDOM=function(str,parent,ns,container){var extraNSs='';if(ns===ns_xul){extraNSs=' xmlns:html="'+ns_xhtml+'"';}
var stringContainer='<'+container+' xmlns="'+ns+'"'+extraNSs+'>'+str+''+container+'>';if(win.DOMImplementationLS&&win.DOMImplementationLS.createLSInput&&win.DOMImplementationLS.createLSParser){var lsInput=DOMImplementationLS.createLSInput();lsInput.stringData=stringContainer;var lsParser=DOMImplementationLS.createLSParser(1,null);return lsParser.parse(lsInput).firstChild;}
else if(win.DOMParser){try{var fc=new DOMParser().parseFromString(stringContainer,'text/xml');if(!fc||!fc.documentElement||fc.documentElement.localName!=='parsererror'||fc.documentElement.namespaceURI!=='http://www.mozilla.org/newlayout/xml/parsererror.xml'){return fc.documentElement.firstChild;}}
catch(e){}}
else if(win.ActiveXObject){var axo=new ActiveXObject('MSXML2.DOMDocument');axo.loadXML(str);return axo.documentElement;}
if(d.createElementNS&&(d.documentElement.namespaceURI||d.documentElement.nodeName.toLowerCase()!=='html'||(d.contentType&&d.contentType!=='text/html'))){holder=d.createElementNS(ns,container);}
else{holder=d.createElement(container);}
holder.innerHTML=str;while(holder.firstChild){parent.appendChild(holder.firstChild);}
return false;};var ieFix=function(node){if(node.nodeType===1){var newNode=d.createElement(node.nodeName);var i,len;if(node.attributes&&node.attributes.length>0){for(i=0,len=node.attributes.length;i0){for(i=0,len=node.childNodes.length;i0&&$("#SearchArrivalId").length>0){Dpa_a=$("#SearchDepartureId").val();Des_a=$("#SearchArrivalId").val();if(Dpa_a!=''&&Des_a!=''){$.getJSON(host+'prices/low_cost_dates/'+Dpa_a+'/'+Des_a,function(response){low_cost_dates=response;});}}};function change_check(path,status)
{var elementList=null;if(typeof path=='object'){elementList=path;}else{elementList=jQuery(path);}
elementList.each(function(idx,input){var element=jQuery(input);if(element.is('input')&&!element.is(':disabled')){element.attr('checked',status);}});return elementList;}
function checker(event)
{var rFalse=true;var element=jQuery(this);var doCheck=(true===element.hasClass('all'));var collection=jQuery('input',element.parents('ul'));if(typeof event!=='undefined'){event.preventDefault();rFalse=false;}
if(collection.length>0){change_check(collection,doCheck);jQuery(collection[collection.length-1]).trigger('click').attr('checked',doCheck);}
if(rFalse){return false;}}
jQuery(document).ready(function($){$('li.checker a').live('click',checker);});;function popup_evt_window(event)
{event.preventDefault();var linked=jQuery(this);var dimmensions=linked.attr('window').split('-');var openMethod=function(){return win(linked.attr('href'),dimmensions[0],dimmensions[1]);};var cleanUp=function(){linked.removeClass('disabled');};if(!linked.hasClass('disabled')){linked.addClass('disabled');setTimeout(openMethod,1);setTimeout(cleanUp,250);}}
jQuery(document).ready(function($){$('.popup-win').click(popup_evt_window);});;function eturas_storage(name,content)
{if(typeof eturas_storage.data==='undefined'){eturas_storage.data={};}
if(typeof content==='undefined'){if(typeof eturas_storage.data[name]==='undefined'){return null;}
return eturas_storage.data[name];}else{eturas_storage.data[name]=content;}}
function load_and_cache(element,uri)
{if(typeof load_and_cache.locks==='undefined'){load_and_cache.locks={};}
if(typeof load_and_cache.timers==='undefined'){load_and_cache.timers={};}
var datum=eturas_storage(element);if(datum){load_and_cache.locks[uri]=false;jQuery(element).html(datum);Eturas.updateIframeHeight();}else{if(typeof load_and_cache.locks[uri]==='undefined'||!load_and_cache.locks[uri]){load_and_cache.locks[uri]=true;jQuery.get(uri,function(response){eturas_storage(element,response);});}
var reCall=function(){load_and_cache(element,uri);};if(load_and_cache.timers[uri]){clearTimeout(load_and_cache.timers[uri]);}
load_and_cache.timers[uri]=setTimeout(reCall,50);}}
function delay_cached_load(element,uri,delay)
{if(typeof delay==='undefined'){delay=1;}
var actualCall=function(){load_and_cache(element,uri);};setTimeout(actualCall,delay);};this.imagePreview=function(){if($('a.preview').hasClass('preparking')==true){xOffset=250;yOffset=20;}else{xOffset=10;yOffset=30;}
$("a.preview").hover(function(e){this.t=this.title;this.title="";var c=(this.t!="")?" "+this.t:"";$("body").append(" "+c+"
");$("#preview").css("top",(e.pageY-xOffset)+"px").css("left",(e.pageX+yOffset)+"px").fadeIn("fast");},function(){this.title=this.t;$("#preview").remove();});$("a.preview").mousemove(function(e){top_end=false;tp=(e.pageY-xOffset);lf=(e.pageX+yOffset);window_width=$(window).width();window_height=$(window).height();if(window.innerHeight+document.documentElement.scrollTop-$("#preview").height()"+this.t:"";$("body").append(" "+c+"
");$("#preview").css("top",(e.pageY-xOffset)+"px").css("left",(e.pageX+yOffset)+"px").fadeIn("fast");},function(){this.title=this.t;$("#preview").remove();});$("a.preview2").mousemove(function(e){top_end=false;tp=(e.pageY-xOffset);lf=(e.pageX+yOffset);window_width=$(window).width();window_height=$(window).height();if(window.innerHeight+document.documentElement.scrollTop-$("#preview").height()').attr('id',s.containerID).append(' ').hide().css('position','absolute').appendTo('body'),$img=$('img',$container).css(s.imgCSS),$collection=this.filter(':linkingToImage('+s.srcAttr+')');function addPrefix(src){return src.replace(/(\/?)([^\/]+)$/,'$1'+s.thumbPrefix+'$2');}
if(s.preloadImages){(function(i){var tempIMG=new Image(),callee=arguments.callee;tempIMG.src=addPrefix($($collection[i]).attr(s.srcAttr));tempIMG.onload=function(){$collection[i+1]&&callee(i+1);};})(0);}
$collection.mousemove(function(e){$container.css({top:e.pageY+s.distanceFromCursor.top+'px',left:e.pageX+s.distanceFromCursor.left+'px'});}).hover(function(){var link=this;$container.addClass(s.containerLoadingClass).show();$img.load(function(){$container.removeClass(s.containerLoadingClass);$img.show();s.onLoad.call($img[0],link);}).attr('src',addPrefix($(link).attr(s.srcAttr)));s.onShow.call($container[0],link);},function(){$container.hide();$img.unbind('load').attr('src','').hide();s.onHide.call($container[0],this);});return this;};})(jQuery);;(function($){window.flights=function(){};window.flights.init=function(){if($('#eturasframe').length){$('#eturasframe').ready(function(){Eturas.updateIframeHeight();});$('#eturasframe').load(function(){Eturas.updateIframeHeight();});}
if($('#priority_boarding_rules_link').length){$("#priority_boarding_rules_link").click(function(e){e.preventDefault();win(priorityBoardingRulesUrl,600,600);});}
if($('#hotel_price_loader').length){response=$.ajax({url:price_url,dataType:'jsonp',data:price_id,timeout:50000,crossDomain:true,type:'POST'});response.done(function(data){if(data.price!=null){var priceLow=parseInt(data.price);$('#hotel_price_big').html(priceLow.toFixed());$('#hotel_price_loader').hide();$('#hotel_price_full').fadeIn('slow');}else{$('#hotel_price_loader').hide();$('#hotel_price_empty').fadeIn('slow');}});response.fail(function(jqXHR,textStatus){$('#hotel_price_loader').hide();$('#hotel_price_empty').fadeIn('slow');});}
if($('ul.payments input').length){jQuery('ul.payments input').on('change',function(){jQuery('ul.payments label').removeClass('act');jQuery(this).parent('label').addClass('act');});jQuery('ul.payments input:checked').trigger('change');}
jQuery('body').on('hover','#social-tools',function(){if($('a#qrcode').length){$('a#qrcode').bind('click',false);$('a#qrcode').imgPreview({containerID:'img-preview-box',onShow:function(link){$(link).stop().animate({opacity:0.4});$('img',this).stop().css({opacity:0});},onLoad:function(){$(this).animate({opacity:1},300);},onHide:function(link){$(link).stop().animate({opacity:1});}});}
$(".sharing_item").hover(function(e){$('.sharing-explanation').remove();tt_left=e.clientX+15;tt_top=e.clientY+15;this_id=$(this).attr('id');tt=$(this).attr('data-tt');$(this).after('
');$('#'+this_id+'_item').html(tt);$(this).mousemove(function(e){tt_left=e.clientX;tt_top=e.clientY;$('#'+this_id+'_item').css({left:(tt_left+15),top:(tt_top+15),display:'block'});});},function(){$('.sharing-explanation').remove();});});if(typeof newsletterUrl!=='undefined'){newsletter({url:newsletterUrl,email:document.getElementById('newsletter_email'),button:document.getElementById('newsletter_button'),callback:function(response){if(response.status=='ok'){}else{if(response.error=='bad_mail'){$('#newsletter_error').text(newsletterBadEMailText).css({display:'block'});}
$('#newsletter_response').hide();}}});}
$('#search-filter-form input:checkbox').live('change',function(){if($(this).is(':checked')){$(this).next('label:not(.direct-flight-label)').removeClass('muted');}else{$(this).next('label:not(.direct-flight-label)').addClass('muted');}});$('.check-lowest-price').live('click',function(e){e.preventDefault();if(!$(this).hasClass('link-disabled')){var linkId=$(this).attr('id');var underscoreIdx=linkId.indexOf('_');var minusIdx=linkId.indexOf('-');var priceId=linkId.substr(underscoreIdx+1,(minusIdx-underscoreIdx-1));var cacheId=linkId.substr(minusIdx+1);$('.check-lowest-price').addClass('link-disabled');flights.checkPrice(priceId,cacheId);}});if(jQuery('.small_photo_change').length){jQuery('.small_photo_change').on('click',function(e){e.preventDefault();var photoId=jQuery(this).data('photo_id');flights.changePhoto(photoId);});}
if(jQuery('.passengers-order-submit').length){jQuery('.passengers-order-submit').on('click',function(e){e.preventDefault();flights.submitOrder('#OrdersPassengersOrder3Form');return false;});}
if(jQuery('.search-repeat-submit').length){jQuery('.search-repeat-submit').on('click',function(e){e.preventDefault();flights.submitSearch('#searchform');return false;});}
if(jQuery('.show-payment').length){jQuery('.show-payment').on('click',function(e){e.preventDefault();var paymentType=jQuery(this).data('payment');showPayment(paymentType);return false;});}
if(jQuery('.payment-radio').length){jQuery('.payment-radio').on('click',function(){if(orderStep==='order2'){flights.order2.totalPrice();}else if(orderStep==='order3'){flights.totalPrice();}});}
if(jQuery('.show-destinations').length){jQuery('.show-destinations').on('click',function(e){e.preventDefault();var destination=jQuery(this).data('destination');show_destinations(destination);return false;});}
if(jQuery('.way-type').length){jQuery('.way-type').on('click',function(){show_waytype();return true;});}
if(jQuery('.calendar').length){jQuery('.calendar').on('click',function(e){e.preventDefault();var typeId=jQuery(this).data('type_id');jQuery('#'+typeId).focus();});}
if(jQuery('.quick-search-submit').length){jQuery('.quick-search-submit').on('click',function(){flights.submitQuickSearch();return false;});}
jQuery('body').on('click','.mimic-results',function(){mimic_results();});jQuery('body').on('click','.quick-search-map',function(e){e.preventDefault();var mapUrl=jQuery(this).data('map_url');win(mapUrl,620,620);return false;});};window.flights.changePhoto=function(id){jQuery('.photo_image').attr('src',gallery_photos[id]);};window.flights.moreFlights=function(destination_id,departure_id){var id='#destination-details-'+departure_id;var more='#more-link-'+departure_id;if($(id).html()===''){$('#destination-details-loader'+departure_id).show();$.get(moreFlightsUrl+'/'+destination_id+'?departure_id='+departure_id,function(data){$(id).show();$(id).html(data);$('#destination-details-loader'+departure_id).hide();$(more).addClass('more2');$(more).html(moreFlightsCollapseText);Eturas.updateIframeHeight();});}else{if($(id).is(':visible')){$(more).removeClass('more2');$(more).html(moreFlightsExpandText);$(id).hide();Eturas.updateIframeHeight();}else{$(more).addClass('more2');$(more).html(moreFlightsCollapseText);$(id).show();Eturas.updateIframeHeight();}}};window.flights.checkPrice=function(price_id,cache_id){var id='td#price-'+price_id;$(id).html(checkPriceLoaderImage);$.getJSON(checkPriceUrl+'/'+price_id+'/'+cache_id,function(data){if(data.status=='price_not_found'){$(id).html(''+checkPriceRedeemText+' ');}else if(data.status=='price_changed'){$(id).html(''+checkPriceLinkText+' ');$('#price-s-'+price_id).html(Math.round(data.new_price));if(typeof data.new_alt_price!='undefined'){$('#price-alt-'+price_id).html(parseFloat(data.new_alt_price).toFixed(2));}}else if(data.status=='price_ok'){$(id).html(''+checkPriceLinkText+' ');}
$('.check-lowest-price').toggleClass('link-disabled');});};window.flights.submitOrder=function(formId){setTimeout(function(){$(formId).submit();},200);};window.flights.submitSearch=function(formId){$(formId).submit();return true;};window.flights.submitQuickSearch=function(){var way_type=$('input:radio[name="data[Search][way_type]"]:checked').val();var departure=true;var destination=true;var departure_date=true;var destination_date=true;if(!$('#SearchDepartureId').val()||!$('#SearchDeparture').val()||$('#SearchDeparture').val()==$('#SearchDeparture').attr('default_text')){departure=false;$('#SearchDeparture').addClass('error');}
else{$('#SearchDeparture').removeClass('error');}
if(!$('#SearchArrivalId').val()||!$('#SearchArrival').val()||$('#SearchArrival').val()==$('#SearchArrival').attr('default_text')){destination=false;$('#SearchArrival').addClass('error');}
else{$('#SearchArrival').removeClass('error');}
if(!$('#SearchDepartureDate').val()){departure_date=false;$('#SearchDepartureDate').addClass('error');}
else{$('#SearchDepartureDate').removeClass('error');}
var departuredate=$('#SearchDepartureDate').val();var comebackdate=$('#SearchComebackDate').val();var timestamp=Number(new Date(departuredate));var timestamp2=Number(new Date(comebackdate));if(way_type!='one_way'&&!comebackdate){destination_date=false;$('#SearchComebackDate').addClass('error');}
else{$('#SearchComebackDate').removeClass('error');}
if(!departure){alert(quickSearchDepartureText);}
else if(!destination){alert(quickSearchDestinationText);}
else if(!departure_date){alert(quickSearchDepartureDateText);}
else if(!destination_date){alert(quickSearchDestinationDateText);}
else if(way_type!='one_way'&×tamp20){if(Eturas.parentWindow==false){jQuery('html, body').animate({scrollTop:jQuery('#etr_form_start').offset().top},'slow');}
jQuery('#'+firstInput).focus();e.preventDefault();return false;}
return true;};if(typeof moneyBackInsurancePrice!=="undefined"){jQuery("#money_back_insurance").change(function(){$el=jQuery("#details-cancellation");$el.find("#details-cancellation-price").text(moneyBackInsurancePrice.toFixed(2));if(jQuery(this).is(":checked")){var t=total1+moneyBackInsurancePrice;jQuery('#details-price').text(t.toFixed(2));$el.show();}else{jQuery('#details-price').text(total1.toFixed(2));$el.hide();}}).trigger("change");}};flights.order1.submitForm=function(){jQuery.validateFormData('OrdersOrder1Form');jQuery('#order_submit_btn').addClass('disabled').html(' ');var btn=jQuery('#order_submit_btn')[0];var clicked=jQuery.data(btn,'clicked');if(clicked){return false;}else{jQuery.data(btn,'clicked',1);}
flights.submitOrder('#OrdersOrder1Form');};flights.order1.toggleCancellation=function(price){total=parseFloat(jQuery('#details-price').html());price=parseFloat(price);if(jQuery('#cancellation').attr('checked')){total+=price;currency=currencyId;jQuery('#details-cancellation-price').html(price.toFixed(2));jQuery('#details-price').html(total.toFixed(2));jQuery('#details-cancellation').show();if(jQuery('#cancellation_txt').css('display')!='none'){jQuery('#cancellation_txt_price').html(price+' '+currency);jQuery('#cancellation_txt').hide();jQuery('#cancellation_txt_price').show();}else if(jQuery('#dual-cancellation').css('display')!='none'){jQuery('#dual-cancellation_price').html(price+' '+currency);jQuery('#dual-cancellation').hide();jQuery('#dual-cancellation_price').show();}}else{total-=parseFloat(price);jQuery('#details-price').html(total.toFixed(2));jQuery('#details-cancellation').hide();if(jQuery('#cancellation_txt_price').css('display')!='none'){jQuery('#cancellation_txt_price').html(price+' '+currency);jQuery('#cancellation_txt').show();jQuery('#cancellation_txt_price').hide();}else if($('#dual-cancellation_price').css('display')!='none'){jQuery('#dual-cancellation_price').html(price+' '+currency);jQuery('#dual-cancellation').show();jQuery('#dual-cancellation_price').hide();}}};flights.order1.showCompany=function(){if(jQuery('#c2').is(':checked')){jQuery('#company-info').show();}else{jQuery('#company-info').hide();}
Eturas.updateIframeHeight();};}})(window);jQuery(document).ready(function(){if(jQuery('#OrdersOrder1Form').length){flights.order1.init();}});;(function($){if(typeof window.flights!=='undefined'){flights.order2=function(){};flights.order2.init=function(){insurancePassengers();calculateInsurance(1);showPayment();showAffiliate();jQuery('ul#tabs li:first a').addClass('act');jQuery('.payment-radio:first').attr('checked',true);if(showPopup){if(Eturas.parentWindow){call_timeout_popup('http://'+popupSubdomain+'.eturas.lt/flights/custom_script.php?lang='+popupLanguage+'&url='+popupUrl+popupMessageTitle+popupMessageText);}else{jQuery('div.popup_1').hide();jQuery('#middle-loading').show();jQuery('#loading').show();}}
if(Eturas.parentWindow){timeout=setTimeout("call_timeout_popup('http://"+popupSubdomain+".eturas.lt/flights/custom_script.php?lang="+popupLanguage+"&url="+popupUrl+"');",2000000);}else{timeout=setTimeout("$('div.popup_1').hide();$('#middle-loading').show();$('#loading').show();$('#middle-loading').css('left','110px');",2000000);}
jQuery.getJSON(checkBookingUrl+'?'+(new Date()).getTime(),function(resp){if(resp.status&&resp.status!='INPROGRESS'){if(redirectParent){window.parent.location.href=redirectUrl;}else{window.location.href=redirectUrl;}}});jQuery("#services_accordion .head").click(function(e){e.preventDefault();jQuery(this).next().slideToggle("fast",function(){jQuery(this).is(":visible")?jQuery(this).parent().addClass("open"):jQuery(this).parent().removeClass("open");Eturas.updateIframeHeight();});});jQuery(".insurance-more-link").click(function(e){e.preventDefault();jQuery(this).next().slideToggle("fast",function(){});});jQuery("a.preview").click(function(e){e.preventDefault();});jQuery("#priority_boarding").change(function(){flights.order2.totalPrice();});var $luggageSelects=jQuery("select.luggage");var $cabinLuggageSelects=jQuery("select.cabin-luggage");$luggageSelects.add($cabinLuggageSelects).attr("disabled",true);jQuery.getJSON(luggagesURL,function(data){$luggageSelects.add($cabinLuggageSelects).html("");var minLuggagePrice=0;var minLuggageWeight=0,maxLuggageWeight=10;var minCabinLuggagePrice=0;jQuery(""+data.options+" ").children("option").each(function(){if(jQuery(this).val()===""){$luggageSelects.add($cabinLuggageSelects).append(jQuery(this));return;}
var optionIdent=jQuery(this).val().split('-')[0];if(jQuery(this).attr("data-luggage-type")!=="cabin"){$luggageSelects.append(jQuery(this));if(minLuggagePrice>data.prices[optionIdent].price||minLuggagePrice===0){minLuggagePrice=data.prices[optionIdent].price;}
var weight=data.prices[optionIdent].weight;if(minLuggageWeight>weight||minLuggageWeight===0){minLuggageWeight=weight;}
if(maxLuggageWeightdata.prices[optionIdent].price||minCabinLuggagePrice===0){minCabinLuggagePrice=data.prices[optionIdent].price;}}});if(minLuggagePrice>0){jQuery("#min_checked_luggage_price").children("span").text(minLuggagePrice).end().parent().children(".loader").remove().end().end().show();}
if(minCabinLuggagePrice>0){jQuery("#min_cabin_luggage_price").children("span").text(minCabinLuggagePrice).end().parent().children(".loader").remove().end().end().show();}
if(maxLuggageWeight>0){var luggageWeightText=maxLuggageWeight;if(minLuggageWeight>0&&minLuggageWeight!==maxLuggageWeight){luggageWeightText=minLuggageWeight+'/'+luggageWeightText;}}
if(typeof luggageWeightText!==undefined){jQuery("#checked_luggage_weight").text(luggageWeightText);}
luggageOptions=data.prices
$luggageSelects.add($cabinLuggageSelects).change(function(){flights.order2.totalPrice();});$luggageSelects.add($cabinLuggageSelects).removeAttr("disabled").prop("selectedIndex",0);});var $typeCheckboxes=jQuery(":checkbox.parking-type");jQuery.getJSON(parkingsURL,function(parkings){var minParkingPrice=0;var minParkingPriceFormatted="";var ratio=0;var $containers=jQuery(".parking-container");$containers.each(function(index,container){var ident=jQuery(container).attr("data-type-ident");var $priceFormattedContainer=jQuery(container).find(".type-price-formatted");var $priceStandardFormattedContainer=jQuery(container).find('.type-price-standard-formatted');var $discountContainer=jQuery(container).find('b');if(!ident||!parkings.hasOwnProperty(ident)){$priceFormattedContainer.text("-");return true;}
var parking=parkings[ident];if(minParkingPrice>parking.price||minParkingPrice===0){minParkingPrice=parking.price;minParkingPriceFormatted=parking.priceFormattedRounded;}
if(parking.priceStandard!=undefined){ratio=Math.round((1-(parking.price/parking.priceStandard))*100);$priceFormattedContainer.text(parking.priceFormatted);$priceStandardFormattedContainer.text(parking.priceStandardFormatted);$discountContainer.text(Math.abs(ratio)+'%');if(minParkingPrice==parking.price){minParkingPriceFormatted=''+ratio+'% '+minParkingPriceFormatted;}
ratio=0;}else{$priceFormattedContainer.text(parking.priceFormatted);}
$checkbox=jQuery(container).find($typeCheckboxes);$checkbox.attr("id",ident).attr("data-type-ident",ident).attr("data-price",parking.price).attr("data-price-formatted",parking.priceFormattedRounded).removeAttr("disabled");if(typeof parking.offerId!=="undefined"){$checkbox.attr("data-offer-id",parking.offerId);}});imagePreview();if(minParkingPriceFormatted===""){minParkingPriceFormatted="-";}
jQuery("#min_parking_price").find("span").html(minParkingPriceFormatted).end().parent().find(".loader").remove().end().end().show();if(minParkingPriceFormatted===""||minParkingPriceFormatted==="-"){jQuery("#parking_section").remove();}});jQuery(".number-plate-input-container").click(function(event){event.preventDefault();});$typeCheckboxes.change(function(){var $parkingTypeIdent=jQuery(":hidden#parking_type_ident"),$parkingPrice=jQuery(":hidden#parking_price");var $parkingOfferId=jQuery(':hidden#parking_offer_id');$parkingTypeIdent.add($parkingPrice).removeAttr("value");$typeCheckboxes.filter(":checked").not(this).prop("checked",false).add(this).each(function(){jQuery(this).parents("label").removeClass("checked");});if(jQuery(this).is(":checked")){$parkingTypeIdent.val(jQuery(this).attr("data-type-ident"));$parkingPrice.val(jQuery(this).attr("data-price"));$parkingPrice.attr("data-price-formatted",jQuery(this).attr("data-price-formatted"));parkingOfferId=jQuery(this).attr("data-offer-id");if(typeof parkingOfferId!=="undefined"&&parkingOfferId!==false){$parkingOfferId.val(parkingOfferId);}
jQuery(this).parents("label").addClass("checked");}
jQuery(".number-plate-input-container").hide();jQuery(this).parent().find(".number-plate-input-container").toggle(jQuery(this).is(":checked"));flights.order2.totalPrice();});jQuery("#parking_section").find("a > span.txt").hide();function calculateInsurance(test){if(!test){test=0;}
var validate=true;var insurances=0;for(i=1;i<=totalPassengers;i++){if(test==1){insurances=1;continue;}
insurances=1;jQuery('#passenger-insurance-'+i+' *').removeClass('form-error2');if(!jQuery('#OrdersPassengers'+i+'PersonalCode').val()||jQuery('#OrdersPassengers'+i+'PersonalCode').val().length!=11){validate=false;jQuery('#OrdersPassengers'+i+'PersonalCode').addClass('form-error2');}
if(!jQuery('#OrdersPassengers'+i+'Address').val()){validate=false;jQuery('#OrdersPassengers'+i+'Address').addClass('form-error2');}
if(!jQuery('#OrdersPassengers'+i+'CityId').val()){validate=false;jQuery('#OrdersPassengers'+i+'CityId').addClass('form-error2');}
if(!jQuery('#OrdersPassengers'+i+'BirthDateYear').val()||!jQuery('#OrdersPassengers'+i+'BirthDateMonth').val()||!jQuery('#OrdersPassengers'+i+'BirthDateDay').val()){jQuery('#OrdersPassengers'+i+'BirthDateYear').addClass('form-error2');jQuery('#OrdersPassengers'+i+'BirthDateMonth').addClass('form-error2');jQuery('#OrdersPassengers'+i+'BirthDateDay').addClass('form-error2');validate=false;}}
jQuery('big.insurance-prices').removeClass('bold');jQuery('big.insurance-prices').removeClass('red2');if(insurances==0){alert(insuranceSelectText);jQuery('input.insurances').attr('checked',false);jQuery('#OrdersCalculateInsurance').val(0);}else if(!validate){alert(insuranceCorrectDataText);jQuery('input.insurances').attr('checked',false);jQuery('#OrdersCalculateInsurance').val(0);}else{var ids=[];var i=0;jQuery("input.insurances").parents("li").removeClass("checked");jQuery('input.insurances:checked').each(function(){var id='big#'+jQuery(this).attr('big').toString();jQuery(this).parents("li").addClass("checked");ids[i++]=this.id;});if(i>0&&!in_array('insurance_med_isl_chk',ids)){jQuery('input#insurance_med_isl_chk').attr('checked',true);var id='big#'+jQuery('#insurance_med_isl_chk').attr('big').toString();jQuery("input#insurance_med_isl_chk").parents("li").addClass("checked");}
var data=jQuery('#OrdersOrder2Form').serialize();var $insuranceSection=jQuery("li#insurance_section");if(ids.length>0){$insuranceSection.find("a").addClass("spec").find("span.txt").show();}else{$insuranceSection.find("a").removeClass("spec").find("span.txt").hide();}
jQuery('.insurance-loader').show();jQuery('.insurance-prices').hide();jQuery.ajax({type:'POST',timeout:5000,data:data,dataType:'json',url:insuranceCalculateUrl+'/test:'+test,error:function(){$insuranceSection.remove();},success:function(data){jQuery('.insurance-loader').hide();jQuery('.insurance-prices').show();if(data.status=='error'){return false;}
var insurances=new Array("is_med","is_na","is_bd","is_ca","med_isl_chk","na_chk","bag_prarad_chk","neiv_kel_dr_var","asm_civ_chk");var minInsurancePrice=0;for(i=0;i0&&data[insurances[i]].sum>0){thisSum=data[insurances[i]].sum*insuranceRatio*totalPassengers*1.15;if(insurances[i]==="med_isl_chk"||(!jQuery.inArray("med_isl_chk",insurances)&&(minInsurancePrice>thisSum||minInsurancePrice===0))){minInsurancePrice=thisSum;}
jQuery('#insurance_'+insurances[i]).removeAttr("disabled");jQuery('#insurance_big_'+insurances[i]+' span').html(Math.ceil(thisSum.toFixed(2)));jQuery('#insurance_'+insurances[i]).attr("price",Math.ceil(thisSum.toFixed(2)));jQuery('#insurance_'+insurances[i]+'_price').val(Math.ceil(thisSum.toFixed(2)));}else if(jQuery('#insurance_'+insurances[i]).length>0){jQuery('#insurance_big_'+insurances[i]+' span').html('--');jQuery('#insurance_'+insurances[i]).attr('checked',false);}}
if(minInsurancePrice>0){minInsurancePrice=Math.ceil(minInsurancePrice);jQuery("#min_insurance_price").find("span").text(minInsurancePrice).end().parent().find(".loader").remove().end().end().show();}
flights.order2.totalPrice();jQuery('#OrdersCalculateInsurance').val(1);}});}}
function showAffiliate(){var val=jQuery('#OrdersAffiliateId').val();jQuery('.affiliates-text').hide();jQuery('#affiliate-text-'+val).show();}
function insurancePassengers(check){if(check){}
var total=0;for(i=1;i<=totalPassengers;i++){if(jQuery('#OrdersPassengers'+i+'Check').is(':checked')){jQuery('#passenger-insurance-'+i).show();total++;}else{jQuery('#passenger-insurance-'+i).hide();}}
total=totalPassengers;if(check){if(totalPreviousPassengers>total){jQuery('input.insurances').attr('checked',false);jQuery('big.insurance-prices').removeClass('bold');jQuery('big.insurance-prices').removeClass('red2');flights.order2.totalPrice();}else if(totalPreviousPassengers0){jQuery('input.insurances').attr('checked',false);jQuery('big.insurance-prices').removeClass('bold');jQuery('big.insurance-prices').removeClass('red2');flights.order2.totalPrice();}
totalPreviousPassengers=total;}
if(total==0){jQuery('input.insurances').attr('checked',false);jQuery('big.insurance-prices').removeClass('bold');jQuery('big.insurance-prices').removeClass('red2');flights.order2.totalPrice();}}};flights.order2.totalPrice=function(){var total=price,flightPrice=price;var insurance=services=parking=0;var passenger=0;var bagsCount=0;if(typeof flights.order2.totalPrice.packing=='undefined'){flights.order2.totalPrice.packing=0;}
var $luggageSelect=jQuery("select.luggage");var $cabinLuggageSelect=jQuery("select.cabin-luggage");var luggagePrice=0;if(jQuery.isArray(luggageOptions)||jQuery.isPlainObject(luggageOptions)){$luggageSelect.each(function(){var qnt=jQuery(this).val();jQuery('#OrdersPassengers'+passenger+'BaggageWeight').removeAttr("value");jQuery('#OrdersPassengers'+passenger+'BaggagePrice').removeAttr("value");if(qnt==0){passenger++;return;}
var sp=qnt.split('-');var baggagePrice=luggageOptions[sp[0]].price;qnt=sp[1];if(!sp[2]){sp[2]='both';}
jQuery('#OrdersPassengers'+passenger+'BaggageWeight').val(luggageOptions[sp[0]].weight);jQuery('#OrdersPassengers'+passenger+'BaggagePrice').val(baggagePrice);jQuery('#OrdersPassengers'+passenger+'BaggageDirection').val(sp[2]);if(qnt){luggagePrice+=qnt*baggagePrice;total+=qnt*baggagePrice;bagsCount+=parseInt(qnt);}else{++bagsCount;}
passenger++;});}
var cabinLuggagePrice=0;$cabinLuggageSelect.each(function(){var $inputs=jQuery(this).parent().find(":hidden[data-class='cabin-luggage-param']");var parts=jQuery(this).val().split('-');if(parts.length<=1){$inputs.removeAttr("value");return;}
var index=parts[0],quantity=parts[1],luggageDirection=parts[2];if(!luggageDirection){luggageDirection='both';}
var luggageWeight=luggageOptions[index].weight,luggagePrice=luggageOptions[index].price;$inputs.filter("*[data-id='cabin-luggage-weight']").val(luggageWeight);$inputs.filter("*[data-id='cabin-luggage-price']").val(luggagePrice);$inputs.filter("*[data-id='cabin-luggage-direction']").val(luggageDirection);cabinLuggagePrice+=quantity*luggagePrice;});var $cabinLuggageSection=jQuery("li#cabin_luggage_section");var $currentCabinLuggagePriceContainer=jQuery("#current_cabin_luggage_price");var $minCabinLuggagePriceContainer=jQuery("#min_cabin_luggage_price");var $cabinLuggageSidebarSection=jQuery("#details_cabin_luggage");if(cabinLuggagePrice>0){total+=cabinLuggagePrice;$cabinLuggageSection.find("a").addClass("spec").find("span.txt").show();$currentCabinLuggagePriceContainer.children("span").html(cabinLuggagePrice.toFixed(0)).end().show();$minCabinLuggagePriceContainer.hide();$cabinLuggageSidebarSection.find(".price").html(cabinLuggagePrice.toFixed(2)).end().show();}else{$cabinLuggageSection.find("a").removeClass("spec").find("span.txt").hide();if($currentCabinLuggagePriceContainer.is(":visible")){$currentCabinLuggagePriceContainer.hide();$minCabinLuggagePriceContainer.show();}
$cabinLuggageSidebarSection.hide();}
if($luggageSelect.add($cabinLuggageSelect).length<=0){bagsCount=parseInt(jQuery('#travellers_information li').length);}
if(flights.order2.totalPrice.packing>0&&bagsCount>0){var packingSum=flights.order2.totalPrice.packing*bagsCount;jQuery('#details-packing-multiplier').text(parseInt(bagsCount));jQuery('#details-packing-sum').text(parseFloat(packingSum).toFixed(2));jQuery('#details-packing').show();total+=packingSum;}else{jQuery('#details-packing').hide();}
jQuery('input.insurances:checked').each(function(){insurance+=parseFloat(jQuery(this).attr('price'));});jQuery('input.services:checked').each(function(){services+=parseFloat(jQuery(this).attr('price'));});var $currentInsurancePriceContainer=jQuery("#current_insurance_price");var $minInsurancePriceContainer=jQuery("#min_insurance_price");if(insurance>0){$currentInsurancePriceContainer.children("span").html(insurance.toFixed(0)).end().show();$minInsurancePriceContainer.hide();jQuery('#details-insurance').show();jQuery('#details-insurance-price').html(insurance.toFixed(2)+" ");}else{if($currentInsurancePriceContainer.is(":visible")){$currentInsurancePriceContainer.hide();$minInsurancePriceContainer.show();}
jQuery('#details-insurance').hide();}
if(!isNaN(insurance)){total+=insurance;}
var parkingPrice=parseFloat(jQuery('#parking_price').val());var parkingPriceFormatted=jQuery('#parking_price').attr("data-price-formatted");var $currentParkingPriceContainer=jQuery("#current_parking_price");var $minParkingPriceContainer=jQuery("#min_parking_price");var $parkingSection=jQuery("li#parking_section");if(!isNaN(parkingPrice)){total+=parkingPrice;$parkingSection.find("a").addClass("spec").find("span.txt").show();$currentParkingPriceContainer.text(parkingPriceFormatted);$currentParkingPriceContainer.show();$minParkingPriceContainer.hide();jQuery('#details-parking').show();jQuery('#details-parking-price').html(parkingPrice.toFixed(2)+" ");}else{$parkingSection.find("a").removeClass("spec").find("span.txt").hide();if($currentParkingPriceContainer.is(":visible")){$currentParkingPriceContainer.hide();$minParkingPriceContainer.show();}
jQuery('#details-parking').hide();}
var $luggageSection=jQuery("li#luggage_section");var $currentLuggagePriceContainer=jQuery("#current_checked_luggage_price");var $minLuggagePriceContainer=jQuery("#min_checked_luggage_price");if(luggagePrice>0){$luggageSection.find("a").addClass("spec").find("span.txt").show();$currentLuggagePriceContainer.children("span").html(luggagePrice.toFixed(0)).end().show();$minLuggagePriceContainer.hide();jQuery('#details-baggages').show();jQuery('#details-baggages-price').html(parseFloat(luggagePrice).toFixed(2)+" ");}else{$luggageSection.find("a").removeClass("spec").find("span.txt").hide();if($currentLuggagePriceContainer.is(":visible")){$currentLuggagePriceContainer.hide();$minLuggagePriceContainer.show();}
jQuery('#details-baggages').hide();}
var $priorityBoardingSection=jQuery("li#priority_boarding_section");if(jQuery(":checkbox#priority_boarding").is(":checked")){$priorityBoardingSection.find("a").addClass("spec").find("span.txt").show();jQuery('#details-priority-boarding').show();jQuery('#details-priority-boarding-price').html(parseFloat(priorityBoardingPrice).toFixed(2)+" ");}else{$priorityBoardingSection.find("a").removeClass("spec").find("span.txt").hide();jQuery('#details-priority-boarding').hide();}
if(jQuery(":checkbox#priority_boarding").is(":checked")){total+=parseFloat(priorityBoardingPrice);}
if(services>0){jQuery('#details-services').show();jQuery('#details-services-price').html(parseFloat(services).toFixed(2)+" ");}else{jQuery('#details-services').hide();}
jQuery('#details-transaction').hide();if(loyalDiscount>0){jQuery('#loyal-discount, #loyal-discount-message').show();jQuery('#loyal-discount-code').hide();jQuery('#loyal-discount-price').text(parseFloat(loyalDiscount).toFixed(2));jQuery('#loyal-discount-message-price').text(parseFloat(loyalDiscount).toFixed(2));total-=Math.round(loyalDiscount);}else{jQuery('#loyal-discount').hide();}
var total3=total.toFixed(2);jQuery('#OrdersPrice').val(total3);if(showOvercharge){jQuery('#overcharge, #overcharge2').show();jQuery('#overcharge, #overcharge2').css('display','block');jQuery('#overcharge-price, #overcharge-price2').text(overcharge.toFixed(2));total+=overcharge;}else{jQuery('#overcharge','#overcharge2').show();}
if(moneyBackInsuranceAvailable){var flightTotal=flightPrice+luggagePrice+cabinLuggagePrice;if(jQuery(":checkbox#priority_boarding").is(":checked")){flightTotal+=priorityBoardingPrice;}
if(showOvercharge){flightTotal+=overcharge;}
var insuranceAmount=flightTotal*0.8;var insurancePrice=flightTotal*0.1;jQuery('.tg_cost').html(Math.ceil(insurancePrice));jQuery('.tg_cost2').html(insurancePrice.toFixed(2));jQuery('.tg_amount').html(insuranceAmount.toFixed(2));var $moneyBackSection=jQuery("li#money_back_section");if(jQuery('input#money_back_insurance').attr('checked')){total+=parseFloat(insurancePrice);$moneyBackSection.find("a").addClass("spec").find(".fl").find("span").hide().end().end().find("span.txt").show();jQuery('#details-cancellation-price').html(parseFloat(insurancePrice).toFixed(2));jQuery('#details-cancellation').show();}else{$moneyBackSection.find("a").removeClass("spec").find(".fl").find("span").show().end().end().find("span.txt").hide();jQuery('#details-cancellation').hide();}}
var pay_pal_tax=0;var totalWithPaymentFee=total;var totalNotCancelled=total;var paymentChecked=jQuery('.payment-radio:checked').val();jQuery('.help-text').addClass('dni');if(paymentChecked==67){jQuery('#help_text_paypal').removeClass('dni');}else{jQuery('#help_text_banks').removeClass('dni');}
if(paymentChecked&&jQuery.inArray(parseInt(paymentChecked),payments)){if(payments[parseInt(paymentChecked)]['Payments']['transaction_fee_percent']){pay_pal_tax=(total*payments[parseInt(paymentChecked)]['Payments']['transaction_fee_percent']).toFixed(2);jQuery('#paypal-tax, #paypal-tax2').show();jQuery('#paypal-tax2').css('display','block');jQuery('#paypal-tax-price, #paypal-tax-price2').text(pay_pal_tax+" ");jQuery('#OrdersPaymentTax').val(pay_pal_tax);totalWithPaymentFee+=(pay_pal_tax*1);total=totalWithPaymentFee;}else if(payments[parseInt(paymentChecked)]['Payments']['transaction_fee_absolute']){pay_pal_tax=(payments[parseInt(paymentChecked)]['Payments']['transaction_fee_absolute']).toFixed(2);jQuery('#paypal-tax, #paypal-tax2').show();jQuery('#paypal-tax2').css('display','block');jQuery('#paypal-tax-price, #paypal-tax-price2').text(pay_pal_tax+" ");jQuery('#OrdersPaymentTax').val(pay_pal_tax);totalWithPaymentFee+=(pay_pal_tax*1);total=totalWithPaymentFee;}else{jQuery('#paypal-tax, #paypal-tax2').hide();jQuery('#OrdersPaymentTax').val(0);}}
total=total.toFixed(2);if(typeof action==="object"&&typeof action.seTotalCost==="function"){action.setTotalCost(total);}
totalNotCancelled=totalNotCancelled.toFixed(2);jQuery('#details-price').html(total);jQuery('#details-price2').html(totalWithPaymentFee.toFixed(2));jQuery('#OrdersPrice').val(totalNotCancelled);if(typeof showAlternativePrice!='undefined'&&showAlternativePrice){var alternativePriceTotal=((total*alternativePriceCurrencyRate)*100)/100;jQuery('#alternative_price').text(Math.floor(alternativePriceTotal*Math.pow(10,2))/Math.pow(10,2));}
if(jQuery('#total_in_paypal_currency').length>0){var totalInPaypalCurrency=total*paypalCurrencyRate;jQuery('#total_in_paypal_currency').html(totalInPaypalCurrency.toFixed(2));}
Eturas.updateIframeHeight();};checkLoyalCode=function(code){jQuery.getJSON(checkLoyalCodeUrl+'/'+code+'/price:'+price+'/currencyid:'+currencyId,function(response){if(response.valid){loyalDiscount=response.data.sum;}else{alert(loyalCodeBadText);loyalDiscount=0;}
flights.order2.totalPrice();});}
flights.order2.submitOrder=function(){var plateNumber=jQuery(":checkbox.parking-type").filter(":checked").first().parent().find(".parking-plate-number-input").first().val();if(typeof plateNumber!=="undefined"&&plateNumber.length===0){alert(numberPlateValidationErrorMessage);return false;}
jQuery('#osubmit1').addClass('disabled').html(' ');jQuery('#osubmit2').addClass('disabled').html(' ');var btn=jQuery('#osubmit1')[0];var clicked=jQuery.data(btn,'clicked');if(clicked){return false;}else{jQuery.data(btn,'clicked',1);}
setTimeout(function(){jQuery('#OrdersOrder2Form').submit();},200);};}})(window);jQuery(document).ready(function(){if(jQuery('#OrdersOrder2Form').length){flights.order2.init();}});;(function($){if(typeof window.flights!=='undefined'){flights.order3=function(){};flights.order3.init=function(){if(jQuery('.order3-submit').length){jQuery('.order3-submit').on('click',function(e){e.preventDefault();flights.submitOrder('#OrdersOrder3Form');return false;});}
if(jQuery('.order3-openprint').length){jQuery('.order3-openprint').on('click',function(e){e.preventDefault();flights.order3.openPrint();return false;});}};flights.order3.openPrint=function(){jQuery('.loading-print').fadeIn();jQuery('#print_invoice').delay(200).fadeIn(400);};flights.order3.closePrint=function(){jQuery('#print_invoice').fadeOut();jQuery('#reservation_popup').fadeOut();jQuery('.loading-print').delay(200).fadeOut(400);};}})(window);jQuery(document).ready(function(){if(jQuery('#OrdersOrder3Form').length){flights.order3.init();}});