(function(n){n.fn.progressTimer=function(t){var i=n.extend({},n.fn.progressTimer.defaults,t);return this.each(function(){var r,t;n(this).empty();r=n("<div>").addClass("progress active progress-striped");t=n("<div>").addClass("progress-bar").addClass(i.baseStyle).attr("role","progressbar").attr("aria-valuenow","0").attr("aria-valuemin","0").attr("aria-valuemax",i.timeLimit);t.appendTo(r);r.appendTo(n(this));var f=new Date,u=i.timeLimit*1e3,e=window.setInterval(function(){var n=new Date-f;t.width(n/u*100+"%");u-n<=5e3&&t.removeClass(i.baseStyle).removeClass(i.completeStyle).addClass(i.warningStyle);n>=u&&(window.clearInterval(e),t.removeClass(i.baseStyle).removeClass(i.warningStyle).addClass(i.completeStyle),i.onFinish.call(this))},250)}),this};n.fn.progressTimer.defaults={timeLimit:60,warningThreshold:5,onFinish:function(){},baseStyle:"",warningStyle:"progress-bar-danger",completeStyle:"progress-bar-success"}})(jQuery);
function getArabicDay(n){return IsArabicPage!="true"?n:arabicDays[n]}function getEngDayFromArabic(n){return arabicDays.indexOf(n)}function getArabicShortMonthDp(n){return IsArabicPage!="true"?n:arbicShortMonts[englishShortMonts.indexOf(n)]}function getArabicShortMonthDpForSamplePage(n){return IsArabicPage!="true"?n:arbicShortMonts[englishShortMonts.indexOf(n)]}function getEnglishShortMonthDp(n){return IsArabicPage!="true"?n:englishShortMonts[arbicShortMonts.indexOf(n.trim())]}function getArabicYear(n){var i,r,t;if(IsArabicPage!="true")return n;for(n=n+"",i=n.split(""),r="",t=0;t<i.length;t++)r+=getArabicDay(i[t]);return r}function getEnglishYear(n){var i,t;if(IsArabicPage!="true")return n;for(i="",t=0;t<n.length;t++)i+=getEngDayFromArabic(n[t]);return i}function GetMonthIndex(n){switch(n){case 3:return 0;case 2:return 1;case 1:return 2;case 0:return 3;case 7:return 4;case 6:return 5;case 5:return 6;case 4:return 7;case 11:return 8;case 10:return 9;case 9:return 10;default:return 11}}var arabicDays=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩","١٠","١١","١٢","١٣","١٤","١٥","١٦","١٧","١٨","١٩","٢٠","٢١","٢٢","٢٣","٢٤","٢٥","٢٦","٢٧","٢٨","٢٩","٣٠","٣١"],arbicShortMonts=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],englishShortMonts=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];IsArabicPage!="true"&&(arabicDays=["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]),function(n){function r(){return new Date(Date.UTC.apply(Date,arguments))}function l(t,i){var u=n(t).data(),f={},e,o=new RegExp("^"+i.toLowerCase()+"([A-Z])"),i=new RegExp("^"+i.toLowerCase());for(var r in u)i.test(r)&&(e=r.replace(o,function(n,t){return t.toLowerCase()}),f[e]=u[r]);return f}function a(t){var u={},r;if(i[t]||(t=t.split("-")[0],i[t]))return r=i[t],n.each(c,function(n,t){t in r&&(u[t]=r[t])}),u}var o=n(window),u=function(i,r){var u=this;this._process_options(r);this.element=n(i);this.isInline=!1;this.isInput=this.element.is("input");this.component=this.element.is(".date")?this.element.find(".add-on, .btn"):!1;this.hasInput=this.component&&this.element.find("input").length;this.component&&this.component.length===0&&(this.component=!1);this.picker=n(t.template);this._buildEvents();this._attachEvents();this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu");this.o.rtl&&(this.picker.addClass("datepicker-rtl"),this.picker.find(".prev i, .next i").toggleClass("icon-arrow-left icon-arrow-right"));this.viewMode=this.o.startView;this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(n,t){return parseInt(t)+1});this._allow_update=!1;this.setStartDate(this._o.startDate);this.setEndDate(this._o.endDate);this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);this.fillDow();this.fillMonths();this._allow_update=!0;this.update();this.showMode();this.isInline&&this.show()},s,h,f,c,e,i,t;u.prototype={constructor:u,_process_options:function(r){var u,o,h,e,s;this._o=n.extend({},this._o,r);u=this.o=n.extend({},this._o);o=u.language;i[o]||(o=o.split("-")[0],i[o]||(o=f.language));u.language=o;switch(u.startView){case 2:case"decade":u.startView=2;break;case 1:case"year":u.startView=1;break;default:u.startView=0}switch(u.minViewMode){case 1:case"months":u.minViewMode=1;break;case 2:case"years":u.minViewMode=2;break;default:u.minViewMode=0}if(u.startView=Math.max(u.startView,u.minViewMode),u.weekStart%=7,u.weekEnd=(u.weekStart+6)%7,h=t.parseFormat(u.format),u.startDate!==-Infinity&&(u.startDate=u.startDate?u.startDate instanceof Date?this._local_to_utc(this._zero_time(u.startDate)):t.parseDate(u.startDate,h,u.language):-Infinity),u.endDate!==Infinity&&(u.endDate=u.endDate?u.endDate instanceof Date?this._local_to_utc(this._zero_time(u.endDate)):t.parseDate(u.endDate,h,u.language):Infinity),u.daysOfWeekDisabled=u.daysOfWeekDisabled||[],n.isArray(u.daysOfWeekDisabled)||(u.daysOfWeekDisabled=u.daysOfWeekDisabled.split(/[,\s]*/)),u.daysOfWeekDisabled=n.map(u.daysOfWeekDisabled,function(n){return parseInt(n,10)}),e=String(u.orientation).toLowerCase().split(/\s+/g),s=u.orientation.toLowerCase(),e=n.grep(e,function(n){return/^auto|left|right|top|bottom$/.test(n)}),u.orientation={x:"auto",y:"auto"},s&&s!=="auto")if(e.length===1)switch(e[0]){case"top":case"bottom":u.orientation.y=e[0];break;case"left":case"right":u.orientation.x=e[0]}else s=n.grep(e,function(n){return/^left|right$/.test(n)}),u.orientation.x=s[0]||"auto",s=n.grep(e,function(n){return/^top|bottom$/.test(n)}),u.orientation.y=s[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(n){for(var t=0,i,r;t<n.length;t++){i=n[t][0];r=n[t][1];i.on(r)}},_unapplyEvents:function(n){for(var t=0,i,r;t<n.length;t++)i=n[t][0],r=n[t][1],i.off(r)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:n.proxy(this.show,this),keyup:n.proxy(this.update,this),keydown:n.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:n.proxy(this.show,this),keyup:n.proxy(this.update,this),keydown:n.proxy(this.keydown,this)}],[this.component,{click:n.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:n.proxy(this.show,this)}]];this._secondaryEvents=[[this.picker,{click:n.proxy(this.click,this)}],[n(window),{resize:n.proxy(this.place,this)}],[n(document),{mousedown:n.proxy(function(n){this.element.is(n.target)||this.element.find(n.target).length||this.picker.is(n.target)||this.picker.find(n.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents();this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents();this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(i,r){var u=r||this.date,f=this._utc_to_local(u);this.element.trigger({type:i,date:f,format:n.proxy(function(n){var i=n||this.o.format;return t.formatDate(u,i,this.o.language)},this)})},show:function(n){this.isInline||this.picker.appendTo("body");this.picker.show();this.height=this.component?this.component.outerHeight():this.element.outerHeight();this.place();this._attachSecondaryEvents();n&&n.preventDefault();this._trigger("show")},hide:function(){this.isInline||this.picker.is(":visible")&&(this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},remove:function(){this.hide();this._detachEvents();this._detachSecondaryEvents();this.picker.remove();delete this.element.data().datepicker;this.isInput||delete this.element.data().date},_utc_to_local:function(n){return new Date(n.getTime()+n.getTimezoneOffset()*6e4)},_local_to_utc:function(n){return new Date(n.getTime()-n.getTimezoneOffset()*6e4)},_zero_time:function(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())},_zero_utc_time:function(n){return new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return this.date},setDate:function(n){this.setUTCDate(this._local_to_utc(n))},setUTCDate:function(n){this.date=n;this.setValue()},setValue:function(){var n=this.getFormattedDate();this.isInput?this.element.val(n).change():this.component&&this.element.find("input").val(n).change()},getFormattedDate:function(n){return n===undefined&&(n=this.o.format),t.formatDate(this.date,n,this.o.language)},setStartDate:function(n){this._process_options({startDate:n});this.update();this.updateNavArrows()},setEndDate:function(n){this._process_options({endDate:n});this.update();this.updateNavArrows()},setDaysOfWeekDisabled:function(n){this._process_options({daysOfWeekDisabled:n});this.update();this.updateNavArrows()},place:function(){var i,v,s;if(!this.isInline){var u=this.picker.outerWidth(),f=this.picker.outerHeight(),h=10,c=o.width(),y=o.height(),l=o.scrollTop(),p=parseInt(this.element.parents().filter(function(){return n(this).css("z-index")!="auto"}).first().css("z-index"))+999999,t=this.component?this.component.parent().offset():this.element.offset(),a=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),w=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),r=t.left,e=t.top;this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left");this.o.orientation.x!=="auto"?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(r-=u-w)):(this.picker.addClass("datepicker-orient-left"),t.left<0?r-=t.left-h:t.left+u>c&&(r=c-u-h));i=this.o.orientation.y;i==="auto"&&(v=-l+t.top-f,s=l+y-(t.top+a+f),i=Math.max(v,s)===s?"top":"bottom");this.picker.addClass("datepicker-orient-"+i);i==="top"?e+=a:e-=f+parseInt(this.picker.css("padding-top"));this.picker.css({top:e,left:r,zIndex:p})}},_allow_update:!0,update:function(){if(this._allow_update){var r=new Date(this.date),n,i=!1;arguments&&arguments.length&&(typeof arguments[0]=="string"||arguments[0]instanceof Date)?(n=arguments[0],n instanceof Date&&(n=this._local_to_utc(n)),i=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),delete this.element.data().date);this.date=t.parseDate(n,this.o.format,this.o.language);i?this.setValue():n?r.getTime()!==this.date.getTime()&&this._trigger("changeDate"):this._trigger("clearDate");this.date<this.o.startDate?(this.viewDate=new Date(this.o.startDate),this.date=new Date(this.o.startDate)):this.date>this.o.endDate?(this.viewDate=new Date(this.o.endDate),this.date=new Date(this.o.endDate)):(this.viewDate=new Date(this.date),this.date=new Date(this.date));this.fill()}},fillDow:function(){var r=this.o.weekStart,n="<tr>",t;for(this.o.calendarWeeks&&(t='<th class="cw">&nbsp;<\/th>',n+=t,this.picker.find(".datepicker-days thead tr:first-child").prepend(t));r<this.o.weekStart+7;)n+='<th class="dow">'+i[this.o.language].daysMin[r++%7]+"<\/th>";n+="<\/tr>";this.picker.find(".datepicker-days thead").append(n)},fillMonths:function(){for(var t="",r="",u="",n=0;n<12;)IsArabicPage!="true"?t+='<span class="month">'+i[this.o.language].monthsShort[n++]+"<\/span>":n>=0&&3>=n?t='<span class="month">'+getArabicShortMonthDp(i[this.o.language].monthsShort[n++])+"<\/span>"+t:n>=4&&7>=n?r='<span class="month">'+getArabicShortMonthDp(i[this.o.language].monthsShort[n++])+"<\/span>"+r:n>=8&&11>=n&&(u='<span class="month">'+getArabicShortMonthDp(i[this.o.language].monthsShort[n++])+"<\/span>"+u);this.picker.find(".datepicker-months td").html(t+r+u)},setRange:function(t){t&&t.length?this.range=n.map(t,function(n){return n.valueOf()}):delete this.range;this.fill()},getClassNames:function(t){var i=[],r=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),e=this.date.valueOf(),u=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()==r&&t.getUTCMonth()<f?i.push("old"):(t.getUTCFullYear()>r||t.getUTCFullYear()==r&&t.getUTCMonth()>f)&&i.push("new"),this.o.todayHighlight&&t.getUTCFullYear()==u.getFullYear()&&t.getUTCMonth()==u.getMonth()&&t.getUTCDate()==u.getDate()&&i.push("today"),e&&t.valueOf()==e&&i.push("active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||n.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&i.push("disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&i.push("range"),n.inArray(t.valueOf(),this.range)!=-1&&i.push("selected")),i},fill:function(){var d=new Date(this.viewDate),e=d.getUTCFullYear(),g=d.getUTCMonth(),y=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,nt=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,p=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,ut=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,et=this.date&&this.date.valueOf(),c,f,w,l,o,h,b,s,v,u,rt,a;for(this.picker.find(".datepicker-days thead th.datepicker-switch").html(i[this.o.language].months[g]+" "+getArabicYear(e)+(PageLanguage=="ar"?' &nbsp; <i class="fa fa-chevron-down" aria-hidden="true"><\/i>':"")),this.picker.find("tfoot th.today").text(i[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(i[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths(),f=r(e,g-1,28,0,0,0,0),w=t.getDaysInMonth(f.getUTCFullYear(),f.getUTCMonth()),f.setUTCDate(w),f.setUTCDate(w-(f.getUTCDay()-this.o.weekStart+7)%7),l=new Date(f),l.setUTCDate(l.getUTCDate()+42),l=l.valueOf(),o=[],b=0;f.valueOf()<l;){if(f.getUTCDay()==this.o.weekStart&&(o.push("<tr>"),this.o.calendarWeeks)){var tt=new Date(+f+(this.o.weekStart-f.getUTCDay()-7)%7*864e5),it=new Date(+tt+(11-tt.getUTCDay())%7*864e5),k=new Date(+(k=r(it.getUTCFullYear(),0,1))+(11-k.getUTCDay())%7*864e5),ft=(it-k)/6048e5+1;o.push('<td class="cw">'+ft+"<\/td>")}h=this.getClassNames(f);h.push("day");this.o.beforeShowDay!==n.noop&&(s=this.o.beforeShowDay(this._utc_to_local(f)),s===undefined?s={}:typeof s=="boolean"?s={enabled:s}:typeof s=="string"&&(s={classes:s}),s.enabled===!1&&h.push("disabled"),s.classes&&(h=h.concat(s.classes.split(/\s+/))),s.tooltip&&(c=s.tooltip));h=n.unique(h);IsArabicPage!="true"?o.push('<td class="'+h.join(" ")+'"'+(c?' title="'+c+'"':"")+">"+f.getUTCDate()+"<\/td>"):o[o.length-1].indexOf("tr>")>=0?(b=o.length,o.push('<td class="'+h.join(" ")+'"'+(c?' title="'+c+'"':"")+">"+getArabicDay(f.getUTCDate())+"<\/td>")):o.splice(b,0,'<td class="'+h.join(" ")+'"'+(c?' title="'+c+'"':"")+">"+getArabicDay(f.getUTCDate())+"<\/td>");f.getUTCDay()==this.o.weekEnd&&o.push("<\/tr>");f.setUTCDate(f.getUTCDate()+1)}if(this.picker.find(".datepicker-days tbody").empty().append(o.join("")),v=this.date&&this.date.getUTCFullYear(),u=this.picker.find(".datepicker-months").find("th:eq(1)").html(getArabicYear(e)+(PageLanguage=="en"?' <img src="https://images.rehlat.com/Content/images/arrow_down_Datepicker.png">':"")).end().find("span").removeClass("active"),v&&v==e&&(IsArabicPage=="true"?u.eq(GetMonthIndex(this.date.getUTCMonth())).addClass("active"):u.eq(this.date.getUTCMonth()).addClass("active")),(e<y||e>p)&&u.addClass("disabled"),e==y)if(IsArabicPage=="true")switch(nt){case 1:u.slice(3,4).addClass("disabled");break;case 2:u.slice(2,4).addClass("disabled");break;case 3:u.slice(1,4).addClass("disabled");break;case 4:u.slice(0,4).addClass("disabled");break;case 5:u.slice(0,4).addClass("disabled");u.slice(7,8).addClass("disabled");break;case 6:u.slice(0,4).addClass("disabled");u.slice(6,8).addClass("disabled");break;case 7:u.slice(0,4).addClass("disabled");u.slice(5,8).addClass("disabled");break;case 8:u.slice(0,8).addClass("disabled");break;case 9:u.slice(0,8).addClass("disabled");u.slice(11,12).addClass("disabled");break;case 10:u.slice(0,8).addClass("disabled");u.slice(10,12).addClass("disabled");break;case 11:u.slice(0,8).addClass("disabled");u.slice(9,12).addClass("disabled");break;case 12:u.slice(0,8).addClass("disabled");u.slice(8,12).addClass("disabled")}else u.slice(0,nt).addClass("disabled");for(e==p&&u.slice(ut+1).addClass("disabled"),o="",e=parseInt(e/10,10)*10,rt=this.picker.find(".datepicker-years").find("th:eq(1)").text(getArabicYear(e)+"-"+getArabicYear(e+9)).end().find("td"),e-=1,a=-1;a<11;a++)o+='<span class="year'+(a==-1?" old":a==10?" new":"")+(v==e?" active":"")+(e<y||e>p?" disabled":"")+'">'+getArabicYear(e)+"<\/span>",e+=1;rt.html(o)},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&n<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.o.endDate!==Infinity&&n>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&n<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.o.endDate!==Infinity&&n>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(i){var u,c,o,l,s,h,f,e;if(i.preventDefault(),u=n(i.target).closest("span, td, th"),u.length==1)switch(u[0].nodeName.toLowerCase()){case"th":switch(u[0].className){case"datepicker-switch":IsArabicPage=="true"?this.showMode(1):this.showMode(4);break;case"prev":case"next":c=t.modes[this.viewMode].navStep*(u[0].className=="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,c);this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,c);this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":o=new Date;o=r(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0);this.showMode(-2);l=this.o.todayBtn=="linked"?null:"view";this._setDate(o,l);break;case"clear":this.isInput?s=this.element:this.component&&(s=this.element.find("input"));s&&s.val("").change();this._trigger("changeDate");this.update();this.o.autoclose&&this.hide()}break;case"span":if(!u.is(".disabled")){if(this.viewDate.setUTCDate(1),u.is(".month"))h=1,f=0,f=IsArabicPage=="true"?GetMonthIndex(u.parent().find("span").index(u)):u.parent().find("span").index(u),e=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(f),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(r(e,f,h,0,0,0,0));else{var e=parseInt(getEnglishYear(u.text()),10)||0,h=1,f=0;this.viewDate.setUTCFullYear(e);this._trigger("changeYear",this.viewDate);this.o.minViewMode===2&&this._setDate(r(e,f,h,0,0,0,0))}this.showMode(-1);this.fill()}break;case"td":if(u.is(".day")&&!u.is(".disabled")){var h=parseInt(getEngDayFromArabic(u.text()),10)||1,e=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth();u.is(".old")?f===0?(f=11,e-=1):f-=1:u.is(".new")&&(f==11?(f=0,e+=1):f+=1);this._setDate(r(e,f,h,0,0,0,0))}}},_setDate:function(n,t){t&&t!="date"||(this.date=new Date(n));t&&t!="view"||(this.viewDate=new Date(n));this.fill();this.setValue();this._trigger("changeDate");var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input"));i&&i.change();this.o.autoclose&&(!t||t=="date")&&this.hide()},moveMonth:function(n,t){var f;if(!t)return n;var i=new Date(n.valueOf()),e=i.getUTCDate(),o=i.getUTCMonth(),s=Math.abs(t),r,u;if(t=t>0?1:-1,s==1)u=t==-1?function(){return i.getUTCMonth()==o}:function(){return i.getUTCMonth()!=r},r=o+t,i.setUTCMonth(r),(r<0||r>11)&&(r=(r+12)%12);else{for(f=0;f<s;f++)i=this.moveMonth(i,t);r=i.getUTCMonth();i.setUTCDate(e);u=function(){return r!=i.getUTCMonth()}}while(u())i.setUTCDate(--e),i.setUTCMonth(r);return i},moveYear:function(n,t){return this.moveMonth(n,t*12)},dateWithinRange:function(n){return n>=this.o.startDate&&n<=this.o.endDate},keydown:function(n){var u,t,i,r,f;if(this.picker.is(":not(:visible)")){n.keyCode==27&&this.show();return}u=!1;switch(n.keyCode){case 27:this.hide();n.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;t=n.keyCode==37?-1:1;n.ctrlKey?(i=this.moveYear(this.date,t),r=this.moveYear(this.viewDate,t),this._trigger("changeYear",this.viewDate)):n.shiftKey?(i=this.moveMonth(this.date,t),r=this.moveMonth(this.viewDate,t),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.date),i.setUTCDate(this.date.getUTCDate()+t),r=new Date(this.viewDate),r.setUTCDate(this.viewDate.getUTCDate()+t));this.dateWithinRange(i)&&(this.date=i,this.viewDate=r,this.setValue(),this.update(),n.preventDefault(),u=!0);break;case 38:case 40:if(!this.o.keyboardNavigation)break;t=n.keyCode==38?-1:1;n.ctrlKey?(i=this.moveYear(this.date,t),r=this.moveYear(this.viewDate,t),this._trigger("changeYear",this.viewDate)):n.shiftKey?(i=this.moveMonth(this.date,t),r=this.moveMonth(this.viewDate,t),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.date),i.setUTCDate(this.date.getUTCDate()+t*7),r=new Date(this.viewDate),r.setUTCDate(this.viewDate.getUTCDate()+t*7));this.dateWithinRange(i)&&(this.date=i,this.viewDate=r,this.setValue(),this.update(),n.preventDefault(),u=!0);break;case 13:this.hide();n.preventDefault();break;case 9:this.hide()}u&&(this._trigger("changeDate"),this.isInput?f=this.element:this.component&&(f=this.element.find("input")),f&&f.change())},showMode:function(n){n&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+n)));this.picker.find(">div").hide().filter(".datepicker-"+t.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()}};s=function(t,i){this.element=n(t);this.inputs=n.map(i.inputs,function(n){return n.jquery?n[0]:n});delete i.inputs;n(this.inputs).datepicker(i).bind("changeDate",n.proxy(this.dateUpdated,this));this.pickers=n.map(this.inputs,function(t){return n(t).data("datepicker")});this.updateDates()};s.prototype={updateDates:function(){this.dates=n.map(this.pickers,function(n){return n.date});this.updateRanges()},updateRanges:function(){var t=n.map(this.dates,function(n){return n.valueOf()});n.each(this.pickers,function(n,i){i.setRange(t)})},dateUpdated:function(t){var u=n(t.target).data("datepicker"),r=u.getUTCDate(),i=n.inArray(t.target,this.inputs),f=this.inputs.length;if(i!=-1){if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<f&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates()}},remove:function(){n.map(this.pickers,function(n){n.remove()});delete this.element.data().datepicker}};h=n.fn.datepicker;n.fn.datepicker=function(t){var r=Array.apply(null,arguments),i;return r.shift(),this.each(function(){var o=n(this),e=o.data("datepicker"),c=typeof t=="object"&&t,y;if(!e){var v=l(this,"date"),p=n.extend({},f,v,c),w=a(p.language),h=n.extend({},f,w,v,c);o.is(".input-daterange")||h.inputs?(y={inputs:h.inputs||o.find("input").toArray()},o.data("datepicker",e=new s(this,n.extend(h,y)))):o.data("datepicker",e=new u(this,h))}if(typeof t=="string"&&typeof e[t]=="function"&&(i=e[t].apply(e,r),i!==undefined))return!1}),i!==undefined?i:this};f=n.fn.datepicker.defaults={autoclose:!1,beforeShowDay:n.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,orientation:"right",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0};c=n.fn.datepicker.locale_opts=["format","rtl","weekStart"];n.fn.datepicker.Constructor=u;PageLanguage=="en"?i=n.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}}:(e=["السبت","الجمعة","الخميس","الأربعاء","الثلاثاء","الاثنين","الأحد"],i=n.fn.datepicker.dates={en:{days:e,daysShort:e,daysMin:e,months:["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"هذا اليوم",clear:"Clear"}});t={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(n){return n%4==0&&n%100!=0||n%400==0},getDaysInMonth:function(n,i){return[31,t.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][i]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(n){var t=n.replace(this.validParts,'\0').split('\0'),i=n.match(this.validParts);if(!t||!t.length||!i||i.length===0)throw new Error("Invalid date format.");return{separators:t,parts:i}},parseDate:function(f,e,o){var g,h,a,v,l,nt,s,k,p;if(f instanceof Date)return f;if(typeof e=="string"&&(e=t.parseFormat(e)),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(f)){for(g=/([\-+]\d+)([dmwy])/,h=f.match(/([\-+]\d+)([dmwy])/g),f=new Date,s=0;s<h.length;s++){a=g.exec(h[s]);v=parseInt(a[1]);switch(a[2]){case"d":f.setUTCDate(f.getUTCDate()+v);break;case"m":f=u.prototype.moveMonth.call(u.prototype,f,v);break;case"w":f.setUTCDate(f.getUTCDate()+v*7);break;case"y":f=u.prototype.moveYear.call(u.prototype,f,v)}}return r(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate(),0,0,0)}var h=f&&f.match(this.nonpunctuation)||[],f=new Date,w={},d=["yyyy","yy","M","MM","m","mm","d","dd"],c={yyyy:function(n,t){return n.setUTCFullYear(t)},yy:function(n,t){return n.setUTCFullYear(2e3+t)},m:function(n,t){if(isNaN(n))return n;for(t-=1;t<0;)t+=12;for(t%=12,n.setUTCMonth(t);n.getUTCMonth()!=t;)n.setUTCDate(n.getUTCDate()-1);return n},d:function(n,t){return n.setUTCDate(t)}},y,b,a;if(c.M=c.MM=c.mm=c.m,c.dd=c.d,f=r(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0),l=e.parts.slice(),h.length!=l.length&&(l=n(l).filter(function(t,i){return n.inArray(i,d)!==-1}).toArray()),h.length==l.length){for(s=0,nt=l.length;s<nt;s++){if(y=parseInt(h[s],10),a=l[s],isNaN(y))switch(a){case"MM":b=n(i[o].months).filter(function(){var n=this.slice(0,h[s].length),t=h[s].slice(0,n.length);return n==t});y=n.inArray(b[0],i[o].months)+1;break;case"M":b=n(i[o].monthsShort).filter(function(){var n=this.slice(0,h[s].length),t=h[s].slice(0,n.length);return n==t});y=n.inArray(b[0],i[o].monthsShort)+1}w[a]=y}for(s=0;s<d.length;s++)p=d[s],p in w&&!isNaN(w[p])&&(k=new Date(f),c[p](k,w[p]),isNaN(k)||(f=k))}return f},formatDate:function(r,u,f){var e,r,s,o,h;for(typeof u=="string"&&(u=t.parseFormat(u)),e={d:r.getUTCDate(),D:i[f].daysShort[r.getUTCDay()],DD:i[f].days[r.getUTCDay()],m:r.getUTCMonth()+1,M:i[f].monthsShort[r.getUTCMonth()],MM:i[f].months[r.getUTCMonth()],yy:r.getUTCFullYear().toString().substring(2),yyyy:r.getUTCFullYear()},e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m,r=[],s=n.extend([],u.separators),o=0,h=u.parts.length;o<=h;o++)s.length&&r.push(s.shift()),r.push(e[u.parts[o]]);return r.join("")},headTemplate:'<thead><tr><th class="next"><i class="fa fa-chevron-left" aria-hidden="true"><\/i><\/th><th colspan="5" class="datepicker-switch"><i class="fa fa-chevron-down" aria-hidden="true"><\/i><\/th><th class="prev"><i class="fa fa-chevron-right" aria-hidden="true"><\/i><\/th><\/tr><\/thead>',contTemplate:'<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"><\/th><\/tr><tr><th colspan="7" class="clear"><\/th><\/tr><\/tfoot>'};t.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+t.headTemplate+"<tbody><\/tbody>"+t.footTemplate+'<\/table><\/div><div class="datepicker-months"><table class="table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datepicker-years"><table class="table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+"<\/table><\/div><\/div>";n.fn.datepicker.DPGlobal=t;n.fn.datepicker.noConflict=function(){return n.fn.datepicker=h,this};n(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var i=n(this);i.data("datepicker")||(t.preventDefault(),i.datepicker("show"))});n(function(){n('[data-provide="datepicker-inline"]').datepicker()})}(window.jQuery);
app.controller("IndexController",["$scope",function(n){n.RoomCount=1;n.rooms=[{id:0,childCount:0},{id:1,childCount:0},{id:2,childCount:0},{id:3,childCount:0},{id:4,childCount:0}]}]);
function CheckisHotelDataCahanged(){if(hotelRecords.length==0)$("#cityname1").val("");else{if(!isHotelDataSelected){$("#cityname1").val(hotelRecords[0].Name);var n=hotelRecords[0].Code.split(","),i=n[0],t="";n.length>1&&(t=n[1]);hotelRecords[0].Source==="Localities"&&$("#hdnIslocality").val(!0);$("#hdnLocalityName").val(hotelRecords[0].Name);$("#hdnCityCode").val(i);$("#hdnHotelCode").val(t);$("#hdnCityName").val(hotelRecords[0].CityName);$("#hdnCountryName").val(hotelRecords[0].CountryName);$("#hdnsrctype").val(hotelRecords[0].Source)}isHotelDataSelected=!1;hotelRecords=[]}}function returningDate(){$("#FlyingTo").removeAttr("style");$("#FlyingTo").css("cursor","pointer");$("#radio-1-1").removeClass("active");$("#radio-1-2").addClass("active");checkradio("radio-1-2")}function flyFrom(){setTimeout(function(){doFocus("#Flyingfrom11");$("#dCity").click();$("#Flyingfrom11").focus();$("#Flyingfrom11").get(0).setSelectionRange(0,0);setTimeout(function(){doFocus("#Flyingfrom11");$("#dCity").click();$("#FlyingFromMobile").blur()}.bind(this),500);doFocus("#Flyingfrom11")}.bind(this),500)}function flyTo(){setTimeout(function(){doFocus("#Flyingto11");$("#aCity").click();$("#Flyingto11").focus();$("#Flyingto11").get(0).setSelectionRange(0,0);setTimeout(function(){doFocus("#Flyingto11");$("#aCity").click();$("#FlyingToMobile").blur()}.bind(this),500);doFocus("#Flyingto11")}.bind(this),500)}function doFocus(n){$(n).focus()}function checkradio(n){n=="radio-1-1"?($("#OneRoundTripDiv").show(),$("#multicityDiv").hide(),$("#hdnTripType").val("OneWay"),$("#radio-1-3").removeClass("active"),$("#radio-1-2").removeClass("active"),$("#radio-1-1").addClass("active")):n=="radio-1-2"?(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|firefox/i.test(navigator.userAgent)||($("#FlyingFrom").attr("placeholder","المغادرة"),$("#FlyingTo").attr("placeholder","العودة")),$("#Flyingfrom1").val()!=""&&$("#Flyingto1").val()!=""&&$("#FlyingFrom").val()!=""&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|firefox/i.test(navigator.userAgent)||$("#FlyingTo").focus()),$("#hdnTripType").val("RoundTrip"),$("#OneRoundTripDiv").show(),$("#multicityDiv").hide(),$("#radio-1-1").removeClass("active"),$("#radio-1-3").removeClass("active"),$("#radio-1-2").addClass("active")):n=="radio-1-3"&&($("#hdnTripType").val("MultiCity"),$("#OneRoundTripDiv").hide(),$("#multicityDiv").show(),$("#radio-1-1").removeClass("active"),$("#radio-1-2").removeClass("active"),$("#radio-1-3").addClass("active"))}function minusAdult(){var n=$("#inDeValueAdult").val(),t;if(n=parseInt(n),n==1)return!1;n=n-1;$("#inDeValueAdult").val(n);$("#inDeValueAdult").text(englishToArabicNumber(n));$("#hdnAdults").val(n);t=parseInt($("#inDeValueInfant").val());t>n&&minusInfant()}function plusAdult(){var t=$("#inDeValueAdult").val(),i=$("#inDeValueChild").val(),r=$("#inDeValueInfant").val(),n=parseInt(t),u=parseInt(i),f=parseInt(r);if((value=n+u+f,n==9)||value>=9)return!1;n=n+1;$("#inDeValueAdult").val(n);$("#inDeValueAdult").text(englishToArabicNumber(n));$("#hdnAdults").val(n)}function minusChild(){var n=$("#inDeValueChild").val();if(n=parseInt(n),n==0)return!1;n=n-1;$("#inDeValueChild").val(n);$("#inDeValueChild").text(englishToArabicNumber(n));$("#hdnChildren").val(n)}function plusChild(){var t=$("#inDeValueAdult").val(),i=$("#inDeValueChild").val(),r=$("#inDeValueInfant").val(),u=parseInt(t),n=parseInt(i),f=parseInt(r);if((value=u+n+f,n==8)||value>=9||(add=parseInt(i)+parseInt(t),add>=9))return!1;n=n+1;$("#inDeValueChild").val(n);$("#inDeValueChild").text(englishToArabicNumber(n));$("#hdnChildren").val(n)}function minusInfant(){var n=$("#inDeValueInfant").val();if(n=parseInt(n),n==0)return!1;n=n-1;$("#inDeValueInfant").val(n);$("#inDeValueInfant").text(englishToArabicNumber(n));$("#hdnInfant").val(n)}function plusInfant(){var i=$("#inDeValueAdult").val(),r=$("#inDeValueChild").val(),u=$("#inDeValueInfant").val(),t=parseInt(i),f=parseInt(r),n=parseInt(u);if((value=t+f+n,n==9)||value>=9||value>=9||n>=t)return!1;n=n+1;$("#inDeValueInfant").val(n);$("#inDeValueInfant").text(englishToArabicNumber(n));$("#hdnInfant").val(n)}function minusAdultForMulti(){var n=$("#inDeValueAdultForMulti").val(),t;if(n=parseInt(n),n==1)return!1;n=n-1;$("#inDeValueAdultForMulti").val(n);$("#inDeValueAdultForMulti").text(englishToArabicNumber(n));$("#hdnAdultsForMulti").val(n);t=parseInt($("#inDeValueInfantForMulti").val());t>n&&minusInfantForMulti()}function plusAdultForMulti(){var t=$("#inDeValueAdultForMulti").val(),i=$("#inDeValueChildForMulti").val(),r=$("#inDeValueInfantForMulti").val(),n=parseInt(t),u=parseInt(i),f=parseInt(r);if((value=n+u+f,n==9)||value>=9)return!1;n=n+1;$("#inDeValueAdultForMulti").val(n);$("#inDeValueAdultForMulti").text(englishToArabicNumber(n));$("#hdnAdultsForMulti").val(n)}function minusChildForMulti(){var n=$("#inDeValueChildForMulti").val();if(n=parseInt(n),n==0)return!1;n=n-1;$("#inDeValueChildForMulti").val(n);$("#inDeValueChildForMulti").text(englishToArabicNumber(n));$("#hdnChildrenForMulti").val(n)}function plusChildForMulti(){var t=$("#inDeValueAdultForMulti").val(),i=$("#inDeValueChildForMulti").val(),r=$("#inDeValueInfantForMulti").val(),u=parseInt(t),n=parseInt(i),f=parseInt(r);if((value=u+n+f,n==8)||value>=9||(add=parseInt(i)+parseInt(t),add>=9))return!1;n=n+1;$("#inDeValueChildForMulti").val(n);$("#inDeValueChildForMulti").text(englishToArabicNumber(n));$("#hdnChildrenForMulti").val(n)}function minusInfantForMulti(){var n=$("#inDeValueInfantForMulti").val();if(n=parseInt(n),n==0)return!1;n=n-1;$("#inDeValueInfantForMulti").val(n);$("#inDeValueInfantForMulti").text(englishToArabicNumber(n));$("#hdnInfantForMulti").val(n)}function plusInfantForMulti(){var i=$("#inDeValueAdultForMulti").val(),r=$("#inDeValueChildForMulti").val(),u=$("#inDeValueInfantForMulti").val(),t=parseInt(i),f=parseInt(r),n=parseInt(u);if((value=t+f+n,n==9)||value>=9||n>=t)return!1;n=n+1;$("#inDeValueInfantForMulti").val(n);$("#inDeValueInfantForMulti").text(englishToArabicNumber(n));$("#hdnInfantForMulti").val(n)}function setClass(n){$("#hdnClass").val(n)}function setMultiCityClass(n){$("#hdnClassmulti").val(n);n=="Y"?($("#economyMulticity").addClass("active"),$("#businessMulticity").removeClass("active"),$("#firstMulticity").removeClass("active")):n=="C"?($("#economyMulticity").removeClass("active"),$("#businessMulticity").addClass("active"),$("#firstMulticity").removeClass("active")):n=="F"&&($("#economyMulticity").removeClass("active"),$("#businessMulticity").removeClass("active"),$("#firstMulticity").addClass("active"))}function SetHotelCookiesData(){var n=JSON.parse($.cookie("HotelSearchData_Arb")),r,t,i;for($("#cityname1").val(n.LocalityName),r=new Date,r<=Date.parse(n.CheckInDate)&&($("#CheckInDatePicker").val(n.CinDate),$("#CheckOutDatePicker").val(n.CoutDate)),$("#hdnCityCode").val(n.City),$("#hdnHotelCode").val(n.HotelCode),$("#hdnCountryName").val(n.CountryName),$("#hdnCountry").val(n.Country),$("#hdnIslocality").val(n.IsLocality),n.SourceType=="Hotels"?$("#hdnLocalityName").val(n.HotelName):$("#hdnLocalityName").val(n.CityName),$("#hdnsrctype").val(n.SourceType),n.SourceType=="Countries"?$("#hdnCityName").val(n.CountryName):n.SourceType=="Cities"?$("#hdnCityName").val(n.CityName):n.SourceType=="Localities"?$("#hdnCityName").val(n.CityName):n.SourceType=="Hotels"&&$("#hdnCityName").val(n.CityName),t=1;t<=n.RoomCount;t++)for(t!=n.RoomCount&&addNewRoom(),$("#Room"+t+"Adult").text(englishToArabicNumber(n.Rooms[t-1].Adults)),$("#Room"+t+"Adult").val(n.Rooms[t-1].Adults),$("#hdnRoom"+t+"Adult").val(n.Rooms[t-1].Adults),$("#Room"+t+"Child").val(n.Rooms[t-1].Children),$("#Room"+t+"Child").text(englishToArabicNumber(n.Rooms[t-1].Children)),$("#hdnRoom"+t+"Child").val(n.Rooms[t-1].Children),i=1;i<=n.Rooms[t-1].Children;i++)plusChildHotelCookies("Room"+t+"Child",t,i),$("#Room"+t+"Child"+i+"Age").text(englishToArabicNumber(n.Rooms[t-1].ChildrenAges[i-1])),$("#Room"+t+"Child"+i+"Age").val(n.Rooms[t-1].ChildrenAges[i-1]),$("#hdnRoom"+t+"Child"+i+"Age").val(n.Rooms[t-1].ChildrenAges[i-1])}function checkHotelValidation(){var n=$("#cityname1").val(),t=$("#CheckInDatePicker").val(),i=$("#CheckOutDatePicker").val();return n==""||t==""||i==""?!1:!0}function SelectFlightOrHotel(n,t){n=="1"?window.location.href=t=="EG"?"/ar/flights/":"/ar/cheap-flights/":n=="2"?window.location.href=t=="EG"?"/ar/hotels/":"/ar/cheap-hotels/":n=="3"?($("#flights").show(),$("#Hotels").hide()):n=="4"&&($("#flights").hide(),$("#Hotels").show())}function addUrlRef(){var n=$("#hdnUrlReferrer").val();$.get("/home/SetUrlRefSession?url="+n,function(){})}function addMulticity(){for(var t,i,r,u,n=1;n<=5;n++)if(t=$("#multicity"+n).val(),t=="InActive"){$("#multicity"+n).val("Active");i=$("#MultiFlyingto"+(n-1)).val();r=$("#MultiFlyingto"+(n-1).toString()+(n-1).toString()).val();$("#MultiFlyingfrom"+n).val(i);$("#MultiFlyingfrom"+n.toString()+n.toString()).val(r);$("#MultiFlyingto"+n).focus();$("#MultiFlyingfrom"+n).attr("required","required");$("#MultiFlyingto"+n).attr("required","required");$("#MultiFlyingDeptDate"+n).attr("required","required");$("#multPAD"+n).show();n==3&&$("#multicity"+(n+1)).val()=="Active"&&$("#multicity"+(n+2)).val()=="Active"&&$("#addMultiCity").hide();n==4&&(u=$("#multicity"+(n+1)).val(),u=="Active"&&$("#addMultiCity").hide());n==5&&$("#addMultiCity").hide();break}}function removemulticity(n){var t=$("#multicity"+n).val();$("#multicity"+n).val("InActive");$("#MultiFlyingfrom"+n).val("");$("#MultiFlyingfrom"+n+n).val("");$("#MultiFlyingto"+n+n).val("");$("#MultiFlyingto"+n).val("");$("#MultiFlyingDeptDate"+n).val("");$("#MultiFlyingfrom"+n).removeAttr("required","required");$("#MultiFlyingto"+n).removeAttr("required","required");$("#MultiFlyingDeptDate"+n).removeAttr("required","required");$("#multPAD"+n).hide();$("#addMultiCity").show()}function minusAdultHotel(n){var t=$("#"+n).val();if(t=parseInt(t),t==1)return!1;t=t-1;$("#"+n).val(t);$("#"+n).text(englishToArabicNumber(t));$("#hdn"+n).val(t)}function plusAdultHotel(n){var t=$("#"+n).val();if(t=parseInt(t),t==4)return!1;t=t+1;$("#"+n).val(t);$("#"+n).text(englishToArabicNumber(t));$("#hdn"+n).val(t)}function minusChildAgeHotel(n){var t=$("#"+n).val();if(t=parseInt(t),t==0)return!1;t=t-1;$("#"+n).val(t);$("#"+n).text(englishToArabicNumber(t));$("#hdn"+n).val(t)}function plusChildAgeHotel(n){var t=$("#"+n).val();if(t=parseInt(t),t==17)return!1;t=t+1;$("#"+n).val(t);$("#"+n).text(englishToArabicNumber(t));$("#hdn"+n).val(t)}function minusChildHotel(n,t){var i=$("#"+n).val(),r;if(i=parseInt(i),r=t-1,i==0)return!1;i=i-1;$("#"+n).val(i);$("#"+n).text(englishToArabicNumber(i));$("#hdn"+n).val(i);i==0?($("#divRoom"+t+"Child1Age").html(""),$("#divRoom"+t+"Child2Age").html("")):i==1&&($("#divRoom"+t+"Child1Age").is(":empty")&&$("#divRoom"+t+"Child1Age").html('<label for="inputCity" class="control-label EN">الطفل عمر ١ <\/label>                                        <div class="segmentControl unselectable">                                             <a class="decrement" onclick="minusChildAgeHotel(\'Room'+t+'Child1Age\');">–<\/a>                                             <button type="button" class="incDecCount incDecBtn EN"  id="Room'+t+'Child1Age" value="0">٠<\/button>                                             <a class="increment"  onclick="plusChildAgeHotel(\'Room'+t+'Child1Age\');">+<\/a>                                             <input type="hidden" name="Rooms['+r+'].ChildrenAges[0]" value="0" id="hdnRoom'+t+'Child1Age">                                         <\/div>'),$("#divRoom"+t+"Child2Age").html(""))}function plusChildHotelCookies(n,t,i){var r=i-1;r=r+1;$("#"+n).val(r);$("#"+n).text(englishToArabicNumber(r));$("#hdn"+n).val(r);var u=t-1,f=englishToArabicNumber("0"),e=englishToArabicNumber("1"),o=englishToArabicNumber("2");r==1?($("#divRoom"+t+"Child1Age").is(":empty")&&$("#divRoom"+t+"Child1Age").html('<label for="inputCity" class="control-label EN"> عمر الطفل ('+e+') <\/label>                                        <div class="segmentControl unselectable">                                             <a class="decrement" onclick="minusChildAgeHotel(\'Room'+t+'Child1Age\');">–<\/a>                                             <button type="button" class="incDecCount incDecBtn EN"  id="Room'+t+'Child1Age" value="0">'+f+'<\/button>                                             <a class="increment"  onclick="plusChildAgeHotel(\'Room'+t+'Child1Age\');">+<\/a>                                             <input type="hidden" name="Rooms['+u+'].ChildrenAges[0]" value="0" id="hdnRoom'+t+'Child1Age">                                         <\/div>'),$("#divRoom"+t+"Child2Age").html("")):($("#divRoom"+t+"Child1Age").show(),$("#divRoom"+t+"Child2Age").is(":empty")&&$("#divRoom"+t+"Child2Age").html('<label for="inputCity" class="control-label EN"> عمر الطفل ('+o+')  <\/label>                                        <div class="segmentControl unselectable">                                              <a class="decrement" onclick="minusChildAgeHotel(\'Room'+t+'Child2Age\');">–<\/a>                                               <button type="button" class="incDecCount incDecBtn EN"  id="Room'+t+'Child2Age" value="0">'+f+'<\/button>                                             <a class="increment"  onclick="plusChildAgeHotel(\'Room'+t+'Child2Age\');">+<\/a>                                              <input type="hidden" name="Rooms['+u+'].ChildrenAges[1]" value="0" id="hdnRoom'+t+'Child2Age">                                          <\/div>'))}function plusChildHotel(n,t){var i=$("#"+n).val();if(i=parseInt(i),i==2)return!1;i=i+1;$("#"+n).val(i);$("#"+n).text(englishToArabicNumber(i));$("#hdn"+n).val(i);var r=t-1,u=englishToArabicNumber("0"),f=englishToArabicNumber("1"),e=englishToArabicNumber("2");i==1?($("#divRoom"+t+"Child1Age").is(":empty")&&$("#divRoom"+t+"Child1Age").html('<label for="inputCity" class="control-label EN" style="font-size:11px !important;"> عمر الطفل ('+f+') <\/label>                                        <div class="segmentControl unselectable">                                             <a class="decrement" onclick="minusChildAgeHotel(\'Room'+t+'Child1Age\');">–<\/a>                                             <button type="button" class="incDecCount incDecBtn EN"  id="Room'+t+'Child1Age" value="0">'+u+'<\/button>                                             <a class="increment"  onclick="plusChildAgeHotel(\'Room'+t+'Child1Age\');">+<\/a>                                             <input type="hidden" name="Rooms['+r+'].ChildrenAges[0]" value="0" id="hdnRoom'+t+'Child1Age">                                         <\/div>'),$("#divRoom"+t+"Child2Age").html("")):($("#divRoom"+t+"Child1Age").show(),$("#divRoom"+t+"Child2Age").is(":empty")&&$("#divRoom"+t+"Child2Age").html('<label for="inputCity" class="control-label EN" style="font-size:11px !important;"> عمر الطفل ('+e+')  <\/label>                                        <div class="segmentControl unselectable">                                              <a class="decrement" onclick="minusChildAgeHotel(\'Room'+t+'Child2Age\');">–<\/a>                                               <button type="button" class="incDecCount incDecBtn EN"  id="Room'+t+'Child2Age" value="0">'+u+'<\/button>                                             <a class="increment"  onclick="plusChildAgeHotel(\'Room'+t+'Child2Age\');">+<\/a>                                              <input type="hidden" name="Rooms['+r+'].ChildrenAges[1]" value="0" id="hdnRoom'+t+'Child2Age">                                          <\/div>'))}function addNewRoom(){var n=$(".dynamicRooms").length+1,t=n-1,i,e;$("#hdnRoom").val(n);$("#ancheRemoveRoom").show();var r=englishToArabicNumber(n),u=englishToArabicString("+17"),o=englishToArabicNumber("0"),f='<div class="row myformRow dynamicRooms" style="padding-bottom: 15px; margin-left:15px;">                        <div class="form-horizontal">                            <div class="col-sm-2" style="max-width: 54px; padding:0">                                <div class="form-group">                                    <label for="inputCity" class="control-label col-xs-3 hidden-xs">&nbsp;<\/label>                                    <div class="col-xs-12 EN" style="color: #ADADAD; text-align: left; margin-top: 8px;">غرفة '+r+':   <\/div>                                <\/div>                            <\/div>                            <div class="col-sm-2 col-xs-4 myplr10 forMob-widthInp">                                <label for="inputCity" class="control-label" style="font-size:11px !important;">البالغين <span class="ageGroup EN" style="font-size:10px;color:#ADADAD!important;"> ('+u+')<\/span><\/label>                                <div class="segmentControl unselectable">                                    <a class="decrement" onclick="minusAdultHotel(\'Room'+n+'Adult\');">–<\/a>                                    <button type="button" class="incDecCount incDecBtn EN" id="Room'+n+'Adult" value="1">'+englishToArabicNumber("1")+'<\/button>                                    <a class="increment" onclick="plusAdultHotel(\'Room'+n+'Adult\');">+<\/a>                                    <input type="hidden" name="Rooms['+t+'].Adults" value="1" id="hdnRoom'+n+'Adult">                                <\/div>                            <\/div>                            <div class="col-sm-2 col-xs-4 myplr10 forMob-widthInp" >                                <label for="inputCity" class="control-label" style="font-size:11px !important;">الأطفال <span class="ageGroup EN" style="font-size:10px;!important; color:#ADADAD!important;">('+englishToArabicString("0-17")+')<\/span><\/label>                                <div class="segmentControl unselectable">                                    <a class="decrement" onclick="minusChildHotel(\'Room'+n+"Child',"+n+');">–<\/a>                                    <button type="button" class="incDecCount incDecBtn EN"  id="Room'+n+'Child" value="0">'+englishToArabicNumber("0")+'<\/button>                                    <a class="increment"  onclick="plusChildHotel(\'Room'+n+"Child',"+n+');">+<\/a>                                    <input type="hidden" name="Rooms['+t+'].Children" value="0" id="hdnRoom'+n+'Child">                                <\/div>                            <\/div>                            <div  id="divRoom'+n+'Child1Age" class="col-sm-2 col-xs-4 myplr10 forMob-widthInp"><\/div>                            <div id="divRoom'+n+'Child2Age" class="col-sm-2 col-xs-4 myplr10 forMob-widthInp"><\/div>                        <\/div>                    <\/div>';$("#dymanicRoomsDiv").append(f);n>=5&&$("#ancheAddRoom").hide();i=$("#hdnRoom").val();e=parseInt(i)}function removeRoom(){var n=$(".dynamicRooms").length-1,t;$("#hdnRoom").val(n);$("#dymanicRoomsDiv").find(".dynamicRooms").last().remove();n==1&&$("#ancheRemoveRoom").hide();n<=5&&$("#ancheAddRoom").show();t=$("#hdnRoom").val();parseInt(t-1)}var hotelRecords=[],isHotelDataSelected=!1,Flyingfrom11mob="",Flyingto11mob="";$("#signUp_new").on("hidden.bs.modal",function(){isValidOTP=!1;$(".login_Window").show();$(".signUp_window").hide();$("#lblMyAccountErrorMsghome").text("");$("#divResetPasswordhome").hide();$("#divLoginhome").show()});$("#signUp_new").on("hidden.bs.modal",function(){isValidOTP=!1;$("#divloginChangePassword").show();$("#register-form").hide();$("#lblMyAccountErrorMsghome").text("");$("#divResetPasswordhome").hide();$("#divLoginhome").show()});$("#anchrMobLogin").on("hidden.bs.modal",function(){isValidOTP=!1;$("#MWeblblMyAccountErrorMsg").text("");$("#MWebChangePasswordAndLogin").hide();$("#MWebLogin").show()});$("#signUp1").on("hidden.bs.modal",function(){isValidOTP=!1;$("#login-form-walet").show();$("#register-form-walet").hide();$("#lblMyAccountErrorMsgpnrpax").text("");$("#divResetPasswordpnrpax").hide();$("#divLoginpnrpax").show()});$(function(){var o,c,e,u,a,s,h,n,v,i,t,f,r;if($("#liTabHotel").hasClass("active")&&$.cookie("HotelSearchData_Arb")!=undefined&&SetHotelCookiesData(),$("#radio-1-2").addClass("active"),$("#radio-1-3").removeClass("active"),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))if($(window).width()>=768)localStorage.getItem("flyingFrom_Arb")!=null&&localStorage.getItem("flyingTo_Arb")!=null?($("#Flyingfrom1").val(localStorage.getItem("flyingFrom_Arb")),$("#Flyingfrom").val(localStorage.getItem("flyingFromAirPortCode_Arb")),$("#FlyingFromCityNameText").val(localStorage.getItem("flyingFromCityNameText_Arb")),$("#FlyingFromCityName").val(localStorage.getItem("flyingFromCityName_Arb")),$("#Flyingto1").val(localStorage.getItem("flyingTo_Arb")),$("#Flyingto").val(localStorage.getItem("flyingToAirPortCode_Arb")),$("#FlyingToCityNameText").val(localStorage.getItem("flyingToCityNameText_Arb")),$("#FlyingToCityName").val(localStorage.getItem("flyingToCityName_Arb")),$("#FlyingFrom").val(localStorage.getItem("depatureDate_Arb")),localStorage.getItem("returnDate_Arb")==null||localStorage.getItem("returnDate_Arb")==""?($("#radio-1-1").addClass("active"),$("#radio-1-2").removeClass("active"),$("#hdnTripType").val("OneWay"),$("#FlyingTo").css("opacity","0.5")):(r=new Date(localStorage.getItem("depatureDate_Arb")),o=new Date(r.getFullYear()+1,r.getMonth()),$("#FlyingTo").datepicker("setStartDate",r),$("#FlyingTo").datepicker("setEndDate",o),$("#FlyingTo").val(localStorage.getItem("returnDate_Arb"))),localStorage.getItem("classType_Arb")=="E"?($("#economy").addClass("active"),$("#business").removeClass("active"),$("#first").removeClass("active"),$("#hdnClass").val("Y")):localStorage.getItem("classType_Arb")=="B"?($("#economy").removeClass("active"),$("#business").addClass("active"),$("#first").removeClass("active"),$("#hdnClass").val("C")):localStorage.getItem("classType_Arb")=="F"&&($("#economy").removeClass("active"),$("#business").removeClass("active"),$("#first").addClass("active"),$("#hdnClass").val("F")),$("#hdnAdults").val(localStorage.getItem("adultCount_Arb")),$("#inDeValueAdult").text(englishToArabicNumber(localStorage.getItem("adultCount_Arb"))),$("#inDeValueAdult").val(localStorage.getItem("adultCount_Arb")),$("#hdnChildren").val(localStorage.getItem("childcount_Arb")),$("#inDeValueChild").text(englishToArabicNumber(localStorage.getItem("childcount_Arb"))),$("#inDeValueChild").val(localStorage.getItem("childcount_Arb")),$("#hdnInfant").val(localStorage.getItem("infantCount_Arb")),$("#inDeValueInfant").text(englishToArabicNumber(localStorage.getItem("infantCount_Arb"))),$("#inDeValueInfant").val(localStorage.getItem("infantCount_Arb"))):$("#radio-1-2").addClass("active");else if(localStorage.getItem("Flyingfrom11Mobile_Arb")!=null){if(u=new Date,u.setDate(u.getDate()-1),$("#Flyingfrom11").val(localStorage.getItem("Flyingfrom11Mobile_Arb")),$("#Flyingfrom0").val(localStorage.getItem("Flyingfrom0Mobile_Arb2")),$("#FlyingFromCityNameText0").val(localStorage.getItem("FlyingFromCityNameText0Mobile_Arb")),$("#FlyingFromCityName0").val(localStorage.getItem("FlyingFromCityName0Mobile_Arb")),$("#FlyingFromMobile").val(localStorage.getItem("FlyingFromMobile_Arb")),$("#from_city_headFrom").text(localStorage.getItem("from_city_headFromMobile_Arb")),$("#pickCity").text(localStorage.getItem("pickCityMobile_Arb")),$("#Flyingto11").val(localStorage.getItem("Flyingto11Mobile_Arb")),$("#Flyingto0").val(localStorage.getItem("Flyingto0Mobile_Arb2")),$("#FlyingToCityNameText0").val(localStorage.getItem("FlyingToCityNameText0Mobile_Arb")),$("#FlyingToCityName0").val(localStorage.getItem("FlyingToCityName0Mobile_Arb")),$("#FlyingToMobile").val(localStorage.getItem("FlyingToMobile_Arb")),$("#from_city_headTo").text(localStorage.getItem("from_city_headToMobile_Arb")),$("#pickCityA").text(localStorage.getItem("pickCityAMobile_Arb")),Flyingfrom11mob=localStorage.getItem("Flyingfrom0Mobile"),Flyingto11mob=localStorage.getItem("Flyingto0Mobile"),e=localStorage.getItem("depatureDateMobile_Arb"),e==null||e.indexOf("NaN")>=0||e==""?localStorage.setItem("depatureDateMobile_Arb",""):localStorage.getItem("depatureDateMobile_Arb")!=null&&localStorage.getItem("depatureDateMobile_Arb")!=""&&(f=new Date(localStorage.getItem("depatureDateMobile_Arb")),f>u&&($("#FlyingFrom").val(localStorage.getItem("depatureDateMobile_Arb")),c=new Date(localStorage.getItem("depatureDateMobile_Arb")),$("#FlyingFrom").datepicker("update",c),$("#FlyingTo").datepicker("setStartDate",f))),localStorage.getItem("returnDateMobile_Arb")==null||localStorage.getItem("returnDateMobile_Arb")=="")$("#radio-1-1").addClass("active"),$("#radio-1-2").removeClass("active"),$("#hdnTripType").val("OneWay"),$("#FlyingTo").css("opacity","0.5");else{if(localStorage.getItem("returnDateMobile_Arb")!=null&&localStorage.getItem("returnDateMobile_Arb")!="")if(e=localStorage.getItem("depatureDateMobile_Arb"),e.indexOf("NaN")>=0||e=="")localStorage.setItem("depatureDateMobile_Arb","");else{var r=new Date(localStorage.getItem("depatureDateMobile_Arb")),o=new Date(r.getFullYear()+1,r.getMonth()),l=new Date(localStorage.getItem("returnDateMobile_Arb"));r>u&&l>=r&&($("#FlyingTo").datepicker("setStartDate",r),s=new Date(localStorage.getItem("returnDateMobile_Arb")),$("#FlyingTo").datepicker("setEndDate",s),$("#FlyingTo").datepicker("setEndDate",o))}$("#radio-1-1").removeClass("active");$("#radio-1-2").addClass("active");$("#FlyingTo").val(localStorage.getItem("returnDateMobile_Arb"))}localStorage.getItem("classType_Arb")=="E"?($("#economy").addClass("active"),$("#business").removeClass("active"),$("#first").removeClass("active"),$("#hdnClass").val("Y")):localStorage.getItem("classType_Arb")=="B"?($("#economy").removeClass("active"),$("#business").addClass("active"),$("#first").removeClass("active"),$("#hdnClass").val("C")):localStorage.getItem("classType_Arb")=="F"&&($("#economy").removeClass("active"),$("#business").removeClass("active"),$("#first").addClass("active"),$("#hdnClass").val("F"));localStorage.getItem("adultCountMobile_Arb")!=null&&localStorage.getItem("adultCountMobile_Arb")!=""&&$("#hdnAdults").val(localStorage.getItem("adultCountMobile_Arb"));localStorage.getItem("childcountMobile_Arb")!=null&&localStorage.getItem("childcountMobile_Arb")!=""&&$("#hdnChildren").val(localStorage.getItem("childcountMobile_Arb"));localStorage.getItem("infantCountMobile_Arb")!=null&&localStorage.getItem("infantCountMobile_Arb")!=""&&$("#hdnInfant").val(localStorage.getItem("infantCountMobile_Arb"));localStorage.getItem("adultCountMobile_Arb")!=null&&localStorage.getItem("adultCountMobile_Arb")!=""&&($("#inDeValueAdult").val(localStorage.getItem("adultCountMobile_Arb")),$("#inDeValueAdult").text(englishToArabicNumber(localStorage.getItem("adultCountMobile_Arb"))));localStorage.getItem("childcountMobile_Arb")!=null&&localStorage.getItem("childcountMobile_Arb")!=""&&($("#inDeValueChild").text(englishToArabicNumber(localStorage.getItem("childcountMobile_Arb"))),$("#inDeValueChild").val(localStorage.getItem("childcountMobile_Arb")));localStorage.getItem("childcountMobile_Arb")!=null&&localStorage.getItem("childcountMobile_Arb")!=""&&($("#inDeValueInfant").text(englishToArabicNumber(localStorage.getItem("infantCountMobile_Arb"))),$("#inDeValueInfant").val(localStorage.getItem("infantCountMobile_Arb")))}else $("#radio-1-2").addClass("active"),$("#pickCity").text("إختر مدينة"),$("#pickCityA").text("إختر مدينة");else if(localStorage.getItem("flyingFrom_Arb")!=null&&localStorage.getItem("flyingTo_Arb")!=null){if(u=new Date,u.setDate(u.getDate()-1),$("#Flyingfrom1").val(localStorage.getItem("flyingFrom_Arb")),$("#Flyingfrom").val(localStorage.getItem("flyingFromAirPortCode_Arb")),$("#FlyingFromCityNameText").val(localStorage.getItem("flyingFromCityNameText_Arb")),$("#FlyingFromCityName").val(localStorage.getItem("flyingFromCityName_Arb")),$("#Flyingto1").val(localStorage.getItem("flyingTo_Arb")),$("#Flyingto").val(localStorage.getItem("flyingToAirPortCode_Arb")),$("#FlyingToCityNameText").val(localStorage.getItem("flyingToCityNameText_Arb")),$("#FlyingToCityName").val(localStorage.getItem("flyingToCityName_Arb")),localStorage.getItem("depatureDate_Arb")!=null&&localStorage.getItem("depatureDate_Arb")!=""&&(localStorage.getItem("depatureDate_Arb").indexOf("NaN")>=0?localStorage.setItem("depatureDate_Arb",""):(f=new Date(localStorage.getItem("depatureDate_Arb")),f>u&&($("#FlyingFrom").val(localStorage.getItem("depatureDate_Arb")),a=new Date(localStorage.getItem("depatureDate_Arb")),$("#FlyingFrom").datepicker("update",a),$("#FlyingTo").datepicker("setStartDate",f)))),localStorage.getItem("returnDate_Arb")==null||localStorage.getItem("returnDate_Arb")=="")$("#radio-1-1").addClass("active"),$("#radio-1-2").removeClass("active"),$("#hdnTripType").val("OneWay"),$("#FlyingTo").css("opacity","0.5");else if(localStorage.getItem("returnDate_Arb")!=null&&localStorage.getItem("returnDate_Arb")!=""){var r=new Date(localStorage.getItem("depatureDate_Arb")),o=new Date(r.getFullYear()+1,r.getMonth()),l=new Date(localStorage.getItem("returnDate_Arb"));r>u&&l>=r&&($("#FlyingTo").datepicker("setStartDate",r),$("#FlyingTo").datepicker("setEndDate",o),$("#FlyingTo").val(localStorage.getItem("returnDate_Arb")),s=new Date(localStorage.getItem("returnDate_Arb")),$("#FlyingTo").datepicker("setEndDate",s),$("#FlyingTo").datepicker("setEndDate",o))}localStorage.getItem("adultCount_Arb")!=null&&localStorage.getItem("adultCount_Arb")!=""&&localStorage.getItem("adultCount_Arb")!="undefined"&&($("#hdnAdults").val(localStorage.getItem("adultCount_Arb")),$("#inDeValueAdult").text(englishToArabicNumber(localStorage.getItem("adultCount_Arb"))),$("#inDeValueAdult").val(localStorage.getItem("adultCount_Arb")));localStorage.getItem("childcount_Arb")!=null&&localStorage.getItem("childcount_Arb")!=""!=""&&localStorage.getItem("childcount_Arb")!="undefined"&&($("#hdnChildren").val(localStorage.getItem("childcount_Arb")),$("#inDeValueChild").text(englishToArabicNumber(localStorage.getItem("childcount_Arb"))),$("#inDeValueChild").val(localStorage.getItem("childcount_Arb")));localStorage.getItem("infantCount_Arb")!=null&&localStorage.getItem("infantCount_Arb")!=""&&localStorage.getItem("infantCount_Arb")!="undefined"&&($("#hdnInfant").val(localStorage.getItem("infantCount_Arb")),$("#inDeValueInfant").text(englishToArabicNumber(localStorage.getItem("infantCount_Arb"))),$("#inDeValueInfant").val(localStorage.getItem("infantCount_Arb")))}else $("#radio-1-2").addClass("active");if(h=$.cookie("TripTypear"),h!=undefined&&h!=null&&h=="multicity"&&$("#radio-1-3").click(),$("#btnFlightSearch").click(function(){var n;if($(".checkValidCode").each(function(){var r=$(this).val(),n=r.match(/\((.*)\)/),i,t;if(n!=null||n!=undefined){if(n[1].length==3||(i=n[0].match(/\((.*)\)/),i[1].indexOf("جمهورية مقدونيا اليوغوسلافية السابقة")!==-1))return!0;$(this).val("");t=$(this).attr("id");CheckValidationCodeForOneTwoMultiCity(t)}else $(this).val(""),t=$(this).attr("id"),CheckValidationCodeForOneTwoMultiCity(t)}),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|firefox/i.test(navigator.userAgent))if($(window).width()>=768)localStorage.setItem("flyingFrom_Arb",$("#Flyingfrom1").val()),localStorage.setItem("flyingFromAirPortCode_Arb",$("#Flyingfrom").val()),localStorage.setItem("flyingFromCityNameText_Arb",$("#FlyingFromCityNameText").val()),localStorage.setItem("flyingFromCityName_Arb",$("#FlyingFromCityName").val()),localStorage.setItem("flyingTo_Arb",$("#Flyingto1").val()),localStorage.setItem("flyingToAirPortCode_Arb",$("#Flyingto").val()),localStorage.setItem("flyingToCityNameText_Arb",$("#FlyingToCityNameText").val()),localStorage.setItem("flyingToCityName_Arb",$("#FlyingToCityName").val()),localStorage.setItem("depatureDate_Arb",$("#FlyingFrom").val()),localStorage.setItem("returnDate_Arb",$("#FlyingTo").val()),localStorage.setItem("adultCount_Arb",$("#hdnAdults").val()),localStorage.setItem("childcount_Arb",$("#hdnChildren").val()),localStorage.setItem("infantCount_Arb",$("#hdnInfant").val()),$("#economy").hasClass("active")?localStorage.setItem("classType_Arb","E"):$("#business").hasClass("active")?localStorage.setItem("classType_Arb","B"):$("#first").hasClass("active")&&localStorage.setItem("classType_Arb","F");else{if($("#Flyingfrom0").val(Flyingfrom11mob),$("#Flyingto0").val(Flyingto11mob),localStorage.setItem("Flyingfrom11Mobile_Arb",$("#Flyingfrom11").val()),localStorage.setItem("Flyingfrom0Mobile_Arb",$("#Flyingfrom0").val()),localStorage.setItem("Flyingfrom0Mobile_Arb2",$("#Flyingfrom0").val()),localStorage.setItem("FlyingFromCityNameText0Mobile_Arb",$("#FlyingFromCityNameText0").val()),localStorage.setItem("FlyingFromCityName0Mobile_Arb",$("#FlyingFromCityName0").val()),localStorage.setItem("FlyingFromMobile_Arb",$("#FlyingFromMobile").val()),localStorage.setItem("from_city_headFromMobile_Arb",$("#from_city_headFrom").text()),localStorage.setItem("pickCityMobile_Arb",$("#pickCity").text()),localStorage.setItem("Flyingto11Mobile_Arb",$("#Flyingto11").val()),localStorage.setItem("Flyingto0Mobile_Arb",$("#Flyingto0").val()),localStorage.setItem("Flyingto0Mobile_Arb2",$("#Flyingto0").val()),localStorage.setItem("FlyingToCityNameText0Mobile_Arb",$("#FlyingToCityNameText0").val()),localStorage.setItem("FlyingToCityName0Mobile_Arb",$("#FlyingToCityName0").val()),localStorage.setItem("FlyingToMobile_Arb",$("#FlyingToMobile").val()),localStorage.setItem("from_city_headToMobile_Arb",$("#from_city_headTo").text()),localStorage.setItem("pickCityAMobile_Arb",$("#pickCityA").text()),localStorage.setItem("depatureDateMobile_Arb",$("#FlyingFrom").val()),localStorage.setItem("returnDateMobile_Arb",$("#FlyingTo").val()),localStorage.setItem("adultCountMobile_Arb",$("#hdnAdults").val()),localStorage.setItem("childcountMobile_Arb",$("#hdnChildren").val()),localStorage.setItem("infantCountMobile_Arb",$("#hdnInfant").val()),$("#economy").hasClass("active")?localStorage.setItem("classType_Arb","E"):$("#business").hasClass("active")?localStorage.setItem("classType_Arb","B"):$("#first").hasClass("active")&&localStorage.setItem("classType_Arb","F"),$("#FlyingFromMobile").val()=="")return n=!1,$("#FlyingFromMobile").click(),$("#Flyingfrom11").val(""),!1;if($("#FlyingToMobile").val()=="")return n=!1,$("#FlyingToMobile").click(),$("#Flyingto11").val(""),!1}else localStorage.setItem("flyingFrom_Arb",$("#Flyingfrom1").val()),localStorage.setItem("flyingFromAirPortCode_Arb",$("#Flyingfrom").val()),localStorage.setItem("flyingFromCityNameText_Arb",$("#FlyingFromCityNameText").val()),localStorage.setItem("flyingFromCityName_Arb",$("#FlyingFromCityName").val()),localStorage.setItem("flyingTo_Arb",$("#Flyingto1").val()),localStorage.setItem("flyingToAirPortCode_Arb",$("#Flyingto").val()),localStorage.setItem("flyingToCityNameText_Arb",$("#FlyingToCityNameText").val()),localStorage.setItem("flyingToCityName_Arb",$("#FlyingToCityName").val()),localStorage.setItem("depatureDate_Arb",$("#FlyingFrom").val()),localStorage.setItem("returnDate_Arb",$("#FlyingTo").val()),localStorage.setItem("adultCount_Arb",$("#hdnAdults").val()),localStorage.setItem("childcount_Arb",$("#hdnChildren").val()),localStorage.setItem("infantCount_Arb",$("#hdnInfant").val());$("#flightFormPartial").submit()}),$("#flightFormPartial").submit(function(){var n,t,o,s,l,h,c,i,r,f,u,e;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|firefox/i.test(navigator.userAgent)){if($(window).width()>=768){if(n=$("#Flyingfrom1").val(),t=$("#Flyingto1").val(),n==t&&n!=""&&t!="")return $("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show(),$("#Flyingto1").val(""),$("#Flyingto1").focus(),!1;if(n==""||t=="")return!1;if(n!=""&&t!=""){if($("#FlyingFrom").val()=="")return o=!1,$("#FlyingFrom").focus(),!1;if($("#radio-1-2").hasClass("active")&&$("#FlyingTo").val()=="")return o=!1,$("#FlyingTo").focus(),!1}}else if(n=$("#FlyingFromMobile").val(),t=$("#FlyingToMobile").val(),n==t&&n!=""&&t!="")return $("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show(),$("#Flyingto1").val(""),$("#Flyingto1").focus(),!1}else{if(n=$("#Flyingfrom1").val(),t=$("#Flyingto1").val(),n==t&&n!=""&&t!="")return $("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show(),$("#Flyingto1").val(""),$("#Flyingto1").focus(),!1;if(n==""||t=="")return!1;if(n!=""&&t!=""){if($("#FlyingFrom").val()=="")return o=!1,$("#FlyingFrom").focus(),!1;if($("#radio-1-2").hasClass("active")&&$("#FlyingTo").val()=="")return o=!1,$("#FlyingTo").focus(),!1}}if(s=$("#FlyingFromCityName0").val(),l="",typeof s=="undefined"){if($("#PreferredAirline1").val()==""&&$("#PreferredAirline").val(""),h=$.trim($("#Flyingfrom1").val()),c=$.trim($("#Flyingto1").val()),h.length<3&&$("#Flyingfrom").val(""),c.length<3&&$("#Flyingto").val(""),$("#Flyingfrom").val()=="")return $("#popup_message").text("يرجى تحديد مدينة المغادرة/المطار ساري المفعول"),$("#Flyingfrom1").val(""),$("#popup_container").show(function(){$(this).remove("slow")}),!1;if($("#Flyingto").val()=="")return $("#popup_message").text("يرجى تحديد مدينة المقصودة/المطار ساري المفعول"),$("#popup_container").show(function(){$(this).remove("slow")}),!1;i=$("#FlyingFromCityName").val();i=$.trim(i).toLowerCase().replace(/ /g,"-");r=$("#FlyingToCityName").val();r=$.trim(r).toLowerCase().replace(/ /g,"-");f=$("input[name=TripType]").val().toLowerCase();u="";$("#PreferredAirline1").val()!=""&&$("#PreferredAirline").val()!=""&&(e=$("#PreferredAirline1").val(),e=$.trim($("#PreferredAirline1").val()).toLowerCase().replace(/\(.*?\)/g,""),u=e.trim().toLowerCase().replace(/ /g,"-"),u=u+"-"+$("#PreferredAirline").val().trim().toLowerCase());$("#flightFormPartial").attr("action","/ar/cheap-flights/search/"+i+"-to-"+r+"/"+$("#Flyingfrom").val().toLowerCase()+"-"+$("#Flyingto").val().toLowerCase()+"/"+f+"/"+(u==""?"":u+"/"))}else{if(f=$("input[name=TripType]").val().toLowerCase(),$("#FlyingFrom").val()=="")return $("#FlyingFrom").focus(),!1;if(f=="roundtrip"&&$("#FlyingTo").val()=="")return $("#FlyingTo").focus(),!1;if(i=$("#FlyingFromCityName0").val(),i=$.trim(i).toLowerCase().replace(/ /g,"-"),r=$("#FlyingToCityName0").val(),r=$.trim(r).toLowerCase().replace(/ /g,"-"),$(window).width()>=768)i=$("#FlyingFromCityName").val(),i=$.trim(i).toLowerCase().replace(/ /g,"-"),r=$("#FlyingToCityName").val(),r=$.trim(r).toLowerCase().replace(/ /g,"-"),f=$("input[name=TripType]").val().toLowerCase(),u="",$("#PreferredAirline1").val()!=""&&$("#PreferredAirline").val()!=""&&(e=$("#PreferredAirline1").val(),e=$.trim($("#PreferredAirline1").val()).toLowerCase().replace(/\(.*?\)/g,""),u=e.trim().toLowerCase().replace(/ /g,"-"),u=u+"-"+$("#PreferredAirline").val().trim().toLowerCase()),$("#flightFormPartial").attr("action","/ar/cheap-flights/search/"+i+"-to-"+r+"/"+$("#Flyingfrom").val().toLowerCase()+"-"+$("#Flyingto").val().toLowerCase()+"/"+f+"/"+(u==""?"":u+"/"));else{if(i.length<3&&$("#FlyingFromMobile").val(""),r.length<3&&$("#FlyingToMobile").val(""),$("#Flyingfrom0").val()=="")return $("#popup_message").text("يرجى تحديد مدينة المغادرة/المطار ساري المفعول"),$("#Flyingfrom11").val(""),$("#FlyingFromMobile").val(""),$("#popup_container").show(function(){$(this).remove("slow")}),!1;if($("#Flyingto0").val()=="")return $("#popup_message").text("يرجى تحديد مدينة المقصودة/المطار ساري المفعول"),$("#Flyingto11").val(""),$("#FlyingToMobile").val(""),$("#popup_container").show(function(){$(this).remove("slow")}),!1;$("#flightFormPartial").attr("action","/ar/cheap-flights/search/"+i+"-to-"+r+"/"+$("#Flyingfrom0").val().toLowerCase()+"-"+$("#Flyingto0").val().toLowerCase()+"/"+f+"/")}}return!0}),$("#FlyingFromMobile").click(function(){$("#dCity").click()}),$("#FlyingToMobile").click(function(){$("#aCity").click()}),$("#FlyingTo").css("cursor","pointer"),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|firefox/i.test(navigator.userAgent)){$("#FlyingFrom").attr("placeholder","من");$("#FlyingTo").attr("placeholder","إلى");$("#myModal_fromDesti").on("hidden.bs.modal",function(){$("#Flyingto11").val()==""?($("#from_city_headTo").text(" "),$("#FlyingToMobile").attr("placeholder","إلى").val("").focus().blur()):$("#FlyingToMobile").blur();$("#Flyingfrom11").val()==""?($("#from_city_headFrom").text(" "),$("#FlyingFromMobile").attr("placeholder","من").val("").focus().blur()):$("#FlyingFromMobile").blur()})}$("#dCity").click(function(){$("#FlyToDiv").hide();$("#FlyFromDiv").show();$("#aCity").removeClass("MwebFlyTabActive");$("#dCity").addClass("MwebFlyTabActive");setTimeout(function(){$("#Flyingfrom11").focus()},500)});$("#aCity").click(function(){$("#FlyFromDiv").hide();$("#FlyToDiv").show();$("#dCity").removeClass("MwebFlyTabActive");$("#aCity").addClass("MwebFlyTabActive");setTimeout(function(){$("#Flyingto11").focus()},500)});$("#economy").click(function(){$("#business").removeClass("active");$("#first").removeClass("active");$("#economy").addClass("active")});$("#business").click(function(){$("#business").addClass("active");$("#first").removeClass("active");$("#economy").removeClass("active")});$("#first").click(function(){$("#business").removeClass("active");$("#first").addClass("active");$("#economy").removeClass("active")});$("#arrowRotateM").on("click",function(){if($("#FlyingFromMobile").val()==""&&$("#FlyingToMobile").val()=="")alert("There is no city to shuffle");else{var i=$("#FlyingFromMobile").val(),n=$("#from_city_headFrom").text(),r=$("#Flyingfrom11").val(),u=$("#Flyingfrom0").val(),f=$("#FlyingToMobile").val(),t=$("#from_city_headTo").text(),e=$("#Flyingto11").val(),o=$("#Flyingto0").val();$("#arrowRotateImgM").toggleClass("shuffleImage");$("#arrowRotateImgM").toggleClass("shuffleImageNormal");$("#FlyingFromMobile").val(f);$("#from_city_headFrom").text(t);$("#pickCity").text(t);$("#Flyingfrom11").val(e);$("#Flyingfrom0").val(o);$("#FlyingToMobile").val(i);$("#from_city_headTo").text(n);$("#pickCityA").text(n);$("#Flyingto11").val(r);$("#Flyingto0").val(u);Flyingfrom11mob=$("#Flyingfrom0").val();Flyingto11mob=$("#Flyingto0").val()}});$("#arrowRotateD").on("click",function(){if($("#Flyingfrom1").val()==""&&$("#Flyingto1").val()=="")return $("#Flyingfrom1").focus(),!1;var n=$("#Flyingfrom1").val(),t=$("#Flyingfrom").val(),i=$("#FlyingFromCityName").val(),r=$("#Flyingto1").val(),u=$("#Flyingto").val(),f=$("#FlyingToCityName").val();$("#arrowRotateImgD").toggleClass("shuffleImage");$("#arrowRotateImgD").toggleClass("shuffleImageNormal");$("#Flyingfrom1").val(r);$("#Flyingfrom").val(u);$("#Flyingto1").val(n);$("#Flyingto").val(t);$("#FlyingFromCityName").val(f);$("#FlyingToCityName").val(i)});$("#cityname1").val()==""&&$("#CheckInDatePicker").val()==""&&$("#CheckOutDatePicker").val()==""&&$("#popup_ok").click(function(){var n=$("#cityname1").val(),t=$("#CheckInDatePicker").val(),i=$("#CheckOutDatePicker").val();n!=""?t!=""?i!=""?$("#room-count").focus():$("#CheckOutDatePicker").focus():$("#CheckInDatePicker").focus():$("#cityname1").focus();$("#popup_container").hide()});$("#FlyingTo").keydown(function(n){n.stopPropagation();var r=$("#Flyingfrom1").val(),u=$("#Flyingto1").val(),f=$("#FlyingFrom").val(),t=$("#FlyingTo").val(),i=n.keyCode;if(i==13)return t==""?(n.preventDefault(),$("#popup_message").text("Please select the Returning Date."),$("#popup_container").show(),!1):!1});$("#dealsEmail").keyup(function(){var n=$("#dealsEmail").val();validateEmail(n)?$("#dealsEmail").css("border-color","#CCC"):($("#dealsEmail").focus(),$("#dealsEmail").css("border-color","red"))});$("#Flyingfrom1").focus();$("#Flyingfrom1").val()==""&&$("#Flyingto1").val()==""&&$("#FlyingFrom").val()==""&&$("#FlyingTo").val()==""&&$("#popup_ok").click(function(){var n=$("#Flyingfrom1").val(),t=$("#Flyingto1").val(),i=$("#FlyingFrom").val(),r=$("#FlyingTo").val(),u=$("#hdnTripType").val();n!=""?t!=""?(r==""&&u!="OneWay"&&$("#FlyingTo").focus(),i==""&&$("#FlyingFrom").focus()):$("#Flyingto1").focus():$("#Flyingfrom1").focus()});$("#Flyingfrom1").val()!=""&&$("#Flyingto1").val()==""&&$("#popup_ok").click(function(){$("#Flyingto1").focus()});$("#radio-1-1").click(function(){$("#FlyingToDiv").show();$("#FlyingTo").val("");$("#FlyingTo").css("opacity","0.5");$("#FlyingTo").css("opacity","0.5")});$("#radio-1-2").click(function(){$("#FlyingTo").css("cursor","pointer")});$("#PreferredAirline1").autocomplete({source:function(n,t){$.ajax({url:"/Home/LodaAirlinesName",type:"POST",dataType:"json",data:{term:n.term,code:$("#hdnUrl").val()},success:function(n){t($.map(n,function(n){return{id:n.id,value:n.text}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(n,t){$("#PreferredAirline").val(t.item.id)},minLength:2});$("#cityname1").catcompletehotelAr({source:function(n,t){$("#cityname").val("");$.ajax({url:"/Home/LoadHotels",type:"POST",dataType:"json",data:{term:n.term,url:"/ar/"},success:function(n){if(n.length==0){if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){var n={};n.Name="Test";t($.map(n,function(){return{name:"لا توجد أي نتيجة",source:"No Result Found",value:"No Result Found"}}))}}else hotelRecords=n,t($.map(n,function(n){return{name:n.Name,nameen:n.NameEn,sourcename:n.SourceName,value:n.Name,hotelcount:n.HotelCount,source:n.Source,code:n.Code,cityName:n.CityName,country:n.Country,countryName:n.CountryName}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(n,t){isHotelDataSelected=!0;var i=t.item.code.split(","),u=i[0],r="";i.length>1&&(r=i[1]);t.item.source==="Localities"&&$("#hdnIslocality").val(!0);t.item.source==="Hotels"?$("#hdnLocalityName").val(t.item.nameen):$("#hdnLocalityName").val(t.item.name);$("#hdnCityCode").val(u);$("#hdnHotelCode").val(r);$("#hdnCityName").val(t.item.cityName);$("#hdnCountry").val(t.item.country);$("#hdnCountryName").val(t.item.countryName);$("#hdnsrctype").val(t.item.source);/webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?$("#CheckInDatePicker").focus():/Android/i.test(navigator.userAgent)||$("#CheckInDatePicker").focus()},minLength:3});$("#CheckInDatePicker").change(function(){/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|firefox/i.test(navigator.userAgent)||$("#CheckOutDatePicker").focus()});$("#CheckInDatePicker").keydown(function(n){n.stopPropagation();var u=$("#cityname1").val(),t=$("#CheckInDatePicker").val(),i=$("#CheckOutDatePicker").val(),r=n.keyCode;if(r==13)return t==""?(n.preventDefault(),$("#popup_message").text("Please select the CheckIn Date...!"),$("#popup_container").show(),!1):(i==" "&&alert("FlyingTo Date is missing"),!1)});$("#CheckOutDatePicker").keydown(function(n){n.stopPropagation();var r=$("#cityname1").val(),u=$("#CheckInDatePicker").val(),t=$("#CheckOutDatePicker").val(),i=n.keyCode;if(i==13)return t==""?(n.preventDefault(),$("#popup_message").text("Please select the CheckOut Date...!"),$("#popup_container").show(),!1):!1});n=[];$("#Flyingfrom1").catcomplete({source:function(t,i){n=[];$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,cityEn:n.CityName_En,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(n,t){$("#Flyingfrom1").val(t.item.value);$("#Flyingfrom").val(t.item.id);$("#FlyingFromCityNameText").val(t.item.value);domain=="EG"?$("#FlyingFromCityName").val(t.item.city):$("#FlyingFromCityName").val(t.item.city);$("#Flyingto1").focus()},minLength:3});$("#FlyingFrom").keydown(function(n){n.stopPropagation();var u=$("#Flyingfrom1").val(),f=$("#Flyingto1").val(),t=$("#FlyingFrom").val(),i=$("#FlyingTo").val(),r=n.keyCode;if(r==13)return t==""?(n.preventDefault(),$("#popup_message").text("الرجاء تحديد تاريخ المغادرة"),$("#popup_container").show(),!1):(i==" "&&alert("تحلق إلى تاريخ مفقود"),!1)});$("#Flyingfrom11").catcomplete({source:function(t,i){n=[];$("#Flyingfrom0").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(n,t){var r,u,i,f,e;$("#Flyingfrom11").val(t.item.value);$("#Flyingfrom0").val(t.item.id);Flyingfrom11mob=$("#Flyingfrom0").val();$("#FlyingFromCityNameText0").val(t.item.value);r=t.item.value.split("-");$("#FlyingFromCityName0").val(r[0]);u=t.item.value.indexOf("-");i=t.item.value.substring(0,u);$("#FlyingFromMobile").val(t.item.value);$("#from_city_headFrom").text(i);$("#pickCity").text(i);f=$("#Flyingfrom11").val();e=$("#Flyingto11").val();f!=""&&e!=""&&$(".close").click()},close:function(){$("#aCity").click()},minLength:3});n=[];$("#MultiFlyingfrom1").catcomplete({source:function(t,i){n=[];$("#MultiFlyingfrom11").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(t,i){$("#MultiFlyingfrom1").val(i.item.value);$("#MultiFlyingfrom11").val(i.item.id);$("#MultiCityFlyingFromCityNameText").val(i.item.value);var r=i.item.value.split("-");$("#MultiCityFlyingFromCityName").val(r[0]);n=[];$("#MultiFlyingto1").focus()},change:function(){if($("#MultiFlyingfrom11").val()=="")if(n.length>0){$("#MultiFlyingfrom1").val(n[0].Text);$("#MultiFlyingfrom11").val(n[0].AirportCode);$("#MultiCityFlyingFromCityNameText").val(n[0].Text);var t=n[0].Text.split("-");$("#MultiCityFlyingFromCityName").val(t[0])}else $("#MultiFlyingfrom1").val(""),$("#MultiFlyingfrom11").val(""),$("#MultiCityFlyingFromCityNameText").val(""),$("#MultiCityFlyingFromCityName").val("");n=[]},minLength:3});n=[];$("#MultiFlyingfrom2").catcomplete({source:function(t,i){n=[];$("#MultiFlyingfrom22").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(t,i){$("#MultiFlyingfrom2").val(i.item.value);$("#MultiFlyingfrom22").val(i.item.id);$("#MultiCityFlyingFromCityNameText2").val(i.item.value);var r=i.item.value.split("-");$("#MultiCityFlyingFromCityName2").val(r[0]);n=[];$("#MultiFlyingto2").focus()},change:function(){if($("#MultiFlyingfrom22").val()=="")if(n.length>0){$("#MultiFlyingfrom2").val(n[0].Text);$("#MultiFlyingfrom22").val(n[0].AirportCode);$("#MultiCityFlyingFromCityNameText2").val(n[0].Text);var t=n[0].Text.split("-");$("#MultiCityFlyingFromCityName2").val(t[0])}else $("#MultiFlyingfrom2").val(""),$("#MultiFlyingfrom22").val(""),$("#MultiCityFlyingFromCityNameText2").val(""),$("#MultiCityFlyingFromCityName2").val("");n=[]},minLength:3});n=[];$("#MultiFlyingfrom3").catcomplete({source:function(t,i){n=[];$("#MultiFlyingfrom33").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(t,i){$("#MultiFlyingfrom3").val(i.item.value);$("#MultiFlyingfrom33").val(i.item.id);$("#MultiCityFlyingFromCityNameText3").val(i.item.value);var r=i.item.value.split("-");$("#MultiCityFlyingFromCityName3").val(r[0]);n=[];$("#MultiFlyingto3").focus()},change:function(){if($("#MultiFlyingfrom33").val()=="")if(n.length>0){$("#MultiFlyingfrom3").val(n[0].Text);$("#MultiFlyingfrom33").val(n[0].AirportCode);$("#MultiCityFlyingFromCityNameText3").val(n[0].Text);var t=n[0].Text.split("-");$("#MultiCityFlyingFromCityName3").val(t[0])}else $("#MultiFlyingfrom3").val(""),$("#MultiFlyingfrom33").val(""),$("#MultiCityFlyingFromCityNameText3").val(""),$("#MultiCityFlyingFromCityName3").val("");n=[]},minLength:3});n=[];$("#MultiFlyingfrom4").catcomplete({source:function(t,i){n=[];$("#MultiFlyingfrom44").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(t,i){$("#MultiFlyingfrom4").val(i.item.value);$("#MultiFlyingfrom44").val(i.item.id);$("#MultiCityFlyingFromCityNameText4").val(i.item.value);var r=i.item.value.split("-");$("#MultiCityFlyingFromCityName4").val(r[0]);n=[];$("#MultiFlyingto4").focus()},change:function(){if($("#MultiFlyingfrom44").val()=="")if(n.length>0){$("#MultiFlyingfrom4").val(n[0].Text);$("#MultiFlyingfrom44").val(n[0].AirportCode);$("#MultiCityFlyingFromCityNameText4").val(n[0].Text);var t=n[0].Text.split("-");$("#MultiCityFlyingFromCityName4").val(t[0])}else $("#MultiFlyingfrom4").val(""),$("#MultiFlyingfrom44").val(""),$("#MultiCityFlyingFromCityNameText4").val(""),$("#MultiCityFlyingFromCityName4").val("");n=[]},minLength:3});n=[];$("#MultiFlyingfrom5").catcomplete({source:function(t,i){n=[];$("#MultiFlyingfrom55").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(t,i){$("#MultiFlyingfrom5").val(i.item.value);$("#MultiFlyingfrom55").val(i.item.id);$("#MultiCityFlyingFromCityNameText5").val(i.item.value);var r=i.item.value.split("-");$("#MultiCityFlyingFromCityName5").val(r[0]);n=[];$("#MultiFlyingto5").focus()},change:function(){if($("#MultiFlyingfrom55").val()=="")if(n.length>0){$("#MultiFlyingfrom5").val(n[0].Text);$("#MultiFlyingfrom55").val(n[0].AirportCode);$("#MultiCityFlyingFromCityNameText5").val(n[0].Text);var t=n[0].Text.split("-");$("#MultiCityFlyingFromCityName5").val(t[0])}else $("#MultiFlyingfrom5").val(""),$("#MultiFlyingfrom55").val(""),$("#MultiCityFlyingFromCityNameText5").val(""),$("#MultiCityFlyingFromCityName5").val("");n=[]},minLength:3});n=[];$("#MultiFlyingto1").catcomplete({source:function(t,i){n=[];$("#MultiFlyingto11").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(t,i){$("#MultiFlyingto1").val(i.item.value);$("#MultiFlyingto11").val(i.item.id);$("#MultiCityFlyingToCityNameText1").val(i.item.value);var r=i.item.value.split("-");$("#MultiCityFlyingToCityName1").val(r[0]);n=[];$("#MultiFlyingDeptDate1").focus()},change:function(){if($("#MultiFlyingto11").val()=="")if(n.length>0){$("#MultiFlyingto1").val(n[0].Text);$("#MultiFlyingto11").val(n[0].AirportCode);$("#MultiCityFlyingToCityNameText1").val(n[0].Text);var t=n[0].Text.split("-");$("#MultiCityFlyingToCityName1").val(t[0])}else $("#MultiFlyingto1").val(""),$("#MultiFlyingto11").val(""),$("#MultiCityFlyingToCityNameText1").val(""),$("#MultiCityFlyingToCityName1").val("");n=[]},minLength:3});n=[];$("#MultiFlyingto2").catcomplete({source:function(t,i){n=[];$("#MultiFlyingto22").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(t,i){$("#MultiFlyingto2").val(i.item.value);$("#MultiFlyingto22").val(i.item.id);$("#MultiCityFlyingToCityNameText2").val(i.item.value);var r=i.item.value.split("-");$("#MultiCityFlyingToCityName2").val(r[0]);n=[];$("#MultiFlyingDeptDate2").focus()},change:function(){if($("#MultiFlyingto22").val()=="")if(n.length>0){$("#MultiFlyingto2").val(n[0].Text);$("#MultiFlyingto22").val(n[0].AirportCode);$("#MultiCityFlyingToCityNameText2").val(n[0].Text);var t=n[0].Text.split("-");$("#MultiCityFlyingToCityName2").val(t[0])}else $("#MultiFlyingto2").val(""),$("#MultiFlyingto22").val(""),$("#MultiCityFlyingToCityNameText2").val(""),$("#MultiCityFlyingToCityName2").val("");n=[]},minLength:3});n=[];$("#MultiFlyingto3").catcomplete({source:function(t,i){n=[];$("#MultiFlyingto33").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(t,i){$("#MultiFlyingto3").val(i.item.value);$("#MultiFlyingto33").val(i.item.id);$("#MultiCityFlyingToCityNameText3").val(i.item.value);var r=i.item.value.split("-");$("#MultiCityFlyingToCityName3").val(r[0]);n=[];$("#MultiFlyingDeptDate3").focus()},change:function(){if($("#MultiFlyingto33").val()=="")if(n.length>0){$("#MultiFlyingto3").val(n[0].Text);$("#MultiFlyingto33").val(n[0].AirportCode);$("#MultiCityFlyingToCityNameText3").val(n[0].Text);var t=n[0].Text.split("-");$("#MultiCityFlyingToCityName3").val(t[0])}else $("#MultiFlyingto3").val(""),$("#MultiFlyingto33").val(""),$("#MultiCityFlyingToCityNameText3").val(""),$("#MultiCityFlyingToCityName3").val("");n=[]},minLength:3});n=[];$("#MultiFlyingto4").catcomplete({source:function(t,i){n=[];$("#MultiFlyingto44").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(t,i){$("#MultiFlyingto4").val(i.item.value);$("#MultiFlyingto44").val(i.item.id);$("#MultiCityFlyingToCityNameText4").val(i.item.value);var r=i.item.value.split("-");$("#MultiCityFlyingToCityName4").val(r[0]);n=[];$("#MultiFlyingDeptDate4").focus()},change:function(){if($("#MultiFlyingto44").val()=="")if(n.length>0){$("#MultiFlyingto4").val(n[0].Text);$("#MultiFlyingto44").val(n[0].AirportCode);$("#MultiCityFlyingToCityNameText4").val(n[0].Text);var t=n[0].Text.split("-");$("#MultiCityFlyingToCityName4").val(t[0])}else $("#MultiFlyingto4").val(""),$("#MultiFlyingto44").val(""),$("#MultiCityFlyingToCityNameText4").val(""),$("#MultiCityFlyingToCityName4").val("");n=[]},minLength:3});n=[];$("#MultiFlyingto5").catcomplete({source:function(t,i){n=[];$("#MultiFlyingto55").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(t,i){$("#MultiFlyingto5").val(i.item.value);$("#MultiFlyingto55").val(i.item.id);$("#MultiCityFlyingToCityNameText5").val(i.item.value);var r=i.item.value.split("-");$("#MultiCityFlyingToCityName5").val(r[0]);n=[];$("#MultiFlyingDeptDate5").focus()},change:function(){if($("#MultiFlyingto55").val()=="")if(n.length>0){$("#MultiFlyingto5").val(n[0].Text);$("#MultiFlyingto55").val(n[0].AirportCode);$("#MultiCityFlyingToCityNameText5").val(n[0].Text);var t=n[0].Text.split("-");$("#MultiCityFlyingToCityName5").val(t[0])}else $("#MultiFlyingto5").val(""),$("#MultiFlyingto55").val(""),$("#MultiCityFlyingToCityNameText5").val(""),$("#MultiCityFlyingToCityName5").val("");n=[]},minLength:3});$("#Flyingto1").catcomplete({source:function(t,i){n=[];$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,cityEn:n.CityName_En,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(n,t){$("#Flyingto1").val(t.item.value);$("#Flyingto").val(t.item.id);$("#FlyingToCityNameText").val(t.item.value);domain=="EG"?$("#FlyingToCityName").val(t.item.city):$("#FlyingToCityName").val(t.item.city);$("#FlyingFrom").focus()},minLength:3});n=[];$("#Flyingto11").catcomplete({source:function(t,i){n=[];$("#Flyingto0").val("");$.ajax({url:"/Home/LodeFlyingFrom",type:"POST",dataType:"json",data:{term:t.term,url:$("#hdnUrl").val()},success:function(t){n=t;i($.map(t,function(n){return{id:n.AirportCode,value:n.Text,category:n.Category,city:n.CityName,country:n.CountryName,airport:n.AirPortName,CategoryCount:n.CategoryCount}}))}})},open:function(){$(".ui-autocomplete").off("menufocus hover mouseover mouseenter")},select:function(n,t){var r,u,i,f,e;$("#Flyingto11").val(t.item.value);$("#Flyingto0").val(t.item.id);Flyingto11mob=$("#Flyingto0").val();$("#FlyingToCityNameText0").val(t.item.value);r=t.item.value.split("-");$("#FlyingToCityName0").val(r[0]);u=t.item.value.indexOf("-");i=t.item.value.substring(0,u);$("#from_city_headTo").text(i);$("#pickCityA").text(i);f=$("#Flyingfrom11").val();e=$("#Flyingto11").val();$("#FlyingToMobile").val(t.item.value);f!=""&&e!=""&&$(".close").click()},close:function(){setTimeout(function(){$("#FlyingToMobile").focus()}.bind(this),500)},minLength:3});$("#CheckInDatePicker").datepicker({viewMode:"years",autoclose:!0}).on("changeDate",function(n){$("#CheckOutDatePicker").removeAttr("data-date-start-date");var t=n.date,i=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()+30);$("#CheckOutDatePicker").datepicker("setStartDate",i);$("#CheckOutDatePicker").datepicker("setEndDate",r);$("#CheckOutDatePicker").val("")});$("#CheckOutDatePicker").datepicker({viewMode:"years",autoclose:!0}).on("click",function(){$("#CheckOutDatePicker").removeAttr("data-date-start-date");var n=new Date($("#CheckInDatePicker").val()),t=new Date(n.getFullYear(),n.getMonth(),n.getDate()+1),i=new Date(n.getFullYear(),n.getMonth(),n.getDate()+30);$("#CheckOutDatePicker").datepicker("setStartDate",n);$("#CheckOutDatePicker").datepicker("setEndDate",i);$("#CheckOutDatePicker").datepicker("setStartDate",t)});$("#FlyingFrom").datepicker({todayBtn:"linked",autoclose:!0,change:!1}).on("changeDate",function(n){var i=n.date,r=new Date(i.getFullYear()+1,i.getMonth()),t;/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())||$("#radio-1-2").hasClass("active")&&$("#FlyingTo").focus();$("#FlyingTo").val("");$("#FlyingTo").datepicker("setStartDate",i);$("#FlyingTo").datepicker("setEndDate",r);t=new Date((new Date).setYear((new Date).getFullYear()+1));t.setDate(t.getDate()-1);$("#FlyingFrom").datepicker("setEndDate",t);$("#FlyingTo").datepicker("setEndDate",t)});$("#FlyingTo").datepicker({todayBtn:"linked",autoclose:!0}).on("changeDate",function(){$("#FlyingTo").removeAttr("style");$("#FlyingTo").css("cursor","pointer");$("#radio-1-1").removeClass("active");$("#radio-1-2").addClass("active")});$("#MultiFlyingDeptDate1").datepicker({todayBtn:"linked",autoclose:!0,change:!1}).on("changeDate",function(n){var i=n.date,f=new Date(i.getFullYear()+1,i.getMonth()),t,r,u;$(this).datepicker("hide");/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||$("#radio-1-3").hasClass("active")&&$("#MultiFlyingto1").focus();$("#MultiFlyingDeptDate2").val("");$("#MultiFlyingDeptDate2").datepicker("setStartDate",i);$("#MultiFlyingDeptDate2").datepicker("setEndDate",f);t=new Date((new Date).setYear((new Date).getFullYear()+1));t.setDate(t.getDate()-1);$("#MultiFlyingDeptDate1").datepicker("setEndDate",t);$("#MultiFlyingDeptDate2").datepicker("setEndDate",t);r=$("#MultiFlyingto1").val();u=$("#MultiFlyingto11").val();$("#MultiFlyingfrom2").attr("required","required");$("#MultiFlyingfrom2").val()==""&&($("#MultiFlyingfrom2").val(r),$("#MultiFlyingfrom22").val(u));$("#MultiFlyingto2").focus()});$("#MultiFlyingDeptDate2").datepicker({todayBtn:"linked",autoclose:!0,change:!1}).on("changeDate",function(n){var i=n.date,r=new Date(i.getFullYear()+1,i.getMonth()),t;$(this).datepicker("hide");/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||$("#radio-1-3").hasClass("active")&&$("#MultiFlyingto2").focus();$("#MultiFlyingDeptDate3").val("");$("#MultiFlyingDeptDate3").datepicker("setStartDate",i);$("#MultiFlyingDeptDate3").datepicker("setEndDate",r);t=new Date((new Date).setYear((new Date).getFullYear()+1));t.setDate(t.getDate()-1);$("#MultiFlyingDeptDate2").datepicker("setEndDate",t);$("#MultiFlyingDeptDate3").datepicker("setEndDate",t)});$("#MultiFlyingDeptDate3").datepicker({todayBtn:"linked",autoclose:!0,change:!1}).on("changeDate",function(n){var i=n.date,r=new Date(i.getFullYear()+1,i.getMonth()),t;$(this).datepicker("hide");/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||$("#radio-1-3").hasClass("active")&&$("#MultiFlyingto3").focus();$("#MultiFlyingDeptDate4").val("");$("#MultiFlyingDeptDate4").datepicker("setStartDate",i);$("#MultiFlyingDeptDate4").datepicker("setEndDate",r);t=new Date((new Date).setYear((new Date).getFullYear()+1));t.setDate(t.getDate()-1);$("#MultiFlyingDeptDate3").datepicker("setEndDate",t);$("#MultiFlyingDeptDate4").datepicker("setEndDate",t)});$("#MultiFlyingDeptDate4").datepicker({todayBtn:"linked",autoclose:!0,change:!1}).on("changeDate",function(n){var i=n.date,r=new Date(i.getFullYear()+1,i.getMonth()),t;$(this).datepicker("hide");/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||$("#radio-1-3").hasClass("active")&&$("#MultiFlyingto4").focus();$("#MultiFlyingDeptDate5").val("");$("#MultiFlyingDeptDate5").datepicker("setStartDate",i);$("#MultiFlyingDeptDate5").datepicker("setEndDate",r);t=new Date((new Date).setYear((new Date).getFullYear()+1));t.setDate(t.getDate()-1);$("#MultiFlyingDeptDate4").datepicker("setEndDate",t);$("#MultiFlyingDeptDate5").datepicker("setEndDate",t)});$("#MultiFlyingDeptDate5").datepicker({todayBtn:"linked",autoclose:!0}).on("changeDate",function(){$("#MultiFlyingDeptDate5").removeAttr("style");$("#MultiFlyingDeptDate5").css("cursor","pointer");$(this).datepicker("hide")});$(".forscroll").mCustomScrollbar({setHeight:472,theme:"dark-3"});$("#showMore").click(function(){return $("#openMore").toggle(),!1});$("#showMore2").click(function(){return $(".hide-show").toggle(),$("#openMore2").toggle(),!1});$("#myTabContent3").click(function(n){n.stopPropagation()});$(".myCustomTab2").click(function(n){n.preventDefault()});var y=$(".loading-progress").progressTimer({onFinish:function(){}});for($("#btnHotelSearch").click(function(){var e,o,s,i,r,h,u,n;if($("#cityname1").val()=="")return e=!1,$("#cityname1").focus(),!1;if($("#CheckInDatePicker").val()=="")return o=!1,$("#CheckInDatePicker").focus(),!1;if($("#CheckOutDatePicker").val()=="")return s=!1,$("#CheckOutDatePicker").focus(),!1;i=$("input[name=City]").val().toLowerCase();r=$("#hdnCityName").val().trim().replace(/ /g,"-").replace(",","").replace(/--/g,"-").replace(/--/g,"-").replace(/&/g,"").replace("(","").replace(")","").replace(".","").replace("'","").replace(",","").replace("/","").toLowerCase();r=replaceSpecialChar(r);h=$("#hdnCountry").val().toLowerCase();u=$("#hdnCountryName").val().trim().replace(/ /g,"-").replace(",","").replace(/--/g,"-").replace(/--/g,"-").replace(/&/g,"").replace("(","").replace(")","").replace(".","").replace("'","").replace(",","").replace("/","").toLowerCase();u=replaceSpecialChar(u);n=$("#hdnLocalityName").val().trim().replace(/ /g,"-").replace(",","").replace(/--/g,"-").replace(/--/g,"-").replace(/&/g,"").replace("(","").replace(")","").replace(".","").replace("'","").replace(",","").replace("/","").toLowerCase();n=replaceSpecialChar(n);var c=$("#hdnHotelCode").val().toLowerCase(),f=$("#hdnsrctype").val().toLowerCase(),t="cheap-hotels";return domain=="EG"&&(t="hotels"),f=="countries"&&$("#hotelsForm").attr("action","/ar/"+t+"/country/"+u.replace(/--/g,"-")+"-"+i+"/"),f=="cities"&&$("#hotelsForm").attr("action","/ar/"+t+"/city/search/"+r.replace(/--/g,"-")+"-"+i+"/"),f=="localities"&&$("#hotelsForm").attr("action","/ar/"+t+"/area/"+n.replace(/--/g,"-")+"-"+i+"/"),f=="hotels"&&$("#hotelsForm").attr("action","/ar/"+t+"/searchresults?aid="+n.replace(/--/g,"-")+"-"+c),!0}),$("#dealsEmail").keyup(function(){var n=$("#dealsEmail").val();!n!=""||validateEmail(n)?$("#dealsEmail").css("border-color","#CCC"):($("#dealsEmail").focus(),$("#dealsEmail").css("border-color","red"))}),$("#dealsEmail").keyup(function(){var n=$("#dealsEmail").val();!n!=""||validateEmail(n)?$("#dealsEmail").css("border-color","#CCC"):($("#dealsEmail").focus(),$("#dealsEmail").css("border-color","red"))}),t=1;t<=5;t++)v=$("#multicity"+t).val(),v=="Active"&&(t==3&&$("#multPAD"+t).show(),t==4&&$("#multPAD"+t).show(),t==5&&$("#multPAD"+t).show(),t==5&&$("#addMultiCity").hide());if($("#btnFlightMultiSearch").click(function(){var n=$("#MultiFlyingfrom1").val(),t=$("#MultiFlyingto1").val(),i=$("#MultiFlyingfrom2").val(),r=$("#MultiFlyingto2").val(),u=$("#MultiFlyingfrom3").val(),f=$("#MultiFlyingto3").val(),e=$("#MultiFlyingfrom4").val(),o=$("#MultiFlyingto4").val(),s=$("#MultiFlyingfrom5").val(),h=$("#MultiFlyingto5").val(),c=$("#multicity3").val(),l=$("#multicity4").val(),a=$("#multicity5").val(),v=$("#MultiFlyingDeptDate1").val(),y=$("#MultiFlyingDeptDate2").val(),p=$("#MultiFlyingDeptDate3").val(),w=$("#MultiFlyingDeptDate4").val(),b=$("#MultiFlyingDeptDate5").val();if(n==t&&n!=""&&t!="")return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?alert("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "):($("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show()),$("#MultiFlyingto1").val(""),$("#MultiFlyingto1").focus(),!1;if(i==r&&i!=""&&r!="")return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?alert("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "):($("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show()),$("#MultiFlyingto2").val(""),$("#MultiFlyingto2").focus(),!1;if(u==f&&u!=""&&f!="")return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?alert("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "):($("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show()),$("#MultiFlyingto3").val(""),$("#MultiFlyingto3").focus(),!1;if(e==o&&e!=""&&o!="")return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?alert("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "):($("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show()),$("#MultiFlyingto4").val(""),$("#MultiFlyingto4").focus(),!1;if(s==h&&s!=""&&h!="")return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?alert("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "):($("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show()),$("#MultiFlyingto5").val(""),$("#MultiFlyingto5").focus(),!1;if(n!=""&&t==""||n==""&&t!=""||n==""&&t==""){if(n!=""&&t=="")return $("#MultiFlyingto1").val(""),$("#MultiFlyingto1").focus(),$("#MultiFlyingto1").val("").setCustomValidity("مدينة الوصول مطلوبة."),!1;if(n==""&&t!=""||n==""&&t=="")return $("#MultiFlyingfrom1").val(""),$("#MultiFlyingfrom1").focus(),$("#MultiFlyingfrom1").val("").setCustomValidity("مدينة المغادرة مطلوبة."),!1}else{if(v=="")return $("#MultiFlyingDeptDate1").focus(),!1;if(i!=""&&r==""||i==""&&r!=""||i==""&&r==""){if(i!=""&&r=="")return $("#MultiFlyingto2").val(""),$("#MultiFlyingto2").focus(),$("#MultiFlyingto2").val("").setCustomValidity("مدينة الوصول مطلوبة."),!1;if(i==""&&r!=""||i==""&&r=="")return $("#MultiFlyingfrom2").val(""),$("#MultiFlyingfrom2").focus(),$("#MultiFlyingfrom2").val("").setCustomValidity("مدينة المغادرة مطلوبة."),!1}else{if(y=="")return $("#MultiFlyingDeptDate2").focus(),!1;if(u!=""&&f==""||u==""&&f!=""||u==""&&f==""&&c=="Active"){if(c=="Active"){if(u!=""&&f=="")return $("#MultiFlyingto3").val(""),$("#MultiFlyingto3").focus(),$("#MultiFlyingto3").setCustomValidity("مدينة الوصول مطلوبة."),!1;if(u==""&&f!=""||u==""&&f=="")return $("#MultiFlyingfrom3").val(""),$("#MultiFlyingfrom3").focus(),$("#MultiFlyingfrom3").setCustomValidity("مدينة المغادرة مطلوبة."),!1}}else if(e!=""&&o==""||e==""&&o!=""||e==""&&o==""&&l=="Active"){if(l=="Active"){if(e!=""&&o=="")return $("#MultiFlyingto4").val(""),$("#MultiFlyingto4").focus(),$("#MultiFlyingto4").setCustomValidity("مدينة الوصول مطلوبة."),!1;if(e==""&&o!=""||e==""&&o=="")return $("#MultiFlyingfrom4").val(""),$("#MultiFlyingfrom4").focus(),$("#MultiFlyingfrom4").setCustomValidity("مدينة المغادرة مطلوبة."),!1}}else if((s!=""&&h==""||s==""&&h!=""||s==""&&h==""&&a=="Active")&&a=="Active"){if(s!=""&&h=="")return $("#MultiFlyingto5").val(""),$("#MultiFlyingto5").focus(),$("#MultiFlyingto5").setCustomValidity("مدينة الوصول مطلوبة."),!1;if(s==""&&h!=""||s==""&&h=="")return $("#MultiFlyingfrom5").val(""),$("#MultiFlyingfrom5").focus(),$("#MultiFlyingfrom5").setCustomValidity("مدينة المغادرة مطلوبة."),!1}}}if(c=="Active"&&p=="")return $("#MultiFlyingDeptDate3").focus(),!1;if(l=="Active"&&w=="")return $("#MultiFlyingDeptDate4").focus(),!1;if(a=="Active"){if(b=="")return $("#MultiFlyingDeptDate5").focus(),!1}else return $("#flightFormMutiCity").submit(),!0}),$.cookie("MultiCityAR")!=undefined)for(i=JSON.parse($.cookie("MultiCityAR")),$("#inDeValueAdultForMulti").val(i.Adults),$("#inDeValueAdultForMulti").text(englishToArabicNumber(i.Adults)),$("#hdnAdultsForMulti").val(i.Adults),$("#inDeValueChildForMulti").val(i.Children),$("#inDeValueChildForMulti").text(englishToArabicNumber(i.Children)),$("#hdnChildrenForMulti").val(i.Children),$("#inDeValueInfantForMulti").val(i.Infant),$("#inDeValueInfantForMulti").text(englishToArabicNumber(i.Infant)),$("#hdnInfantForMulti").val(i.Infant),setMultiCityClass(i.Class),t=1;t<=i.Segments.length;t++)$("#MultiFlyingfrom"+t).val(i.Segments[t-1].FlyingFromCityName),$("#MultiFlyingfrom"+t+t).val(i.Segments[t-1].From),$("#MultiFlyingto"+t).val(i.Segments[t-1].FlyingToCityName),$("#MultiFlyingto"+t+t).val(i.Segments[t-1].To),$("#MultiCityFlyingToCityName"+t).val(i.Segments[t-1].FromCityFullName),$("#MultiCityFlyingToCityNameText"+t).val(i.Segments[t-1].FlyingFromCityName),f=new Date(i.Segments[t-1].DeptDate),f>u&&($("#MultiFlyingDeptDate"+t).val(i.Segments[t-1].DeptDate),r=new Date($("#MultiFlyingDeptDate"+(t-1)).val()),$("#MultiFlyingDeptDate"+t).datepicker("setStartDate",r),$("#MultiFlyingDeptDate"+t).datepicker("update",i.Segments[t-1].DeptDate)),t<5&&$("#MultiFlyingDeptDate"+t).val()!=""&&$("#MultiFlyingDeptDate"+(t+1)).datepicker("setStartDate",new Date($("#MultiFlyingDeptDate"+t).val())),t>1?($("#MultiCityFlyingFromCityName"+t).val(i.Segments[t-1].FromCityFullName),$("#MultiCityFlyingFromCityNameText"+t).val(i.Segments[t-1].FlyingFromCityName)):($("#MultiCityFlyingFromCityName").val(i.Segments[t-1].FromCityFullName),$("#MultiCityFlyingFromCityNameText").val(i.Segments[t-1].FlyingFromCityName),$("#MultiFlyingDeptDate"+t).datepicker("setStartDate",new Date)),t>=3&&($("#multPAD"+t).show(),$("#multicity1").val("Active"))});
window.Modernizr=function(n,t,i){function b(n){g.cssText=n}function f(n,t){return typeof n===t}function ut(n,t){return!!~(""+n).indexOf(t)}function k(n,t){var u,r;for(u in n)if(r=n[u],!ut(r,"-")&&g[r]!==i)return t=="pfx"?r:!0;return!1}function ft(n,t,r){var e,u;for(e in n)if(u=t[n[e]],u!==i)return r===!1?n[e]:f(u,"function")?u.bind(r||t):u;return!1}function o(n,t,i){var r=n.charAt(0).toUpperCase()+n.slice(1),u=(n+" "+tt.join(r+" ")+r).split(" ");return f(t,"string")||f(t,"undefined")?k(u,t):(u=(n+" "+it.join(r+" ")+r).split(" "),ft(u,t,i))}var r={},l=!0,u=t.documentElement,s="modernizr",d=t.createElement(s),g=d.style,et,st={}.toString,a=" -webkit- -moz- -o- -ms- ".split(" "),nt="Webkit Moz O ms",tt=nt.split(" "),it=nt.toLowerCase().split(" "),e={},v=[],y=v.slice,h,rt=function(n,i,r,f){var l,a,c,v,e=t.createElement("div"),h=t.body,o=h||t.createElement("body");if(parseInt(r,10))while(r--)c=t.createElement("div"),c.id=f?f[r]:s+(r+1),e.appendChild(c);return l=["&#173;",'<style id="s',s,'">',n,"<\/style>"].join(""),e.id=s,(h?e:o).innerHTML+=l,o.appendChild(e),h||(o.style.background="",o.style.overflow="hidden",v=u.style.overflow,u.style.overflow="hidden",u.appendChild(o)),a=i(e,n),h?e.parentNode.removeChild(e):(o.parentNode.removeChild(o),u.style.overflow=v),!!a},p={}.hasOwnProperty,w,c;w=!f(p,"undefined")&&!f(p.call,"undefined")?function(n,t){return p.call(n,t)}:function(n,t){return t in n&&f(n.constructor.prototype[t],"undefined")};Function.prototype.bind||(Function.prototype.bind=function(n){var t=this,i,r;if(typeof t!="function")throw new TypeError;return i=y.call(arguments,1),r=function(){var f,e,u;return this instanceof r?(f=function(){},f.prototype=t.prototype,e=new f,u=t.apply(e,i.concat(y.call(arguments))),Object(u)===u?u:e):t.apply(n,i.concat(y.call(arguments)))},r});e.touch=function(){var i;return"ontouchstart"in n||n.DocumentTouch&&t instanceof DocumentTouch?i=!0:rt(["@media (",a.join("touch-enabled),("),s,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(n){i=n.offsetTop===9}),i};e.csstransforms=function(){return!!o("transform")};e.csstransitions=function(){return o("transition")};for(c in e)w(e,c)&&(h=c.toLowerCase(),r[h]=e[c](),v.push((r[h]?"":"no-")+h));return r.addTest=function(n,t){if(typeof n=="object")for(var f in n)w(n,f)&&r.addTest(f,n[f]);else{if(n=n.toLowerCase(),r[n]!==i)return r;t=typeof t=="function"?t():t;typeof l!="undefined"&&l&&(u.className+=" "+(t?"":"no-")+n);r[n]=t}return r},b(""),d=et=null,function(n,t){function v(n,t){var i=n.createElement("p"),r=n.getElementsByTagName("head")[0]||n.documentElement;return i.innerHTML="x<style>"+t+"<\/style>",r.insertBefore(i.lastChild,r.firstChild)}function s(){var n=r.elements;return typeof n=="string"?n.split(" "):n}function u(n){var t=a[n[l]];return t||(t={},o++,n[l]=o,a[o]=t),t}function h(n,r,f){if(r||(r=t),i)return r.createElement(n);f||(f=u(r));var e;return e=f.cache[n]?f.cache[n].cloneNode():b.test(n)?(f.cache[n]=f.createElem(n)).cloneNode():f.createElem(n),e.canHaveChildren&&!w.test(n)?f.frag.appendChild(e):e}function y(n,r){if(n||(n=t),i)return n.createDocumentFragment();r=r||u(n);for(var e=r.frag.cloneNode(),f=0,o=s(),h=o.length;f<h;f++)e.createElement(o[f]);return e}function p(n,t){t.cache||(t.cache={},t.createElem=n.createElement,t.createFrag=n.createDocumentFragment,t.frag=t.createFrag());n.createElement=function(i){return r.shivMethods?h(i,n,t):t.createElem(i)};n.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+s().join().replace(/\w+/g,function(n){return t.createElem(n),t.frag.createElement(n),'c("'+n+'")'})+");return n}")(r,t.frag)}function c(n){n||(n=t);var f=u(n);return r.shivCSS&&!e&&!f.hasCSS&&(f.hasCSS=!!v(n,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),i||p(n,f),n}var f=n.html5||{},w=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,b=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,e,l="_html5shiv",o=0,a={},i,r;(function(){try{var n=t.createElement("a");n.innerHTML="<xyz><\/xyz>";e="hidden"in n;i=n.childNodes.length==1||function(){t.createElement("a");var n=t.createDocumentFragment();return typeof n.cloneNode=="undefined"||typeof n.createDocumentFragment=="undefined"||typeof n.createElement=="undefined"}()}catch(r){e=!0;i=!0}})();r={elements:f.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:f.shivCSS!==!1,supportsUnknownElements:i,shivMethods:f.shivMethods!==!1,type:"default",shivDocument:c,createElement:h,createDocumentFragment:y};n.html5=r;c(t)}(this,t),r._version="2.6.2",r._prefixes=a,r._domPrefixes=it,r._cssomPrefixes=tt,r.testProp=function(n){return k([n])},r.testAllProps=o,r.testStyles=rt,r.prefixed=function(n,t,i){return t?o(n,t,i):o(n,"pfx")},u.className=u.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(l?" js "+v.join(" "):""),r}(this,this.document),function(n,t,i){function h(n){return"[object Function]"==y.call(n)}function c(n){return"string"==typeof n}function l(){}function w(n){return!n||"loaded"==n||"complete"==n||"uninitialized"==n}function f(){var n=a.shift();v=1;n?n.t?s(function(){("c"==n.t?u.injectCss:u.injectJs)(n.s,0,n.a,n.x,n.e,1)},0):(n(),f()):v=0}function ut(n,i,o,h,c,l,y){function k(t){if(!nt&&w(p.readyState)&&(tt.r=nt=1,!v&&f(),p.onload=p.onreadystatechange=null,t)){"img"!=n&&s(function(){g.removeChild(p)},50);for(var u in r[i])r[i].hasOwnProperty(u)&&r[i][u].onload()}}var y=y||u.errorTimeout,p=t.createElement(n),nt=0,b=0,tt={t:o,s:i,e:c,a:l,x:y};1===r[i]&&(b=1,r[i]=[]);"object"==n?p.data=i:(p.src=i,p.type=n);p.width=p.height="0";p.onerror=p.onload=p.onreadystatechange=function(){k.call(this,b)};a.splice(h,0,tt);"img"!=n&&(b||2===r[i]?(g.insertBefore(p,d?null:e),s(k,y)):r[i].push(p))}function ft(n,t,i,r,u){return v=0,t=t||"j",c(n)?ut("c"==t?et:nt,n,t,this.i++,i,r,u):(a.splice(this.i++,0,n),1==a.length&&f()),this}function b(){var n=u;return n.loader={load:ft,i:0},n}var o=t.documentElement,s=n.setTimeout,e=t.getElementsByTagName("script")[0],y={}.toString,a=[],v=0,k="MozAppearance"in o.style,d=k&&!!t.createRange().compareNode,g=d?o:e.parentNode,o=n.opera&&"[object Opera]"==y.call(n.opera),o=!!t.attachEvent&&!o,nt=k?"object":o?"script":"img",et=o?"script":nt,tt=Array.isArray||function(n){return"[object Array]"==y.call(n)},p=[],r={},it={timeout:function(n,t){return t.length&&(n.timeout=t[0]),n}},rt,u;u=function(n){function a(n){for(var n=n.split("!"),f=p.length,i=n.pop(),e=n.length,i={url:i,origUrl:i,prefixes:n},u,r,t=0;t<e;t++)r=n[t].split("="),(u=it[r.shift()])&&(i=u(i,r));for(t=0;t<f;t++)i=p[t](i);return i}function f(n,t,u,f,e){var o=a(n),s=o.autoCallback;o.url.split(".").pop().split("?").shift();o.bypass||(t&&(t=h(t)?t:t[n]||t[f]||t[n.split("/").pop().split("?")[0]]),o.instead?o.instead(n,t,u,f,e):(r[o.url]?o.noexec=!0:r[o.url]=1,u.load(o.url,o.forceCSS||!o.forceJS&&"css"==o.url.split(".").pop().split("?").shift()?"c":i,o.noexec,o.attrs,o.timeout),(h(t)||h(s))&&u.load(function(){b();t&&t(o.origUrl,e,f);s&&s(o.origUrl,e,f);r[o.url]=2})))}function s(n,t){function a(n,o){if(n){if(c(n))o||(i=function(){var n=[].slice.call(arguments);s.apply(this,n);u()}),f(n,i,t,0,e);else if(Object(n)===n)for(r in v=function(){var t=0;for(var i in n)n.hasOwnProperty(i)&&t++;return t}(),n)n.hasOwnProperty(r)&&(!o&&!--v&&(h(i)?i=function(){var n=[].slice.call(arguments);s.apply(this,n);u()}:i[r]=function(n){return function(){var t=[].slice.call(arguments);n&&n.apply(this,t);u()}}(s[r])),f(n[r],i,t,r,e))}else o||u()}var e=!!n.test,o=n.load||n.both,i=n.callback||l,s=i,u=n.complete||l,v,r;a(e?n.yep:n.nope,!!o);o&&a(o)}var e,t,o=this.yepnope.loader;if(c(n))f(n,0,o,0);else if(tt(n))for(e=0;e<n.length;e++)t=n[e],c(t)?f(t,0,o,0):tt(t)?u(t):Object(t)===t&&s(t,o);else Object(n)===n&&s(n,o)};u.addPrefix=function(n,t){it[n]=t};u.addFilter=function(n){p.push(n)};u.errorTimeout=1e4;null==t.readyState&&t.addEventListener&&(t.readyState="loading",t.addEventListener("DOMContentLoaded",rt=function(){t.removeEventListener("DOMContentLoaded",rt,0);t.readyState="complete"},0));n.yepnope=b();n.yepnope.executeStack=f;n.yepnope.injectJs=function(n,i,r,o,h,c){var a=t.createElement("script"),v,y,o=o||u.errorTimeout;a.src=n;for(y in r)a.setAttribute(y,r[y]);i=c?f:i||l;a.onreadystatechange=a.onload=function(){!v&&w(a.readyState)&&(v=1,i(),a.onload=a.onreadystatechange=null)};s(function(){v||(v=1,i(1))},o);h?a.onload():e.parentNode.insertBefore(a,e)};n.yepnope.injectCss=function(n,i,r,u,o,h){var u=t.createElement("link"),c,i=h?f:i||l;u.href=n;u.rel="stylesheet";u.type="text/css";for(c in r)u.setAttribute(c,r[c]);o||(e.parentNode.insertBefore(u,e),s(i,0))}}(this,document);Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
(function(n,t,i){"use strict";var c=!1,l=2e3,h=n.event,r,f,e,o,u,s;r=h.special.debouncedresize={setup:function(){n(this).on("resize",r.handler)},teardown:function(){n(this).off("resize",r.handler)},handler:function(n,t){var u=this,e=arguments,i=function(){n.type="debouncedresize";h.dispatch.apply(u,e)};f&&clearTimeout(f);t?i():f=setTimeout(i,r.threshold)},threshold:150};e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";n.fn.imagesLoaded=function(t){function l(){var i=n(h),e=n(o);r&&(o.length?r.reject(u,i,e):r.resolve(u));n.isFunction(t)&&t.call(f,u,i,e)}function c(t,i){t.src!==e&&n.inArray(t,s)===-1&&(s.push(t),i?o.push(t):h.push(t),n.data(t,"imagesLoaded",{isBroken:i,src:t.src}),a&&r.notifyWith(n(t),[i,u,n(h),n(o)]),u.length===s.length&&(setTimeout(l),u.unbind(".imagesLoaded")))}var f=this,r=n.isFunction(n.Deferred)?n.Deferred():0,a=n.isFunction(r.notify),u=f.find("img").add(f.filter("img")),s=[],h=[],o=[];return n.isPlainObject(t)&&n.each(t,function(n,i){n==="callback"?t=i:r&&r[n](i)}),u.length?u.bind("load.imagesLoaded error.imagesLoaded",function(n){c(n.target,n.type==="error")}).each(function(t,r){var f=r.src,u=n.data(r,"imagesLoaded");if(u&&u.src===f){c(r,u.isBroken);return}if(r.complete&&r.naturalWidth!==i){c(r,r.naturalWidth===0||r.naturalHeight===0);return}(r.readyState||r.complete)&&(r.src=e,r.src=f)}):l(),r?r.promise(f):f};o=n(t);u=t.Modernizr;n.Elastislide=function(t,i){this.$el=n(i);this._init(t)};n.Elastislide.defaults={orientation:"horizontal",speed:250,easing:"ease-in-out",minItems:3,imgSizeItemSelector:"img",start:0,onClick:function(){return!1},onReady:function(){return!1},onBeforeSlide:function(){return!1},onAfterSlide:function(){return!1}};n.Elastislide.prototype={_init:function(t){this.options=n.extend(!0,{},n.Elastislide.defaults,t);var i=this;if(this.transEndEventName={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"}[u.prefixed("transition")],this.support=u.csstransitions&&u.csstransforms,this.current=this.options.start,this.isSliding=!1,this.$items=this.$el.children("li"),this.itemsCount=this.$items.length,this.itemsCount===0)return!1;this._validate();this.$items.detach();this.$el.empty();this.$el.append(this.$items);this.$el.wrap('<div class="elastislide-wrapper elastislide-loading elastislide-'+this.options.orientation+'"><\/div>');this.hasTransition=!1;this.hasTransitionTimeout=setTimeout(function(){i._addTransition()},100);this.$el.imagesLoaded(function(){if(i.$el.show(),i._layout(),i._configure(),i.hasTransition){i._removeTransition();i._slideToItem(i.current);i.$el.on(i.transEndEventName,function(){i.$el.off(i.transEndEventName);i._setWrapperSize();i._addTransition();i._initEvents()})}else clearTimeout(i.hasTransitionTimeout),i._setWrapperSize(),i._initEvents(),i._slideToItem(i.current),setTimeout(function(){i._addTransition()},25);i.options.onReady(i.$el)})},_validate:function(){this.options.minItems instanceof Function&&(this._minItemsFn=this.options.minItems,this.options.minItems=this.options.minItems(document.documentElement.clientWidth));this.options.speed<0&&(this.options.speed=500);(this.options.minItems<1||this.options.minItems>this.itemsCount)&&(this.options.minItems=1);(this.options.start<0||this.options.start>this.itemsCount-1)&&(this.options.start=0);this.options.orientation!="horizontal"&&this.options.orientation!="vertical"&&(this.options.orientation="horizontal")},_layout:function(){this.$el.wrap('<div class="elastislide-carousel"><\/div>');this.$carousel=this.$el.parent();this.$wrapper=this.$carousel.parent().removeClass("elastislide-loading");var n=this.$items.find(this.options.imgSizeItemSelector).first();this.imgSize={width:n.outerWidth(!0),height:n.outerHeight(!0)};this._setItemsSize();this.options.orientation==="horizontal"?this.$el.css("max-height",this.imgSize.height):this.$el.css("height",this.options.minItems*this.imgSize.height);this._addControls()},_addTransition:function(){this.support&&this.$el.css("transition","all "+this.options.speed+"ms "+this.options.easing);this.hasTransition=!0},_removeTransition:function(){this.support&&this.$el.css("transition","all 0s");this.hasTransition=!1},_addControls:function(){var t=this;this.$navigation=n('<nav><span class="elastislide-prev">Previous<\/span><span class="elastislide-next">Next<\/span><\/nav>').appendTo(this.$wrapper);this.$navPrev=this.$navigation.find("span.elastislide-prev").on("mousedown.elastislide",function(){return t._slide("next"),!1});this.$navNext=this.$navigation.find("span.elastislide-next").on("mousedown.elastislide",function(){return t._slide("prev"),!1})},_setItemsSize:function(){var n=this.options.orientation==="horizontal"?Math.floor(this.$carousel.width()/this.options.minItems)*100/this.$carousel.width():100;this.$items.css({width:n+"%","max-width":150,"max-height":this.imgSize.height});this.options.orientation==="vertical"&&this.$wrapper.css("max-width",this.imgSize.width+parseInt(this.$wrapper.css("padding-left"))+parseInt(this.$wrapper.css("padding-right")))},_setWrapperSize:function(){this.options.orientation==="vertical"&&this.$wrapper.css({height:this.options.minItems*this.imgSize.height+parseInt(this.$wrapper.css("padding-top"))+parseInt(this.$wrapper.css("padding-bottom"))})},_configure:function(){this.fitCount=this.options.orientation==="horizontal"?this.$carousel.width()<this.options.minItems*this.imgSize.width?this.options.minItems:Math.floor(this.$carousel.width()/this.imgSize.width):this.$carousel.height()<this.options.minItems*this.imgSize.height?this.options.minItems:Math.floor(this.$carousel.height()/this.imgSize.height)},_initEvents:function(){var i=this;if(c){var r=0,f=this.options.orientation==="horizontal"?this.$items.outerWidth(!0):this.$items.outerHeight(!0),e=this.itemsCount*f,u=this.options.orientation==="horizontal"?this.$carousel.width():this.$carousel.height();t.setInterval(function(){e>r+u?(i._slide("next"),r+=u):(i._slideTo(0),r=0)},l)}o.on("debouncedresize.elastislide",function(){i._minItemsFn&&(i.options.minItems=i._minItemsFn(document.documentElement.clientWidth));i._setItemsSize();i._configure();i._slideToItem(i.current)});this.$el.on(this.transEndEventName,function(){i._onEndTransition()});if(this.options.orientation==="horizontal")this.$el.on({swipeleft:function(){i._slide("next")},swiperight:function(){i._slide("prev")}});else this.$el.on({swipeup:function(){i._slide("next")},swipedown:function(){i._slide("prev")}});this.$el.on("click.elastislide","li",function(t){var r=n(this);i.options.onClick(r,r.index(),t)})},_destroy:function(n){this.$el.off(this.transEndEventName).off("swipeleft swiperight swipeup swipedown .elastislide");o.off(".elastislide");this.$el.css({"max-height":"none",transition:"none"}).unwrap(this.$carousel).unwrap(this.$wrapper);this.$items.css({width:"auto","max-width":"none","max-height":"none"});this.$navigation.remove();this.$wrapper.remove();n&&n.call()},_toggleControls:function(n,t){t?n==="prev"?this.$navNext.show():this.$navPrev.show():n==="prev"?this.$navNext.show():this.$navPrev.show()},_slide:function(t,r){var s,u,c;if(this.isSliding)return!1;this.options.onBeforeSlide();this.isSliding=!0;var l=this,f=this.translation||0,h=this.options.orientation==="horizontal"?this.$items.outerWidth(!0):this.$items.outerHeight(!0),o=this.itemsCount*h,e=this.options.orientation==="horizontal"?this.$carousel.width():this.$carousel.height();if(r===i){if(u=1*h,u<0)return!1;t==="next"&&o-(Math.abs(f)+u)<e?o-(Math.abs(f)+e)>=0?(u=o-(Math.abs(f)+e),this._toggleControls("next",!1),this._toggleControls("prev",!0)):(u=Math.abs(f),this._toggleControls("next",!0),this._toggleControls("prev",!1)):t==="prev"&&Math.abs(f)-u<0?(u=o-(Math.abs(f)+e)==0?o-(Math.abs(f)+e):Math.abs(f),this._toggleControls("next",!0),this._toggleControls("prev",!1)):(s=t==="next"?Math.abs(f)+Math.abs(u):Math.abs(f)-Math.abs(u),s>0?this._toggleControls("prev",!0):this._toggleControls("prev",!1),s<o-e?this._toggleControls("next",!0):this._toggleControls("next",!1));r=t==="next"?f-u:f+u}else u=Math.abs(r),Math.max(o,e)-u<e&&(r=-(Math.max(o,e)-e)),u>0?this._toggleControls("prev",!0):this._toggleControls("prev",!1),Math.max(o,e)-e>u?this._toggleControls("next",!0):this._toggleControls("next",!1);if(this.translation=r,f===r)return this._onEndTransition(),!1;this.support?this.options.orientation==="horizontal"?(this.$el.css("-webkit-transform","translateX("+-r+"px)"),this.$el.css("-o-transform","translateX("+-r+"px)"),this.$el.css("-ms-transform","translateX("+-r+"px)"),this.$el.css("-moz-transform","translateX("+-r+"px)"),this.$el.css("transform","translateX("+-r+"px)")):(this.$el.css("-webkit-transform","translateY("+r+"px)"),this.$el.css("-o-transform","translateY("+r+"px)"),this.$el.css("-ms-transform","translateY("+r+"px)"),this.$el.css("-moz-transform","translateY("+r+"px)"),this.$el.css("transform","translateY("+r+"px)")):(n.fn.applyStyle=this.hasTransition?n.fn.animate:n.fn.css,c=this.options.orientation==="horizontal"?{left:r}:{top:r},this.$el.stop().applyStyle(c,n.extend(!0,[],{duration:this.options.speed,complete:function(){l._onEndTransition()}})));this.hasTransition||this._onEndTransition()},_onEndTransition:function(){this.isSliding=!1;this.options.onAfterSlide()},_slideTo:function(n){var n=n||this.current,t=Math.abs(this.translation)||0,i=this.options.orientation==="horizontal"?this.$items.outerWidth(!0):this.$items.outerHeight(!0),u=t+this.$carousel.width(),r=Math.abs(n*i);(r+i>u||r<t)&&this._slideToItem(n)},_slideToItem:function(n){var t=this.options.orientation==="horizontal"?n*this.$items.outerWidth(!0):n*this.$items.outerHeight(!0);this._slide("",-t)},add:function(n){var t=this,i=this.current,r=this.$items.eq(this.current);this.$items=this.$el.children("li");this.itemsCount=this.$items.length;this.current=r.index();this._setItemsSize();this._configure();this._removeTransition();i<this.current?this._slideToItem(this.current):this._slide("next",this.translation);setTimeout(function(){t._addTransition()},25);n&&n.call()},setCurrent:function(n,t){this.current=n;this._slideTo();t&&t.call()},next:function(){this._slide("next")},previous:function(){this._slide("prev")},slideStart:function(){this._slideTo(0)},slideEnd:function(){this._slideTo(this.itemsCount-1)},destroy:function(n){this._destroy(n)}};s=function(n){t.console&&t.console.error(n)};n.fn.elastislide=function(t){if(typeof t=="string"){var i=Array.prototype.slice.call(arguments,1);this.each(function(){var r=n.data(this,"elastislide");if(!r){s("cannot call methods on elastislide prior to initialization; attempted to call method '"+t+"'");return}if(!n.isFunction(r[t])||t.charAt(0)==="_"){s("no such method '"+t+"' for elastislide self");return}r[t].apply(r,i)})}else this.each(function(){var i=n.data(this,"elastislide");i?i._init():i=n.data(this,"elastislide",new n.Elastislide(t,this))});return self}})(jQuery,window);
(function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"?n(require("jquery")):n(jQuery)})(function(n){function i(n){return t.raw?n:encodeURIComponent(n)}function f(n){return t.raw?n:decodeURIComponent(n)}function e(n){return i(t.json?JSON.stringify(n):String(n))}function o(n){n.indexOf('"')===0&&(n=n.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return n=decodeURIComponent(n.replace(u," ")),t.json?JSON.parse(n):n}catch(i){}}function r(i,r){var u=t.raw?i:o(i);return n.isFunction(r)?r(u):u}var u=/\+/g,t=n.cookie=function(u,o,s){var y,a,h,v,c,p;if(o!==undefined&&!n.isFunction(o))return s=n.extend({},t.defaults,s),typeof s.expires=="number"&&(y=s.expires,a=s.expires=new Date,a.setTime(+a+y*864e5)),document.cookie=[i(u),"=",e(o),s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("");for(h=u?undefined:{},v=document.cookie?document.cookie.split("; "):[],c=0,p=v.length;c<p;c++){var w=v[c].split("="),b=f(w.shift()),l=w.join("=");if(u&&u===b){h=r(l,o);break}u||(l=r(l))===undefined||(h[b]=l)}return h};t.defaults={};n.removeCookie=function(t,i){return n.cookie(t)===undefined?!1:(n.cookie(t,"",n.extend({},i,{expires:-1})),!n.cookie(t))}});
function css_browser_selector(n){var i=n.toLowerCase(),t=function(n){return i.indexOf(n)>-1},r="gecko",f="webkit",o="safari",e="opera",u="mobile",s=document.documentElement,h=[!/opera|webtv/i.test(i)&&/msie\s(\d)/.test(i)?"ie ie"+RegExp.$1:t("firefox/2")?r+" ff2":t("firefox/3.5")?r+" ff3 ff3_5":t("firefox/3.6")?r+" ff3 ff3_6":t("firefox/3")?r+" ff3":t("gecko/")?r:t("opera")?e+(/version\/(\d+)/.test(i)?" "+e+RegExp.$1:/opera(\s|\/)(\d+)/.test(i)?" "+e+RegExp.$2:""):t("konqueror")?"konqueror":t("blackberry")?u+" blackberry":t("android")?u+" android":t("chrome")?f+" chrome":t("iron")?f+" iron":t("applewebkit/")?f+" "+o+(/version\/(\d+)/.test(i)?" "+o+RegExp.$1:""):t("mozilla/")?r:"",t("j2me")?u+" j2me":t("iphone")?u+" iphone":t("ipod")?u+" ipod":t("ipad")?u+" ipad":t("mac")?"mac":t("darwin")?"mac":t("webtv")?"webtv":t("win")?"win"+(t("windows nt 6.0")?" vista":""):t("freebsd")?"freebsd":t("x11")||t("linux")?"linux":"","js"];return c=h.join(" "),s.className+=" "+c,c}css_browser_selector(navigator.userAgent);
app.controller("IndexFlightsController",["$scope","$rootScope","$window",function(n,t,i){t.is_mobile=i.innerWidth<767;n.IsMobile=i.innerWidth<767;angular.element(i).bind("resize",function(){n.$apply()});n.$watch(function(){return i.innerWidth},function(i){t.is_mobile=i<767;n.IsMobile=i<767});n.FlightMobile={};localStorage.setItem("IsPresentPage","Home");n.numbers=[1,2,3,4,5,6,7,8]}]);app.controller("HubPagesDynamicContent",["$scope","$http","$rootScope","$window","$sce",function(n){n.Hub={};n.LangType=angular.copy(LangType);n.replaceInvertedComa=function(t){return n.trustAsHtml(t)}}]);
function changeImage(n){$preview.attr("src",n.data("preview"));$carouselItems.removeClass("current-img");n.addClass("current-img")}function FlightDealsBookNow(n,t,i,r){$("#radio-1-2").click();$("#Flyingfrom").val(n);$("#Flyingto").val(t);$("#Flyingfrom1").val(n);$("#Flyingto1").val(t);$("#FlyingFromCityName").val(i);$("#FlyingToCityName").val(r);var u=new Date;$.post(urlForFlightDeal,{year:u.getFullYear(),month:u.getMonth()+1,day:u.getDate()},function(n){var t=n.split("::");$("#FlyingFrom").val(t[0]);$("#FlyingTo").val(t[1]);$("#btnFlightSearch").click()})}function HotelDealsBookNow(n,t){$("[name='City']").val(n);$("[name='CityName']").val(t);$("#CheckInDatePicker").val(checkInDate);$("#CheckOutDatePicker").val(checkOutDate);$("[name='RoomCount']").val("1");$("[name='Rooms[0].Adults']").val("1");$("[name='Rooms[0].Children']").val("0");$("#btnHotelSearch").click()}var current=0,$preview=$("#preview"),$carouselEl=$("#carousel"),$carouselItems=$carouselEl.children(),carousel=$carouselEl.elastislide({current:current,minItems:4,onClick:function(n,t,i){changeImage(n,t);i.preventDefault()},onReady:function(){changeImage($carouselItems.eq(current),current)}}),endDateDP;CouponAmount!==""&&CouponAmount!=null&&$.cookie("emailSubscribe")!="close"&&$("#emailSubscribe").modal("hide");$(document).ready(function(){if(tempInvalidUserName!=""){var n="البريد الإلكتروني أو كلمة السر غير صحيح";window.innerWidth<768?($(".lblErrorMsg1").text(n),$("#anchrMobLogin").click()):($("#lblErrorMsg").text(n),$("#anchrSignUp_new").click())}});typeof viewbagId!="undefined"&&(viewbagId==""||viewbagId==0)&&($("#Hotels").removeClass("tab-pane fade in active"),$("#Hotels").addClass("tab-pane fade"));endDateDP=new Date((new Date).setYear((new Date).getFullYear()+1));endDateDP.setDate(endDateDP.getDate()-1);$("#FlyingFrom").datepicker("setEndDate",endDateDP);$("#FlyingTo").datepicker("setEndDate",endDateDP);$("#MultiFlyingDeptDate1").datepicker("setEndDate",endDateDP);$("#MultiFlyingDeptDate2").datepicker("setEndDate",endDateDP);$("#MultiFlyingDeptDate3").datepicker("setEndDate",endDateDP);$("#MultiFlyingDeptDate4").datepicker("setEndDate",endDateDP);$("#MultiFlyingDeptDate5").datepicker("setEndDate",endDateDP);typeof viewbagId!="undefined"&&viewbagId==2&&($("#liTabFlight").removeClass("active"),$("#liTabHotel").addClass("active"),$("#cityname1").focus());$("#MultiflightForm").submit(function(){var i,r,e,o,s,h,n,t,u,f;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){if($(window).width()>=768){if(i=$("#MultiFlyingfrom1").val(),r=$("#MultiFlyingto1").val(),i==r&&i!=""&&r!="")return $("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show(),$("#MultiFlyingto1").val(""),$("#MultiFlyingto1").focus(),!1;if($("#MultiFlyingfrom11").val()=="")return e=!1,$("#MultiFlyingfrom11").focus(),!1;if($("#radio-1-3").hasClass("active")&&$("#MultiFlyingto11").val()=="")return e=!1,$("#MultiFlyingto11").focus(),!1}else if(i=$("#FlyingFromMobile").val(),r=$("#FlyingToMobile").val(),i==r&&i!=""&&r!="")return $("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show(),$("#Flyingto1").val(""),$("#Flyingto1").focus(),!1}else{if(i=$("#MultiFlyingfrom1").val(),r=$("#MultiFlyingto1").val(),i==r&&i!=""&&r!="")return $("#popup_message").text("لا يمكن أن يكون مدينة المغادرة نفس مدينة المقصودة "),$("#popup_container").show(),$("#MultiFlyingto1").val(""),$("#MultiFlyingto1").focus(),!1;if($("#MultiFlyingfrom11").val()=="")return e=!1,$("#MultiFlyingfrom11").focus(),!1;if($("#radio-1-3").hasClass("active")&&$("#MultiFlyingto11").val()=="")return e=!1,$("#MultiFlyingto11").focus(),!1}if(o=$("#FlyingFromCityName0").val(),typeof o=="undefined"){if(s=$.trim($("#MultiFlyingfrom1").val()),h=$.trim($("#MultiFlyingto1").val()),s.length<3&&$("#MultiFlyingfrom11").val(""),h.length<3&&$("#MultiFlyingto11").val(""),$("#MultiFlyingfrom11").val()=="")return $("#popup_message").text("يرجى تحديد مدينة المغادرة/المطار ساري المفعول"),$("#MultiFlyingfrom1").val(""),$("#popup_container").show(function(){$(this).remove("slow")}),!1;if($("#MultiFlyingto11").val()=="")return $("#popup_message").text("يرجى تحديد مدينة المقصودة/المطار ساري المفعول"),$("#popup_container").show(function(){$(this).remove("slow")}),!1;n=$("#MultiCityFlyingFromCityName").val();n=$.trim(n).toLowerCase().replace(/ /g,"-");t=$("#MultiCityFlyingToCityName").val();t=$.trim(t).toLowerCase().replace(/ /g,"-");u=$("input[name=TripType]").val().toLowerCase();f="";$("#flightForm").attr("action","/ar/cheap-flights/search/"+n+"-to-"+t+"/"+$("#MultiFlyingfrom11").val().toLowerCase()+"-"+$("#MultiFlyingto11").val().toLowerCase()+"/"+u+"/"+(f==""?"":f+"/"))}else{if(u=$("input[name=TripType]").val().toLowerCase(),$("#MultiFlyingfrom11").val()=="")return $("#MultiFlyingfrom11").focus(),!1;if(u=="roundtrip"&&$("#MultiFlyingto11").val()=="")return $("#MultiFlyingto11").focus(),!1;n=$("#MultiCityFlyingFromCityName").val();n=$.trim(n).toLowerCase().replace(/ /g,"-");t=$("#MultiCityFlyingToCityName").val();t=$.trim(t).toLowerCase().replace(/ /g,"-");$(window).width()>=768?(n=$("#MultiCityFlyingFromCityName").val(),n=$.trim(n).toLowerCase().replace(/ /g,"-"),t=$("#MultiCityFlyingToCityName").val(),t=$.trim(t).toLowerCase().replace(/ /g,"-"),u=$("input[name=TripType]").val().toLowerCase(),f="",$("#flightForm").attr("action","/ar/cheap-flights/search/"+n+"-to-"+t+"/"+$("#MultiFlyingfrom11").val().toLowerCase()+"-"+$("#MultiFlyingto11").val().toLowerCase()+"/"+u+"/"+(f==""?"":f+"/"))):$("#flightForm").attr("action","/ar/cheap-flights/search/"+n+"-to-"+t+"/"+$("#MultiFlyingfrom11").val().toLowerCase()+"-"+$("#MultiFlyingto11").val().toLowerCase()+"/"+u+"/")}return!0});
