var oneaeromenu;$(document).ready(function(){LoadHeaderAccountInfo();$(".dropdown").each(function(){$(this).parent().eq(0).unbind("mouseenter mouseleave")});$(".dropdown").each(function(){$(this).parent().eq(0).hover(function(){$(".dropdown").hide();$(".dropdown").parent("li").attr("class","");if($(".dropdown:eq(0) li",this).length>0){$(".dropdown:eq(0)",this).show()}if(typeof mro_nsi!="undefined"){$("#site-navigation li:contains('"+mro_ni+"'):first").attr("class","select")}$(this).attr("class","select hover")},function(){$("ul.dropdown").hide();$(this).attr("class","");if(typeof mro_ni!="undefined"){MroSelectMenu(mro_ni)}})});$("#globalNotifications").hover(function(){$(this).find("img").attr("src","https://www.oneaero-mro.com/content/media/bell-hover.png")},function(){$(this).find("img").attr("src","https://www.oneaero-mro.com/content/media/bell.png")});$("#content-left").css({"min-height":"900px"});var c=$("#content-right");if(c.length>0){var a=$("#content-right").height();if(a>900){$("#content-left").css({"min-height":a+"px"})}}var b=!(window.mozInnerScreenX==null);$("#dashboardsearch").keyup(function(){dashboardSearchDelay(function(){var d=$("#dashboardsearch").attr("rel");var e=createCORSRequest("POST",d+"/universalSearch?q="+$("#dashboardsearch").val());if(!e){return}e.onload=function(){var f=e.responseText;$("#dashboardsearchresult-wrapper").html(f);$("#dashboardsearchresult-wrapper").show();var i=$("#dashboardsearch");var g=$("#dashboardsearch").position();var h=$("#dashboardsearchresult");$(h).css("top",g.top+i.height()+5);$(h).horzCenter()};e.onerror=function(f){};e.send("__a="+readCookie("__a"))},200)});$("#dashboardsearch").keydown(function(d){if(d.keyCode==13){d.preventDefault();return false}return true});$(document).mouseup(function(d){var f=$("#dashboardsearchresult-wrapper");if(!f.is(d.target)&&f.has(d.target).length===0){f.hide()}});if(typeof mro_ni!="undefined"){if(typeof mro_nsi=="undefined"){MroSelectMenu(mro_ni)}else{MroSelectMenu(mro_ni,mro_nsi)}}});function StringBuilder(a){this.strings=new Array("");this.append(a)}StringBuilder.prototype.append=function(a){if(a){this.strings.push(a)}};StringBuilder.prototype.clear=function(){this.strings.length=1};StringBuilder.prototype.toString=function(){return this.strings.join("")};function createCORSRequest(a,b){if(window.XDomainRequest){var c=new XDomainRequest();c.open(a,b,true);return c}else{var c=new XMLHttpRequest();c.open(a,b,true);return c}}var dashboardSearchDelay=(function(){var a=0;return function(c,b){clearTimeout(a);a=setTimeout(c,b)}})();function readCookie(b){var f=b+"=";var a=document.cookie.split(";");for(var d=0;d=0){var k=document.createElement("span");k.className="highlight";var d=c.splitText(l);var g=d.splitText(h.length);var e=d.cloneNode(true);k.appendChild(e);d.parentNode.replaceChild(k,d);f=1}}else{if(c.nodeType==1&&c.childNodes&&!/(script|style)/i.test(c.tagName)){for(var j=0;j=0){var g=i.InventoryOpenRFQ==0?"DDMenuItemCountG":"DDMenuItemCount";k.append("
  • Inventory RFQs"+i.InventoryOpenRFQ+"
  • ");e+=i.InventoryOpenRFQ}if(i.RepairOpenRFQ>=0){var g=i.RepairOpenRFQ==0?"DDMenuItemCountG":"DDMenuItemCount";k.append("
  • Repair RFQs "+i.RepairOpenRFQ+"
  • ");e+=i.RepairOpenRFQ}if(i.OpenRequests>=0){var g=i.OpenRequests==0?"DDMenuItemCountG":"DDMenuItemCount";k.append("
  • Connection Requests"+i.OpenRequests+"
  • ");e+=i.OpenRequests}if(i.UnreadMessages>=0){var g=i.UnreadMessages==0?"DDMenuItemCountG":"DDMenuItemCount";k.append("
  • Unviewed Messages"+i.UnreadMessages+"
  • ");e+=i.UnreadMessages}if(i.WarningCount>=0){var g=i.WarningCount==0?"DDMenuItemCountG":"DDMenuItemCount";k.append("
  • Profile Incomplete"+i.WarningCount+"
  • ");e+=i.WarningCount}if(i.MroTrackerUnapprovedQuotes>=0){var g=i.MroTrackerUnapprovedQuotes==0?"DDMenuItemCountG":"DDMenuItemCount";k.append("
  • MRO-Tracker Quotes"+i.MroTrackerUnapprovedQuotes+"
  • ");e+=i.MroTrackerUnapprovedQuotes}if(e>99){e=99}$("#globalNotificationsCounter").text(e);$("#globalNotificationsCounter").show();if(e>0){$("#globalNotificationsCounter").css("background-color","red")}else{$("#globalNotificationsCounter").css("background-color","gray")}b.html(k.toString());var f=$("#salut-connRequests").attr("ref")+"/dashboard/myPeople";if(i.OpenRequests>0){f+="/IncomingRequests"}else{$("#salut-connRequests").attr("openType","contacts")}var j=i.OpenRequests>99?"max":i.OpenRequests;var c=i.UnreadMessages>99?"max":i.UnreadMessages;var d=i.NewRFQs>99?"max":i.NewRFQs;var a=i.UnviewedQuotes>99?"max":i.UnviewedQuotes;var h=i.WarningCount>99?"max":i.WarningCount;$("#salut-connRequests").attr("href",f);$("#salut-connRequests img").attr("src","https://www.oneaero-mro.com/content/media/headerSalutation/request_"+j+".png");$("#salut-messages img").attr("src","https://www.oneaero-mro.com/content/media/headerSalutation/mail_"+c+".png");$("#salut-messages img").attr("ref",c);$("#salut-rfqs img").attr("src","https://www.oneaero-mro.com/content/media/headerSalutation/openRFQs_"+d+".png");$("#salut-quotes img").attr("src","https://www.oneaero-mro.com/content/media/headerSalutation/openQuotes_"+a+".png");if(i.WarningCount==0){$("#salut-profile-data").hide()}else{$("#salut-profile-data img").attr("src","https://www.oneaero-mro.com/content/media/headerSalutation/pen-paper_"+h+".png");$("#salut-profile-data").show()}$("#salut").show();clearTimeout(window.salutTimer);window.salutTimer=setTimeout(function(){LoadHeaderAccountInfo()},60000)}var conversationDropDownVisible=false;var unviewedConversationDropDownVisible=false;function openConversationDropdown(f,b,c){var h=$("#salut-messages").parent();var g=$("#salut-messages").attr("openType");if(g!=""){c=g}if(c==""){if(conversationDropDownVisible==true){c="latest"}else{if(unviewedConversationDropDownVisible==true){c="unviewed"}else{c="latest"}}}if((c=="latest"&&conversationDropDownVisible==true)||(c=="unviewed"&&unviewedConversationDropDownVisible==true)){return}if((conversationDropDownVisible==true||unviewedConversationDropDownVisible==true)||(conversationDropDownVisible==false&&unviewedConversationDropDownVisible==false)){if(c=="latest"){conversationDropDownVisible=true;unviewedConversationDropDownVisible=false}if(c=="unviewed"){unviewedConversationDropDownVisible=true;conversationDropDownVisible=false}var e=new Date();var a=createCORSRequest("GET",f+"/home/GlobalConversationDropdown?auth="+b+"&t="+e.getTime()+"&type="+c);a.withCredentials=true;if(!a){throw new Error("CORS not supported")}a.onload=function(){var i=a.responseText;if(i==""){return}var d=h.offset();d.top=d.top+15;$("#conversationDropdown").html(i);$("#conversationDropdown").offset(d);$("#conversationDropdown").show()};a.onerror=function(){console.log("There was an error!")};a.send()}}function setAsRead(a,b){var c=$(a).attr("ref");$.post(b+"/dashboard/wall/SetAsViewed2/"+c,function(d){$(a).parent().parent().parent().removeClass("unviewed");$(a).remove()})}var contactsDropDownVisible=false;var pymkDropDownVisible=false;var requestsDropDownVisible=false;function openContactsDropdown(f,b,c){var h=$("#salut-connRequests").parent();var g=$("#salut-connRequests").attr("openType");if(g!=""){c=g}if(c==""){if(contactsDropDownVisible==true){c="contacts"}else{if(requestsDropDownVisible==true){c="requests"}else{if(pymkDropDownVisible==true){c="pymk"}else{c="requests"}}}}if((c=="pymk"&&pymkDropDownVisible==true)||(c=="contacts"&&contactsDropDownVisible==true)||(c=="requests"&&requestsDropDownVisible==true)){return}if((contactsDropDownVisible==true||requestsDropDownVisible==true||pymkDropDownVisible==true)||(contactsDropDownVisible==false&&requestsDropDownVisible==false&&pymkDropDownVisible==false)){if(c=="pymk"){pymkDropDownVisible=true;contactsDropDownVisible=false;requestsDropDownVisible=false}if(c=="contacts"){contactsDropDownVisible=true;pymkDropDownVisible=false;requestsDropDownVisible=false}if(c=="requests"){requestsDropDownVisible=true;contactsDropDownVisible=false;pymkDropDownVisible=false}var e=new Date();var a=createCORSRequest("GET",f+"/home/GlobalContactsDropdown?auth="+b+"&type="+c+"&t="+e.getTime());a.onload=function(){var i=a.responseText;if(i==""){return}var d=h.offset();d.top=d.top+15;$("#contactsDropdown").html(i);$("#contactsDropdown").offset(d);$("#contactsDropdown").show()};a.send()}}function FriendshipHandlerContactsDropdown(g,b,e,h,i){var f=new Date();var c="";if(e=="deny"){c="ContactsDropdownDenyRequest"}else{if(e=="accept"){c="ContactsDropdownConfirmRequest"}else{if(e=="create"){c="ContactsDropdownCreateRequest"}else{return}}}var a=createCORSRequest("GET",g+"/friendship/"+c+"?auth="+b+"&personId="+h+"&t="+f.getTime());a.onload=function(){var d=a.responseText;if(d!="OK"){return}$('li[ref="'+i+'"]').fadeOut()};a.send()}function decreaseMustViewCount(){var b=$("#mustViewCountIndicator").html();if(b==0){return null}b--;if(b==0){$("#mustViewCountIndicator").attr("style","background-color: grey")}$("#mustViewCountIndicator").html(b);var a=$("#salut-messages img");var c=a.attr("ref");if(c==0){return null}c--;a.attr("ref",c);a.attr("src","https://www.oneaero-mro.com/content/media/headerSalutation/mail_"+c+".png")}function increaseMustViewCount(){var b=$("#mustViewCountIndicator").html();if(b==0){$("#mustViewCountIndicator").attr("style","background-color: red")}b++;$("#mustViewCountIndicator").html(b);var a=$("#salut-messages img");var c=a.attr("ref");if(c==0){return null}c++;a.attr("ref",c);a.attr("src","https://www.oneaero-mro.com/content/media/headerSalutation/mail_"+c+".png")}jQuery.fn.horzCenter=function(){this.css("position","absolute");this.css("left",Math.max(0,(($(window).width()-$(this).outerWidth())/2)+$(window).scrollLeft())+"px");return this};function detectIE(){var d=window.navigator.userAgent;var a=d.indexOf("MSIE ");if(a>0){return true}var c=d.indexOf("Trident/");if(c>0){return true}var b=d.indexOf("Edge/");if(b>0){return true}return false};