function getSelectedPopularSrch(n){setQuickSearch(n)}function setQuickSearch(n){var t="/aircraft-for-sale/"+n.replace(/\s/g,"-")+"-Aircraft";$("#frmSearchAircraft").prop("action",t);$("#frmSearchAircraft").submit()}function clearGanBookmark(){return eraseCookie("GanSrchBookmark"),!0}function btnSrchCMMD_Click(){var n,t;clearGanBookmark();n=buildURL();n=="no"?requireClass():($("#selclass").val($("#sc-search").attr("value")),$("#lowPrice").val($("#price-from").val()),$("#highPrice").val($("#price-to").val()),$("#lowYear").val($("#year-from").val()),$("#highYear").val($("#year-to").val()),$("#lowTT").val($("#tt-from").val()),$("#highTT").val($("#tt-to").val()),t=setLocations(),$("#Locations").val(t),$("#frmSearchAircraft").prop("action",n),$("#frmSearchAircraft").submit())}function setLocations(){var n="";return $(".selected-location").each(function(){if(this.value==0)for(var t=1;t<52;t++)n+=t+",";n+=this.value+","}),n=n.substring(0,n.length-1)}function btnSrchClear_Click(){$("#price-from").val("");$("#price-to").val("");$("#year-from").val("");$("#year-to").val("");$("#tt-from").val("");$("#tt-to").val("");$("#selectmanufacturer").empty();$("#selectmodel").empty();$("#sc-search").text("Select");$("#sm-search").text("");$("#so-search").text("");$("#sm-search").css("height","36px");$("#so-search").css("height","36px");$("#selectmanufacturer").html("Select Classification");$("#selectmodel").html("Select Classification");$("#selectmanufacturer").css("display","none");$("#selectmodel").css("display","none");$("#class-required").css("display","none");$("#loc-search").text("Select");$(".selected-location").removeClass("selected-location")}function requireClass(){$("#class-required").text("Please select a classification to search.");$("#class-required").css("display","block")}function buildURL(){var n="/aircraft-for-sale/",i,t,r;if($("#so-search").html()!="Select"&&$("#so-search").html()!="")t=$("#so-search").html(),i=formatModelDes(t),n+=i;else if($("#sm-search").html()!="Select"&&$("#sm-search").html()!=""){var t=$("#sc-search").html(),r=formatModelDes(t),i=$("#sm-search").html(),u=formatModelDes(i);n+=r+"/"+u}else $("#sc-search").html()!="Select"?(t=$("#sc-search").html(),r=formatModelDes(t,""),n+=r):n=$("#sc-search").html()=="Select"?"no":"no";return n}function openDDL(n){if(n==1&&($("#selectclassification").is(":visible")?$("#selectclassification").css("display","none"):$("#selectclassification").css("display","block")),n==2&&($("#selectmanufacturer").is(":visible")?$("#selectmanufacturer").css("display","none"):$("#selectmanufacturer").css("display","block")),n==3&&($("#selectmodel").is(":visible")?$("#selectmodel").css("display","none"):$("#selectmodel").css("display","block")),n==4)if($("#selectlocation").is(":visible")){$("#selectlocation").css("display","none");var t=$(".selected-location").length;t>0?$("#loc-search").text("Selected("+t+")"):$("#loc-search").text("Select")}else $("#selectlocation").css("display","block"),$("#loc-search").text("Done")}var vtoken="",last,imgcnt=null,imgtimer=null,currentSlide=0,loaded=0,maxSlidesInSlideShow=4,ismobile=1;window.addEventListener("load",function(){var n=readCookie("clsInterest");n=parseInt(n==undefined?5:n);isNaN(n)&&(n=5);$("#chkUSA").change(function(n){setUSASelection(n)});$("#quicksearch").keyup(function(n){var t=$("#quicksearch").val().length;n.keyCode==13&&(t>2?($("#frmpostmethod").prop("action"),$("#frmpostmethod").submit()):alert("Quicksearch requires at least 3 characters."))});$(".ts-circle").click(function(n){var t=$("#quicksearch").val().length;n.preventDefault();t>2?($("#frmpostmethod").prop("action"),$("#frmpostmethod").submit()):alert("Quicksearch requires at least 3 characters.")})})