function InitOKCancel(n){function i(){function i(n,t){return{getDialogBody:function(){return t},close:function(){n.dialog("close")}}}OKCancelCount=OKCancelCount+1;var r="okCancelDialog"+OKCancelCount;$('<div id="'+r+'"><\/div>').dialog({resizable:!1,modal:!0,position:n.position,dialogClass:"dialogNoTitle "+n.class,open:function(){var u=$(this),e,f,o;u.html('<div class="modal-header"><button type="button" class="close">&times;<\/button><h4 class="modal-title">'+n.title+'<\/h4><\/div><div class="modal-body">'+n.body+"<\/div>");e=$("#"+r);e.find("div.modal-header button.close").click(function(){n.cancelcallback&&n.cancelcallback(i(u,$(this)));u.dialog("close")});n.title.trim().length==0&&e.find("div.modal-header").remove();f=i(u,e);o=[];n.cancelshow&&o.push({text:n.canceltext,"class":"btn btn-white btn-default modal-cancel-btn",click:function(){n.cancelcallback&&n.cancelcallback(f);f.close()}});n.okshow&&o.push({text:n.oktext,"class":"btn btn-action btn-default modal-ok-btn",click:function(){t(f)}});u.dialog("option","buttons",o);n.open&&n.open(f)},close:function(){$(this).dialog("destroy")},width:n.width})}var t=null;n.body=n.body?n.body:pageGlobal.languageList.AreYouSure;n.oktext=n.oktext?n.oktext:pageGlobal.languageList.OK;n.canceltext=n.canceltext?n.canceltext:pageGlobal.languageList.Cancel;n.okshow=n.hasOwnProperty("okshow")?n.okshow:!0;n.cancelshow=n.hasOwnProperty("cancelshow")?n.cancelshow:!0;n.width=n.hasOwnProperty("width")?n.width:"50%";n.position=n.hasOwnProperty("position")?n.position:{my:"center top",at:"center top+15%",of:window};n.class=n.hasOwnProperty("class")?n.class:"";n.callback&&(t=n.callback);n.ajaxurl?(n.ajaxtype=n.hasOwnProperty("ajaxtype")?n.ajaxtype:"GET",ShowSpinner(),$.ajax({url:n.ajaxurl,data:n.postdata,type:n.ajaxtype,success:function(t){n.body=t;n.ajaxcallback&&n.ajaxcallback();i();HideSpinner()},error:InitErrorDetailsModal})):(i(),HideSpinner())}function stickyNavReset(){var n=document.getElementById("breadcrumbs-nav"),t;n!=null&&(n.classList.remove("sticky"),t=n.offsetTop,$(window).scroll(function(){window.pageYOffset>t?n.classList.add("sticky"):n.classList.remove("sticky")}),$(window).scroll())}function InitErrorDetailsModal(n,t,i){$.ajax({url:pageGlobal.appBaseUrl+"UserSecurity/CheckUserLoggedInAndReturnRedirect",type:"POST",data:{pageUrl:window.location.href,pageTitle:document.title},success:function(r){var u=r.loginResult!="True",f=r.redirectUrl;u?window.location=f:ShowErrorDetailsModal(n,t,i)},error:function(){ShowErrorDetailsModal(n,t,i)}})}function ShowErrorDetailsModal(n,t,i){var i=$(n.responseText),r=i.find("h2").text(),u=i.find("table").text(),e,o,f;e=n.status==0?pageGlobal.languageList[""]:r&&0!==r.length||u&&0!==u.length?"<code><pre>"+r+"\n"+u+"<\/pre><\/code>":n.statusText;HideSpinner();o=pageGlobal.languageList.OK;f={};f[o]=function(){$(this).dialog("close")};$("<div><\/div>").dialog({resizable:!1,title:pageGlobal.languageList.AnErrorHasOccured+" "+n.status,modal:!0,position:{my:"center top",at:"center top+15%",of:window},dialogClass:"results-warning-dialog",minWidth:600,open:function(){var n=e;$(this).html(n)},buttons:f})}function ShowSpinnerIfValid(n){$(n).valid()&&ShowSpinner()}function ShowSpinner(){$("#FocusBox").focus();$("#SpinnerContainer,#SpinnerBackground").show()}function HideSpinner(){$("#SpinnerContainer,#SpinnerBackground").hide()}function InitShareProjectPartial(n){var t=$(n),i=t.find("h2").text();t.find("h2").remove();InitOKCancel({title:i,body:t.html(),oktext:pageGlobal.languageList.SaveSharingSetting,canceltext:pageGlobal.languageList.Cancel,open:function(n){n.getDialogBody().find("#EmailAddresses").multiple_emails({position:"bottom"})},callback:function(n){ShowSpinner();var t=n.getDialogBody().find("form"),i=t.serialize();t.validate();t.valid()&&$.ajax({url:pageGlobal.appBaseUrl+"Projects/Share",data:i,type:"POST",success:function(){SetUndoCallback(pageGlobal.languageList.ShareRequestSent,null);n.close();HideSpinner()},error:InitErrorDetailsModal})}})}function InitHelpProjectPartial(n){InitOKCancel({title:"",body:n,oktext:pageGlobal.languageList.OK,canceltext:pageGlobal.languageList.Cancel,open:function(n){$.validator.unobtrusive.parse(n.getDialogBody().find("form"))},callback:function(n){var i,r,t,u;ShowSpinner();i=n.getDialogBody();r=i.find("#anySystems").val()=="True";r?(t=i.find("form"),u=t.serialize(),t.validate(),t.valid()&&$.ajax({url:pageGlobal.appBaseUrl+"Projects/RequestHelp",data:u,type:"POST",success:function(){SetUndoCallback(pageGlobal.languageList.ShareRequestSent,null);n.close();HideSpinner()},error:InitErrorDetailsModal})):(n.close(),HideSpinner())}})}function projectDelete(n,t,i){(n===undefined||n==null)&&(n=GetProjectId());InitOKCancel({title:pageGlobal.languageList.DeleteProject,body:pageGlobal.languageList.ConfirmDeleteProject,oktext:pageGlobal.languageList.Delete,canceltext:pageGlobal.languageList.Cancel,callback:function(r){var u={id:n};ShowSpinner();$.ajax({url:pageGlobal.appBaseUrl+"Projects/Delete",data:u,type:"POST",success:function(n){t(n);r.close();i&&openProjectSummaryDialog()},error:InitErrorDetailsModal})}})}function projectHelp(n){var t={projectId:n};(n===undefined||n==null)&&(n=GetProjectId());ShowSpinner();$.ajax({url:pageGlobal.appBaseUrl+"Projects/RequestHelp",data:t,type:"GET",success:function(n){HideSpinner();InitHelpProjectPartial(n)},error:InitErrorDetailsModal})}function projectShare(n){(n===undefined||n==null)&&(n=GetProjectId());var t={projectId:n};$.ajax({url:pageGlobal.appBaseUrl+"Projects/Share",data:t,type:"GET",success:function(n){InitShareProjectPartial(n)},error:InitErrorDetailsModal})}function projectViewBOM(n,t){var u=$(n.target),f=$(u).attr("data-href"),i,r;(t===undefined||t==null)&&(t=$("#systemChecklist"));i=!1;t.find('input[type="checkbox"]').length==0?(r="<center>"+pageGlobal.languageList.YouMustCreateSystem+"<\/center>",i=!0):r=pageGlobal.languageList.SelectSystemsForBOM+':<br /><br /><div id="bomChecklistItems">'+t.clone().html()+"<\/div>";InitOKCancel({title:pageGlobal.languageList.BOM,body:r,oktext:pageGlobal.languageList.OK,canceltext:pageGlobal.languageList.Cancel,callback:function(n){if(i)n.close();else{var t="";$('#bomChecklistItems input[type="checkbox"]').each(function(){var n=$(this),i;n.is(":checked")&&(i=t.length>0?",":"",t=t+i+n.attr("data-system-id"))});t.length>0?(n.close(),window.open(f+"?systemIds="+t,"_blank")):$("#bomChecklistItems .system-checklist-error").show()}}})}function projectRFQ(n,t){var f=$(n.target),e=$(f).attr("data-href"),i,r,u;(t===undefined||t==null)&&(t=$("#systemChecklist"));i=t.clone();i.find('[data-rfq-support="False"]').remove();r=!1;i.find('input[type="checkbox"]').length==0?(u="<center>"+pageGlobal.languageList.NoSystemsForRFQ+"<\/center>",r=!0):u=pageGlobal.languageList.SelectSystemsForRFQ+':<br /><br /><div id="rfqChecklistItems">'+i.html()+"<\/div>";InitOKCancel({title:pageGlobal.languageList.RequestQuote,body:u,oktext:pageGlobal.languageList.OK,canceltext:pageGlobal.languageList.Cancel,callback:function(n){if(ShowSpinner(),r)HideSpinner(),n.close();else{var t="";$('#rfqChecklistItems input[type="checkbox"]').each(function(){var n=$(this),i;n.is(":checked")&&(i=t.length>0?",":"",t=t+i+n.attr("data-system-id"))});t.length>0?(n.close(),HideSpinner(),window.open(e+"?systemIds="+t,"_blank")):$("#rfqChecklistItems .system-checklist-error").show();SendcmConversion(!0,"Request for Quote")}}})}function showHistory(n,t){ShowSpinner();var i={};t?i.systemId=n:i.projectId=n;$.ajax({url:pageGlobal.appBaseUrl+(t?"System":"Projects")+"/GetHistory",data:i,type:"GET",success:function(n){var r='<textarea readonly="readonly" style="width: 100%; max-width: 100%; font-family: \'Courier New\', Courier, monospace; height: 20em;">',i,u;for(i in n)u=new Date(n[i].Date),r+=u.toLocaleDateString()+" "+u.toLocaleTimeString()+"\t"+n[i].UserId+" "+n[i].Text+"\n";r+="<\/textarea>";HideSpinner();InitOKCancel({title:(t?"System":"Project")+" "+pageGlobal.languageList.History,body:r,okshow:!0,cancelshow:!1,callback:function(n){n.close()},cancelcallback:function(n){n.close()}})},error:InitErrorDetailsModal})}function UpdateProjectDetails(n,t,i,r){var u={projectId:n,name:t,description:i};$.ajax({url:pageGlobal.appBaseUrl+"Projects/UpdateDetails",data:u,type:"POST",success:function(n){r!==undefined&&r!=null&&r(n)},error:InitErrorDetailsModal})}function UpdateSystemDetails(n,t,i,r){var u={systemId:n,name:t,description:i};$.ajax({url:pageGlobal.appBaseUrl+"System/UpdateDetails",data:u,type:"POST",success:function(n){r!==undefined&&r!=null&&r(n)},error:InitErrorDetailsModal})}function UpdateDetailsCID(n,t,i,r,u){n=="P"?UpdateProjectDetails(t,i,r,u):n=="S"?UpdateSystemDetails(t,i,r,u):n=="C"}function systemDelete(n,t){InitOKCancel({title:pageGlobal.languageList.DeleteSystem,body:pageGlobal.languageList.ConfirmDeleteSystem,oktext:pageGlobal.languageList.Delete,canceltext:pageGlobal.languageList.Cancel,callback:function(i){var r={id:n};ShowSpinner();$.ajax({url:pageGlobal.appBaseUrl+"System/Delete",data:r,type:"POST",success:function(n){i.close();t(n)},error:InitErrorDetailsModal})}})}function systemUnshare(n,t){ShowSpinner();$.ajax({url:pageGlobal.appBaseUrl+"Projects/Unshare",data:{shareId:t},success:function(n){$("#summarySharedItemsContainer").html(n);HideSpinner()},error:InitErrorDetailsModal})}function systemUnshareProject(n){ShowSpinner();$.ajax({url:pageGlobal.appBaseUrl+"Projects/UnshareProject",data:{projectId:n},success:function(){location.reload()},error:InitErrorDetailsModal})}function ShowSystemSummary(n,t){var i,r,f,u;(t===undefined||t==null)&&(t=GetSystemId());i="";i=n?pageGlobal.appBaseUrl+"System/SystemShortSummaryReport?SystemId="+t:pageGlobal.appBaseUrl+"System/SystemSummaryReport?SystemId="+t;r=window.open(i,"parkersummaryreport");(typeof r=="undefined"||r==null)&&(f=pageGlobal.languageList.OK,u={},u[f]=function(){$(this).dialog("close")},$("<div><\/div>").dialog({resizable:!1,title:pageGlobal.languageList.PopupBlockerDetected,modal:!0,position:{my:"center top",at:"center top+15%",of:window},dialogClass:"results-warning-dialog",minWidth:600,open:function(){$(this).html(pageGlobal.languageList.DisablePopupBlockerSummaryReport)},close:function(){$(this).dialog("destroy")},buttons:u}))}function ShareSystem(n,t){(n===undefined||n==null)&&(n=GetProjectId());(t===undefined||t==null)&&(t=GetSystemId());var i={projectId:n,restrictToSystemId:t};ShowSpinner();$.ajax({url:pageGlobal.appBaseUrl+"Projects/Share",data:i,type:"GET",success:function(n){HideSpinner();InitShareProjectPartial(n)},error:InitErrorDetailsModal})}function RequestHelp(n,t){(n===undefined||n==null)&&(n=GetProjectId());(t===undefined||t==null)&&(t=GetSystemId());var i={projectId:n,restrictToSystemId:t};ShowSpinner();$.ajax({url:pageGlobal.appBaseUrl+"Projects/RequestHelp",data:i,type:"GET",success:function(n){HideSpinner();InitHelpProjectPartial(n)},error:InitErrorDetailsModal})}function SwapListView(n){ShowSpinner();n=n.toLowerCase();var i=getUserCookie(),t=n+"ListView";setUserCookie(t,!i[t]);location.reload()}function flexgridResetDataPreserveSort(n,t){var i=[];n.itemsSource.sortDescriptions!==undefined&&i.forEach(function(n){i.push({property:n.property,ascending:n.ascending})});n.itemsSource=new wijmo.collections.CollectionView(t);i.forEach(function(t){n.collectionView.sortDescriptions.push(new wijmo.collections.SortDescription(t.property,t.ascending))})}function parseJSONDate(n){var t=/\/Date\((\d*)\)\//.exec(n);return t?new Date(+t[1]):n}function GoToAction(n,t){ShowSpinner();$.ajax({url:n,data:t,type:"GET",success:function(){HideSpinner();window.location=n},error:InitErrorDetailsModal})}function GetParameterByName(n){url=window.location.href;n=n.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),t=i.exec(url);return t?t[2]?decodeURIComponent(t[2].replace(/\+/g," ")):"":null}function getUserCookieSystemSpecificData(n){var t=getUserCookie();return t.systemData!=null&&n in t.systemData||(t.systemData[n]={pendingDashboardAction:null,pendingDashboardActionJSON:null}),t.systemData[n]}function setUserCookieSystemSpecificData(n,t){var i=getUserCookie();i.systemData[n]=t;setUserCookie("systemData",i.systemData)}function IsParkerPage(){return window.location.href.indexOf(".parker.com")>-1}function InitCoreMetrics(n,t){IsParkerPage()?$.ajax({type:"POST",url:pageGlobal.appBaseUrl+t,dataType:"json",data:{wfid:$("#wfID").val(),pageUrl:window.location.href},success:function(t){try{if(t!=null){var i=document.title;SetcmVariables(t);SendcmClientID();SendcmPageView(i,n)}}catch(r){console.log("COREMETRICS ERROR InitCoreMetrics (not a Sizing error) -- "+r.message)}},error:function(){console.log("COREMETRICS ERROR InitCoreMetrics (not a Sizing error) -- Ajax failure")}}):(console.log("InitCoreMetrics: Not a Parker domain, will act in STUB mode"),console.log("InitCoreMetrics: Initialize for cmPageType = '"+n+"'"),console.log("InitCoreMetrics: SendcmPageView("+document.title+", "+n+")"))}function SetcmVariables(n){if(IsParkerPage())try{divisionId=GetArrayValue(n,"divisionId");marketingCode=GetArrayValue(n,"marketingCode");cmLanguage=GetArrayValue(n,"cmLanguage");cmClientIdPre=GetArrayValue(n,"cmClientIdPre");cmClientIdPost=GetArrayValue(n,"cmClientIdPost");cmCookieDomain=GetArrayValue(n,"cmCookieDomain");cmDataDomain=GetArrayValue(n,"cmDataDomain");approvedParkerDomain=GetArrayValue(n,"approvedParkerDomain")=="False"?!1:!0}catch(t){console.log("COREMETRICS ERROR SetcmVariables (not a Sizing error) -- "+t.message)}return}function SendcmClientID(){if(IsParkerPage())try{cmClientIdPre&&divisionId&&cmClientIdPost&&marketingCode&&cmDataDomain&&cmCookieDomain&&(cmSetClientID(cmClientIdPre+divisionId+cmClientIdPost+marketingCode,approvedParkerDomain,cmDataDomain,cmCookieDomain),cmInitialized=!0)}catch(n){console.log("COREMETRICS ERROR SendcmClientID (not a Sizing error) -- "+n.message)}return}function SendcmPageView(n,t){if(IsParkerPage())try{n&&t&&marketingCode&&cmLanguage&&cmInitialized&&(divisionId!=null&&divisionId!==undefined&&divisionId.length>0?(attribute1=divisionId+"-_-"+divisionId+"-_-"+marketingCode+"-_-"+cmLanguage,t=divisionId+":"+t):attribute1=marketingCode+"-_-"+cmLanguage,cmCreatePageviewTag(divisionId+" - "+n,t,null,null,attribute1))}catch(i){console.log("COREMETRICS ERROR SendcmPageView (not a Sizing error) -- "+i.message)}return}function GetArrayValue(n,t){if(IsParkerPage()){try{var r="",i=$.grep(n,function(n){return n.Name==t});i!=null&&i.length>0&&(r=i[0].Value)}catch(u){console.log("COREMETRICS ERROR GetArrayValue (not a Sizing error) -- "+u.message)}return r}return null}function SendcmConversion(n,t){if(IsParkerPage())try{var i=document.title,r=divisionId+" - "+i,u=n?"2":"1";cmCreateConversionEventTag(r,u,t)}catch(f){console.log("COREMETRICS ERROR GetArrayValue (not a Sizing error) -- "+f.message)}else console.log("SendcmConversion: isComplete="+n+" eventCategoryId="+t)}function ResetUndoSystem(){$("#statusMessage").hide();$("#undoLink").off();$("#undoLink").click(function(){undoBannerCallback();$("#statusMessage").hide()})}function SetUndoCallback(n,t){$("#statusMessageText").html(n);undoBannerCallback=t;undoBannerCallback==null?$("#undoLink").hide():$("#undoLink").show();$("#statusMessage").show()}function openOverlay(){$("#projectDialogNewProject").css("display")=="block"?document.getElementById("overlay_new_project").style.right="0%":(document.getElementById("overlay").style.right="0%",$("label.project-save-dialog-tree-toggler").each(function(n,t){$(t).addClass("project-save-dialog-tree-open");$(t).next().show()}))}function closeOverlay(){document.getElementById("overlay_new_project").style.right="100%";document.getElementById("overlay").style.right="100%"}function appendUrlForId(n,t,i,r){var u=n.includes("?")?"&":"?";return t!=null&&t.length>0?n=n+u+"projectId="+t:i!=null&&i.length>0?n=n+u+"systemId="+i:r!=null&&r.length>0&&(n=n+u+"configuredPartId="+r),n}function EditNoteAttach(n){var r=$(".na-view-left-column-container .na-view-item-selected"),i=r.attr("data-na-item-id"),e="#NA_Name_Editor_"+i,u=r.find(e).val(),f,t;n?(f=$("#EditingText").val(),t={id:i,Title:u,Text:f},$.ajax({url:pageGlobal.appBaseUrl+"Notes/EditNote",type:"POST",data:t,success:function(n){RefreshNoteAttachmentsView(n,function(){$(".btn-na-close").removeAttr("disabled")})},error:InitErrorDetailsModal})):(t={id:i,Title:u},$.ajax({url:pageGlobal.appBaseUrl+"Attachments/EditAttachement",type:"POST",data:t,success:function(){RefreshNoteAttachmentsView(i,function(){$(".btn-na-close").removeAttr("disabled")})},error:InitErrorDetailsModal}))}function CreateEditAttachment(n,t,i,r){var f="Attachments",u=pageGlobal.appBaseUrl+f+"/";n==null?(u=u+"Create",u=appendUrlForId(u,t,i,r)):u=u+"Edit?id="+n;$.ajax({url:u,type:"GET",cache:!1,success:function(n){$("<div><\/div>").dialog({resizable:!1,title:pageGlobal.languageList.Note,modal:!0,position:{my:"center middle",at:"center middle",of:window},dialogClass:"dialogNoTitle",open:function(){$(this).html(n);$.validator.unobtrusive.parse($("form#editNAForm"))},buttons:[{text:pageGlobal.languageList.Save,"class":"btn btn-black",click:function(){var n=$("form#editNAForm"),t;n.valid()&&(t=$(this),ShowSpinner(),$.ajax({url:pageGlobal.appBaseUrl+f+"/Edit",type:"POST",data:n.serialize(),success:function(n){RefreshNoteAttachmentsView(n,function(){t.dialog("close").dialog("destroy");HideSpinner()})},error:InitErrorDetailsModal}))}},{text:pageGlobal.languageList.Close,"class":"btn btn-black",click:function(){$(this).dialog("close").dialog("destroy")}}]});HideSpinner()},error:InitErrorDetailsModal})}function DeleteNoteAttachment(n,t,i){ShowSpinner();var r=n?"Notes":"Attachments";$.ajax({url:pageGlobal.appBaseUrl+r+"/Delete",data:{id:t},type:"POST",success:function(){RefreshNoteAttachmentsView(null,i)},error:InitErrorDetailsModal})}function GetNoteAttachmentContent(n,t){var i=n?"Notes":"Attachments",r=pageGlobal.appBaseUrl+i+"/GetContent";$.ajax({url:r+"?id="+t,type:"GET",cache:!1,success:function(n){n!==null&&n.length>0?$("#EditedText").html(n.replace(/(?:\r\n|\r|\n)/g,"<br />")):$("#EditedText").html("("+pageGlobal.languageList.EditNot+")");$("#EditingText").val(n);HideSpinner()},error:InitErrorDetailsModal})}function FormatNoteAttachmentsView(n,t,i){var u=$(".na-view-left-column-container"),r,f;$(".na-view-item").click(function(){var t=$(this);ShowSpinner();t.parent().find(".na-view-item").removeClass("na-view-item-selected");t.parent().find(".na-name").attr("readonly",!0);t.addClass("na-view-item-selected");t.find(".na-name").attr("readonly",!1);GetNoteAttachmentContent(n,t.attr("data-na-item-id"));$(".btn-na-delete").prop("disabled",t.attr("data-is-distributor")=="True")});n?($("#EditedText").click(function(){$(".btn-na-close").attr("disabled","disabled")}),$("#EditingText").focusout(function(){$(".btn-na-close").removeAttr("disabled")})):$(".na-view-right-column").attr("disabled","disabled");u.find(".na-view-item").length>0?(r=i==null?u.find(".na-view-item").first():u.find('.na-view-item[data-na-item-id="'+i+'"]'),u.find(".na-view-item").each(function(){var i=$(this).attr("data-na-item-id"),r="#NA_Name_"+i,u="#NA_Name_Editor_"+i,f="#NA_Name_EImage_"+i;t&&$(r).inlineEdit($(u),$(f),!1,null,function(){EditNoteAttach(n)});$(r).attr("readonly",!0)}),r.length==0&&(r=u.find(".na-view-item").first()),r.length>0&&(r.addClass("na-view-item-selected"),r.find(".na-name").attr("readonly",!1),u.scrollTop(u.scrollTop()+r.position().top-u.height()/2+r.height()/2),GetNoteAttachmentContent(n,r.attr("data-na-item-id"))),n&&t&&$("#EditedText").inlineEdit($("#EditingText"),$("#TextEditingIcon"),!0,"("+pageGlobal.languageList.EditNote+")",function(){$(".btn-na-close").attr("disabled","disabled");EditNoteAttach(n)}),$(".btn-na-delete").prop("disabled",r.attr("data-is-distributor")=="True")):(f=n?pageGlobal.languageList.NewNoteText:pageGlobal.languageList.NewLinkText,$(".na-view-right-column").text(f),$("button.btn-na-delete").attr("disabled","disabled"));t||($("button.btn-na-delete").attr("disabled","disabled"),$("button.btn-na-new").attr("disabled","disabled"))}function InitNewNote(n,t,i){var r={projectId:n,systemId:t,configuredPartId:i,title:pageGlobal.languageList.NewNote,text:""};$.ajax({url:pageGlobal.appBaseUrl+"Notes/CreateNewNote",type:"POST",data:r,success:function(n){RefreshNoteAttachmentsView(n,function(){var t=$('div.na-view-item[data-na-item-id="'+n+'"]'),i=t.parent();t.prependTo(i)})},error:InitErrorDetailsModal})}function RefreshNoteAttachmentsView(n,t){var i=$("div.na-view"),e=i.find("#ProjectId").val(),o=i.find("#SystemId").val(),s=i.find("#ConfiguredPartId").val(),u=i.find("#IsNotes").val()=="true",f=i.find("#UserCanEdit").val()=="true",r=pageGlobal.appBaseUrl+"Notes/NotesAttachmentsView?isNotes="+u+"&UserCanEdit="+f;r=appendUrlForId(r,e,o,s);$.ajax({url:r,type:"GET",cache:!1,success:function(r){i.html(r);FormatNoteAttachmentsView(u,f,n);t!==undefined&&t!=null&&t()},error:InitErrorDetailsModal})}function OpenNoteAttachmentsView(n,t,i,r,u,f,e){ShowSpinner();$("#projectsSummaryModal").modal("hide");var o=pageGlobal.appBaseUrl+"Notes/NotesAttachmentsView?isNotes="+t+"&UserCanEdit="+f;o=appendUrlForId(o,i,r,u);$.ajax({url:o,type:"GET",cache:!1,success:function(o){var h=$(window).width(),c=h*.8,s=375;$("<div><\/div>").dialog({resizable:!1,title:t?pageGlobal.languageList.Notes:pageGlobal.languageList.Links,modal:!0,position:{my:"center top",at:"center top+15%",of:window},dialogClass:"na-view-dialog",minWidth:c,minHeight:s,maxHeight:s,open:function(){$(this).html(o);FormatNoteAttachmentsView(t,f,null)},buttons:[{text:pageGlobal.languageList.New,"class":"btn btn-black btn-na-new",click:function(){ShowSpinner();t?InitNewNote(i,r,u):CreateEditAttachment(null,i,r,u)}},{text:pageGlobal.languageList.Delete,"class":"btn btn-black btn-na-delete",click:function(){InitOKCancel({title:t?pageGlobal.languageList.DeleteNote:pageGlobal.languageList.DeleteLink,body:t?pageGlobal.languageList.DeleteNoteText:pageGlobal.languageList.DeleteLinkText,oktext:pageGlobal.languageList.Yes,canceltext:pageGlobal.languageList.No,callback:function(n){var i=$("div.na-view .na-view-item.na-view-item-selected").attr("data-na-item-id");DeleteNoteAttachment(t,i,function(){n.close();HideSpinner()})}})}},{text:pageGlobal.languageList.Close,"class":"btn btn-black btn-na-close",click:function(){var i=$("div.na-view .na-view-item").length,r=t?i!=1?pageGlobal.languageList.Notes:pageGlobal.languageList.Note:i!=1?pageGlobal.languageList.Links:pageGlobal.languageList.Link;e!==undefined&&e!=null&&e(i);$(n).find("span.na-counter").html(i+"&nbsp"+r);$(this).dialog("close").dialog("destroy")}}]});HideSpinner()},error:InitErrorDetailsModal})}function OpenNoteAttachmentsViewCID(n,t,i,r,u){var e=null,o=null,s=null,f=i.substring(0,1);f=="P"?e=i.substring(1):f=="S"?o=i.substring(1):f=="C"&&(s=i.substring(1));OpenNoteAttachmentsView(n,t,e,o,s,r,u)}function NoteUpdateTitle(n){var t=$(n),i=t.val(),r=t.parent(),u=r.attr("data-na-item-createDate"),f=r.children().first();f.val(i+" - "+u);f.html(i+" - "+u)}function unitConverterInit(n,t){n.each(function(){var n=$(this);n.hasClass("unit-dropdown")&&n.off("change").change(function(){unitConverterChange(t,this)})})}function GetConvertedVal(n,t,i,r){return window[r](n,t,i)}function convertValueToLocalized(n,t,i,r){for(var o=".",s=",",f=[],e=[],u=0,u=0;u<n.length;u++)n[u]===(r?o:t)&&f.push(u),n[u]===(r?s:i)&&e.push(u);for(u=0;u<f.length;u++)n=setCharAt(n,f[u],r?t:o);for(u=0;u<e.length;u++)n=setCharAt(n,e[u],r?i:s);return n}function setCharAt(n,t,i){return t>n.length-1?n:n.substr(0,t)+i+n.substr(t+1)}function unitConverterChange(n,t){var i=$(t),o=i.attr("data-prevunit"),f=i.val(),s=i.attr("data-changefunc"),e=i.attr("data-targets"),r,u;e&&$(e).each(function(){var t=$(this),h=t.prop("value")!==undefined,u=t.attr("data-percise-value"),e,r,i,c;u==null||u==undefined||u==""?(r=h?t.val():t.text(),r=convertValueToLocalized(r,numberDecimalSeparator,numberGroupSeparator,!1),e=Number(r)):e=Number(t.attr("data-percise-value"));i=window[s](o,e,f);isNaN(i)||(h?(i=convertValueToLocalized(i,numberDecimalSeparator,numberGroupSeparator,!0),t.val(i),t.attr("data-percise-value",i)):(t.text(i),t.attr("data-percise-value",i)));c=$(t).attr("id");n&&CopyInputIdToMetadataField(c)});r=i.attr("data-unittargets");r&&(u=i.find(":selected").text(),$(r).each(function(){var n=$(this),t=n.prop("value")!==undefined;t?n.val(u):n.text(u)}));i.attr("data-prevunit",f)}function parseDecimalNumber(){var n,t;t=[];n={thousands:",",decimal:"."};this.parse=function(i,r,u){var e,c,l,a,s,h,o,f;if(typeof i=="number")return i;if(u==null&&(u=!0),typeof r=="string"){if(r.length!==2)throw{name:"ArgumentException",message:"The format for string options is '<thousands><decimal>' (exactly two characters)"};f=r[0];e=r[1]}else if(Array.isArray(r)){if(r.length!==2)throw{name:"ArgumentException",message:"The format for array options is ['<thousands>','[<decimal>'] (exactly two components)"};f=r[0];e=r[1]}else f=(r!=null?r.thousands:void 0)||(r!=null?r.group:void 0)||n.thousands,e=(r!=null?r.decimal:void 0)||n.decimal;return(h=""+f+e+u,s=t[h],s==null&&(l=u?3:1,s=t[h]=new RegExp("^\\s*([+-]?(?:(?:\\d{1,3}(?:\\"+f+"\\d{"+l+",3})+)|\\d*))(?:\\"+e+"(\\d*))?\\s*$")),o=i.match(s),!(o!=null&&o.length===3))?NaN:(a=o[1].replace(new RegExp("\\"+f,"g"),""),c=o[2],parseFloat(a+"."+c))};this.setOptions=function(t){var i,r;for(i in t)r=t[i],n[i]=r};this.factoryReset=function(){n={thousands:",",decimal:"."}};this.withOptions=function(n,t){return t==null&&(t=!0),function(i){return parseDecimalNumber(i,n,t)}}}function UnitConversionInstall(n){var t,i="select.unit-dropdown";t=n?n.find(i):$(i);t.each(function(){var n=$(this);(n.is("[data-unit-conversion-target-selector]")||n.is("[data-unit-target-selector]"))&&n.change(UnitConversionSelect)})}function UnitConversionSelect(){var n=$(this),r=n.data("unit-previous"),t=n.val(),f=n.data("unit-conversion-precision"),u=n.data("unit-conversion-target-selector"),i;u&&($(u).each(function(){var n=$(this),i=n.prop("nodeName")=="INPUT",u=n.attr("data-percise-value"),e,o,s;e=u==null||u==undefined||u==""?Number(numberParser.parse(i?n.val():n.text())):Number(n.attr("data-percise-value"));o=UnitConversionConvertValue(e,t,r,i?null:f);s=UnitConversionConvertValue(e,t,r,null);i?(n.val(o),n.attr("data-percise-value",s)):(n.text(o),n.attr("data-percise-value",s))}),n.data("unit-previous",$(this).val()));i=n.data("unit-target-selector");console.log("TGT",i);i&&$(i).each(function(){var n=$(this),i=n.prop("nodeName")=="INPUT";i?n.val(t):n.text(t)})}function UnitConversionEncodeUnit(n){var t=n;return t.replace("/s²","")}function UnitConversionConvertValue(n,t,i,r){var f=["g","kg","lbs"];t=="N"&&f.indexOf(i)>=0&&(t="Nmass");i=="N"&&f.indexOf(t)>=0&&(i="Nmass");var e=UnitConversionEncodeUnit(t),o=UnitConversionEncodeUnit(i),s=math.unit(n,o),u=s.toNumber(e);if(r!==undefined&&r!=null)try{u=u.toLocaleString(undefined,{minimumFractionDigits:r})}catch(h){u=Number(u).toFixed(r)}return u}function InitTutorialWindow(n,t){function o(){var r=e+n[i];$("#tutorial-image").attr("src",r);$("#tutorial-title").text(t[i]);$("#tutorial-number").text(i+1)}function r(){var t=$("#"+u),r=$("#"+f);console.log(n.length);n.length==1?(r.attr("disabled","disabled"),t.attr("disabled","disabled")):i==0?(t.attr("disabled","disabled"),r.removeAttr("disabled")):i==n.length-1?(r.attr("disabled","disabled"),t.removeAttr("disabled")):(r.removeAttr("disabled"),t.removeAttr("disabled"))}var i=0;if(n.length!=t.length){console.log("Error: Image and title list are different lengths");return}var u="tutorial-previous-btn",f="tutorial-next-btn",e=pageGlobal.appBaseUrl+"Content/images/TutorialImages/";$('<div id = "tutorialdialog" class="system-tutorial-modal"><\/div>').dialog({resizable:!1,modal:!0,position:{my:"center",at:"center",of:window},dialogClass:"dialogNoTitle dialogNoWidgetBackgroud dialogTutorial",open:function(){var h=$(this),s="";n.length>1&&(s="<span id = "+u+' class="glyphicon glyphicon-circle-arrow-left tutorial-btn" aria-hidden="true"><\/span><span id = '+f+' class="glyphicon glyphicon-circle-arrow-right  tutorial-btn " aria-hidden="true"><\/span>');h.html('<div class="modal-image-container"><img class="modal-image" id="tutorial-image" src="'+e+n[i]+'"/><\/div><div class="tutorial-action-row"><table><tr valign="center"><td width="90%"><span class="tutorial-text"><span id="tutorial-title" style="padding-left:45%">'+t[i]+'<\/span> | <span id="tutorial-number">'+(i+1)+"<\/span>/"+t.length+' <\/span><\/td><td width="5%"> '+s+'<\/td> <td width="5%" align="right"><button type="button" id ="tutorial-close-btn" class="tutorial-btn tutorial-gotit-btn btn btn-outline-style">'+pageGlobal.languageList.GotIt+"<\/button><\/td><\/tr><\/table><\/div>");r();$("#tutorial-previous-btn").click(function(){$(this).attr("disabled")=="disabled"||(i=i-1,o(),r())});$("#tutorial-next-btn").click(function(){$(this).attr("disabled")=="disabled"||(i=i+1,o(),r())});$("#tutorial-close-btn").click(function(){h.dialog("close")})},close:function(){$(this).dialog("destroy")},width:1200,height:654}).dialog("option","position",{my:"center center",at:"center middle",of:window});$("#tutorialdialog").dialog("option","position",{my:"center center",at:"center middle",of:window})}var OKCancelCount,popupSpinnerOptions,popupSpinner,undoBannerCallback,inputMaskOverride,numberParser;(function(){function n(n,t){function u(){return i.find('input.toggle-div-input[type="hidden"]')}function e(){return u().val()=="true"}function s(){var n=u();n.val("true");i.addClass("toggled")}function o(){var n=u();n.val("false");i.removeClass("toggled")}function h(){var n=i.attr("id");i.prepend('<input class="toggle-div-input" type="hidden" value="false"><\/input>');i.removeClass("toggled");i.click(function(){r?e()?o():s():f!=null&&f(i)})}var i=n,r=!0,f=t;this.Object=function(){return i};this.IsSelected=function(){return e()};this.Enable=function(){r=!0};this.Disable=function(){r=!1;o()};this.IsEnabled=function(){return r};h()}jQuery.fn.extend({toggleButtonDiv:function(t){return new n($(this),t)}})})();OKCancelCount=0;$(document).ready(function(){$(document).ajaxError(function(n,t){t.status===401&&location.reload()});headerFooterConnectLanguageDropdown();InitCoreMetrics("ESELECTORS","Utility/GetCMParams");var n=getUserCookie();n.new20Accepted||!0||InitOKCancel({title:"",body:"<h1>Welcome to Virtual Engineer 2.2.2.0 Release<\/h1><h2 style='color: #ffb91d'><b>What’s New in Version 2.2.2.0?<\/b><\/h2><div style='margin-left: 30px;'>Here is a quick breakdown of the new features and products added in version 2.2.2.0:<h2><b>Features:<\/b><\/h2><h3><b>Full Template Layout<\/b><\/h3><ul><li>Sporlan is the first division to use this feature. The full layout of the system will be displayed when the user first opens the Dashboard. The user can move from part to part entering information and launching the Virtual Engineer Sizing Tools when appropriate.<\/li><\/ul><h3><b>Excel Tools<\/b><\/h3><ul><li>Excel tools that run off of VE data sources and services<\/li><\/ul><h3><b>Excel Exports<\/b><\/h3><ul><li>Option to export data to Excel from VE (specific data is TBD)<\/li><\/ul><h3><b>What-If mode, part swapping<\/b><\/h3><ul><li>Ability to swap parts in a configured system and  re-validate<\/li><\/ul><h3><b>Load Refrigerants<\/b><\/h3><ul><li>Ability for a Parker SVD admin to add or update refrigerants listed in VE<\/li><\/ul><h3><b>Thermo Reports<\/b><\/h3><ul><li>Sizing and Selection process and associated reports for this product.<\/li><\/ul><h2><b>Products:<\/b><\/h2><ul><li>Distributors<\/li><\/ul><ul><li>Expansion Valves<\/li><\/ul><ul><li>Solenoids Discharge, Suction, Liquid<\/li><\/ul><ul><li>Catch All’s Liquid, Suction<\/li><\/ul><ul><li>Suction Filter<\/li><\/ul><ul><li>Discharge Bypass Valve<\/li><\/ul><ul><li>Evaporator Pressure Regulator<\/li><\/ul><ul><li>Discharge MTW Valve<\/li><\/ul><ul><li>Head Pressure Control Valve<\/li><\/ul><ul><li>Differential & Crankcase Pressure Regulators<\/li><\/ul><ul><li>Temperature Responsive Valve<\/li><\/ul><ul><li>3 Way Hot Gas Defrost Valve<\/li><\/ul><ul><li>Condenser Split Solenoid<\/li><\/ul><ul><li>3 Way Reclaim Valve<\/li><\/ul><ul><li>Secondary Coolant Valve<\/li><\/ul><ul><li>Liquid, Discharge and Suction Line Sizing<\/li><\/ul><ul><li>Flash Gas Bypass and Gas Cooler Valves<\/li><\/ul><\/div>",width:"95%",okshow:!0,cancelshow:!1,callback:function(n){setUserCookie("new20Accepted",!0);n.close()},cancelcallback:function(){setUserCookie("new20Accepted",!0)}});stickyNavReset()});String.prototype.includes||(String.prototype.includes=function(n,t){"use strict";return typeof t!="number"&&(t=0),t+n.length>this.length?!1:this.indexOf(n,t)!==-1});Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(n,t){function e(n,t){return n===t||typeof n=="number"&&typeof t=="number"&&isNaN(n)&&isNaN(t)}var f,i,r,u;if(this==null)throw new TypeError('"this" is null or not defined');if(f=Object(this),i=f.length>>>0,i===0)return!1;for(r=t|0,u=Math.max(r>=0?r:i-Math.abs(r),0);u<i;){if(e(f[u],n))return!0;u++}return!1}});$.widget("ui.dialog",$.ui.dialog,{options:{clickOutside:!1,clickOutsideTrigger:""},open:function(){var t=$(this.options.clickOutsideTrigger),n=this;if(this.options.clickOutside)$(document).on("click.ui.dialogClickOutside"+n.eventNamespace,function(i){$(i.target).closest($(t)).length==0&&$(i.target).closest($(n.uiDialog)).length==0&&n.close()});this._super()},close:function(){var n=this;$(document).off("click.ui.dialogClickOutside"+n.eventNamespace);this._super()}});popupSpinnerOptions={lines:13,length:28,width:14,radius:42,scale:1,corners:1,color:"#000",opacity:.25,rotate:0,direction:1,speed:1,trail:60,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:!1,hwaccel:!1,position:"fixed"};popupSpinner=new Spinner(popupSpinnerOptions),function(n){n.fn.serializeObjectForMVC=function(){var i=this,r={},u={},t={validate:/^[a-zA-Z][a-zA-Z0-9_]*((?:\[(?:\d*|[a-zA-Z0-9_]+)\])*(?:\.)[a-zA-Z][a-zA-Z0-9_]*)*$/,key:/[a-zA-Z0-9_]+|(?=\[\])/g,push:/^$/,fixed:/^\d+$/,named:/^[a-zA-Z0-9_]+$/},f={};return n(this).find("input,select").each(function(){n(this).is("input")&&this.type=="checkbox"&&(f[this.name]=n(this).is(":checked"))}),this.build=function(n,t,i){return n[t]=i,n},this.push_counter=function(n){return u[n]===undefined&&(u[n]=0),u[n]++},n.each(n(this).serializeArray(),function(){if(t.validate.test(this.name)){f[this.name]!==undefined&&(this.value=f[this.name]);for(var u,s=this.name.match(t.key),e=this.value,o=this.name;(u=s.pop())!==undefined;)o=o.replace(new RegExp("\\["+u+"\\]$"),""),u.match(t.push)?e=i.build([],i.push_counter(o),e):u.match(t.fixed)?e=i.build([],u,e):u.match(t.named)&&(e=i.build({},u,e));r=n.extend(!0,r,e)}}),r}}(jQuery);var divisionId="",marketingCode="",approvedParkerDomain=!1,cmLanguage="",cmClientIdPre="",cmClientIdPost="",cmCookieDomain="",cmDataDomain="",cmInitialized=!1;$(document).ready(function(){ResetUndoSystem()});undoBannerCallback=null;$.fn.inlineEdit=function(n,t,i,r,u){function s(){t.show();t.removeClass("glyphicon glyphicon-ok");t.addClass("glyphicon glyphicon-pencil");t.css("color","darkgray")}function h(){t.show();t.removeClass("glyphicon glyphicon-pencil");t.addClass("glyphicon glyphicon-ok");t.css("color","green");t.fadeOut(5e3)}function f(){t.hide()}function e(n,t){var i=200;return t=parseInt(t,10),isNaN(t)||(i=t),n=n.trim(),n.length==0?r:n.length<i?n:n.substring(0,i)+"..."}function o(n){return n==null||n===undefined?"":n+": "}n.hide();f();$(this).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});$(this).click(function(t){var r=$(this),a=r.attr("data-prefix-text"),c,l;r.is("[readonly]")||(t.stopPropagation(),n.show(),c=n.val(),l=n.attr("maxlength"),s(),r.hide(),n.focus(),n.off("blur"),n.blur(function(){f();var t=$(this).val().trim();(i||t!="")&&t!=c?($(this).val(t),r.text(e(o(a)+t,l)),u(t),h()):(n.val(c),r.text(e(o(a)+c,l)));n.hide();r.show()}))})};inputMaskOverride="input mask prevents invalid value";$.validator.addMethod("multipleemail",function(n,t){for(var r=$(t).val().split(","),i;r.length>0;)if(i=r.shift().trim(),i.length>0&&!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(i))return $(t).data("invalid-email",i),!1;return!0});$.validator.unobtrusive.adapters.add("multipleemail",function(n){n.rules.multipleemail=0;n.messages.multipleemail=function(){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};return String($(n.element).data("invalid-email")+" "+pageGlobal.languageList.InvalidEmail).replace(/[&<>"'\/]/g,function(n){return t[n]})}});$.validator.addMethod("finetuningdurationcheck",function(n,t){var s={Trapezoidal:1/3,TrapezoidalSCurve:1/3,Triangular:1/2,TriangularSCurve:1/2},r=$(t).attr("id"),i=$("div#FineTuningBody"),h=i.find('input[id$="Duration"]'),o=numberParser.parse(h.val()),c=i.find('input[id="AccelDuration"]'),u=numberParser.parse(c.val()),l=i.find('input[id="DecelDuration"]'),f=numberParser.parse(l.val()),a=i.find('select[id$="Segment_ProfileBaseType"]'),v=numberParser.parse(a.val()),y=i.find('input[id="Segment_UseSCurveProfile"]').prop("checked"),e=v;if(y&&(e=e+"SCurve"),u||(u=s[e]),f||(f=s[e]),r=="Duration")if($.isNumeric(h.val())){if(n<=0)return $(t).data("invalid-finetuning",languageList.EMDDurationGreaterThanZero),!1}else return $(t).data("invalid-finetuning",languageList.EMDDurationMustBeNumber),!1;else if(r=="AccelDuration")if($.isNumeric(c.val())){if(u<=0)return $(t).data("invalid-finetuning",languageList.EMDAccellerationDurationGreaterThanZero),!1}else return $(t).data("invalid-finetuning",languageList.EMDAccellerationDurationMustBeNumber),!1;else if(r=="DecelDuration")if($.isNumeric(l.val())){if(f<=0)return $(t).data("invalid-finetuning",languageList.EMDDecelerationDurationGreaterThanZero),!1}else return $(t).data("invalid-finetuning",languageList.EMDDecelerationDurationMustBeNumber),!1;return r!="Duration"&&o&&o!=0&&Number(u)+Number(f)>o?($(t).data("invalid-finetuning",languageList.EMDAccelDecelExcedDurationWarning),!1):!0});$.validator.unobtrusive.adapters.add("finetuningdurationcheck",function(n){n.rules.finetuningdurationcheck=0;n.messages.finetuningdurationcheck=function(){return String($(n.element).data("invalid-finetuning"),function(n){return entityMap[n]})}});$.validator.addMethod("temperaturerangecheck",function(n,t){var u=$(t).attr("id"),i=$("#MinTemperature").valNum(),r=$("#MaxTemperature").valNum();if(u=="MinTemperature"){if(!$.isNumeric(i))return $(t).data("invalid-temperaturerange",inputMaskOverride),!1}else if(u=="MaxTemperature"&&!$.isNumeric(r))return $(t).data("invalid-temperaturerange",inputMaskOverride),!1;return i&&r&&Number(i)>Number(r)?($(t).data("invalid-temperaturerange",languageList.PDNTemperatureErrorMessageMinLessMax),!1):!0});$.validator.unobtrusive.adapters.add("temperaturerangecheck",function(n){n.rules.temperaturerangecheck=0;n.messages.temperaturerangecheck=function(){return String($(n.element).data("invalid-temperaturerange"),function(n){return entityMap[n]})}});$.validator.addMethod("leveranglenotequalcheck",function(n,t){var u=$(t).attr("id"),i=numberParser.parse($("#LeverStartAngle").val()),r=numberParser.parse($("#LeverFinishAngle").val()),e=$("#LeverStartAngle").val(),o=$("#LeverFinishAngle").val(),f;if(u=="LeverStartAngle"){if(!$.isNumeric(e))return $(t).data("invalid-leveranglenotequal",inputMaskOverride),!1}else if(u=="LeverFinishAngle"&&!$.isNumeric(o))return $(t).data("invalid-leveranglenotequal",inputMaskOverride),!1;if(!isNaN(i)&&!isNaN(r)){if(i=numberParser.parse(i),r=numberParser.parse(r),i==r)return $(t).data("invalid-leveranglenotequal",languageList.PDNAOMLeverStartEndAngleError),!1;if(f=r<i?Math.max(-.001,i-180):i+180,f>r)return $(t).data("invalid-leveranglenotequal",languageList.PDNAOMAngleError),!1}return!0});$.validator.unobtrusive.adapters.add("leveranglenotequalcheck",function(n){n.rules.leveranglenotequalcheck=0;n.messages.leveranglenotequalcheck=function(){return String($(n.element).data("invalid-leveranglenotequal"),function(n){return entityMap[n]})}});$.validator.addMethod("externalstopstrokelengthcheck",function(n,t){var f=$(t).attr("id"),r=numberParser.parse($("#ExternalForces_ExternalStopEnd").val()),u=numberParser.parse($("#MotionDetails_StrokeLength").val()),i,e;if(f=="ExternalForces_ExternalStopEnd"){if(r.length>0&&!$.isNumeric(r))return $(t).data("invalid-externalstopstrokelength",inputMaskOverride),!1}else if(f=="MotionDetails_StrokeLength"&&u.length>0&&!$.isNumeric(u))return $(t).data("invalid-externalstopstrokelength",inputMaskOverride),!1;if(r&&u&&(i=$("#ExternalStopEndUnit").text(),e=$("#MotionDetails_StrokeLengthUnit_SelectedUnit :selected").text().trim(),i=i.replace(/\(|\)/g,""),i!=" ")){var o=UnitConversionEncodeUnit(e),s=UnitConversionEncodeUnit(i),h=math.unit(Number(r),s),c=h.toNumber(o);if(c>Number(u))return $(t).data("invalid-externalstopstrokelength",languageList.PDNExternalStopEndExceedsStrokeLengthError),!1}return!0});$.validator.unobtrusive.adapters.add("externalstopstrokelengthcheck",function(n){n.rules.externalstopstrokelengthcheck=0;n.messages.externalstopstrokelengthcheck=function(){return String($(n.element).data("invalid-externalstopstrokelength"),function(n){return entityMap[n]})}});$.validator.addMethod("externalstopstartstrokelengthcheck",function(n,t){var f=$(t).attr("id"),r=numberParser.parse($("#ExternalForces_ExternalStopStart").val()),u=numberParser.parse($("#MotionDetails_StrokeLength").val()),i,e;if(f=="ExternalForces_ExternalStopStart"){if(r.length>0&&!$.isNumeric(r))return $(t).data("invalid-externalstopstartstrokelength",inputMaskOverride),!1}else if(f=="MotionDetails_StrokeLength"&&u.length>0&&!$.isNumeric(u))return $(t).data("invalid-externalstopstartstrokelength",inputMaskOverride),!1;if(r&&u&&(i=$("#ExternalStopStartUnit").text(),e=$("#MotionDetails_StrokeLengthUnit_SelectedUnit").val(),i=i.replace(/\(|\)/g,""),i!=" ")){var o=UnitConversionEncodeUnit(e),s=UnitConversionEncodeUnit(i),h=math.unit(Number(r),s),c=h.toNumber(o);if(c>Number(u))return $(t).data("invalid-externalstopstartstrokelength",languageList.PDNExternalStopStartExceedsStrokeLengthError),!1}return!0});$.validator.unobtrusive.adapters.add("externalstopstartstrokelengthcheck",function(n){n.rules.externalstopstartstrokelengthcheck=0;n.messages.externalstopstartstrokelengthcheck=function(){return String($(n.element).data("invalid-externalstopstartstrokelength"),function(n){return entityMap[n]})}});$.validator.addMethod("externalstopstartendlengthcheck",function(n,t){var e=$(t).attr("id"),u=$("#ExternalForces_ExternalStopStart").val(),f=$("#ExternalForces_ExternalStopEnd").val(),i,r;if(e=="ExternalForces_ExternalStopStart"){if(u.length>0&&!$.isNumeric(u))return $(t).data("invalid-externalstopstartendlength",inputMaskOverride),!1}else if(e=="ExternalForces_ExternalStopEnd"&&f.length>0&&!$.isNumeric(f))return $(t).data("invalid-externalstopstartendlength",inputMaskOverride),!1;if(u&&f&&(i=$("#ExternalStopStartUnit").text(),r=$("#ExternalStopStartUnit").text(),i=i.replace(/\(|\)/g,""),r=r.replace(/\(|\)/g,""),i!=" "&&r!=" ")){var o=UnitConversionEncodeUnit(r),s=UnitConversionEncodeUnit(i),h=math.unit(numberParser.parse(u),s),c=h.toNumber(o);if(c>numberParser.parse(f))return $(t).data("invalid-externalstopstartendlength",languageList.PDNExternalStopStartExceedsStopEndError),!1}return!0});$.validator.unobtrusive.adapters.add("externalstopstartendlengthcheck",function(n){n.rules.externalstopstartendlengthcheck=0;n.messages.externalstopstartendlengthcheck=function(){return String($(n.element).data("invalid-externalstopstartendlength"),function(n){return entityMap[n]})}});$.validator.addMethod("minimumspeedthreshold",function(n,t){var c=$("#globalUnitType").is(":checked")?"imperial":"metric",e,o,s,h;if($("#MotionDetails_StrokeLength").val()!=undefined){var l=numberParser.parse($("#MotionDetails_StrokeLength").val()),a=$("#MotionDetails_StrokeLengthUnit_SelectedUnit :selected").text().trim(),v=UnitConversionEncodeUnit(a),u=UnitConversionEncodeUnit("mm"),y=math.unit(Number(l),v),f=y.toNumber(u),p=numberParser.parse(n),i=numberParser.parse($("#ExternalForces_ExternalStopStart").val()),r=numberParser.parse($("#ExternalForces_ExternalStopEnd").val());return i||(i=0),r||(r=0),e=UnitConversionEncodeUnit("mm"),o=UnitConversionEncodeUnit("mm"),c=="imperial"&&(e=UnitConversionEncodeUnit("in"),o=UnitConversionEncodeUnit("in")),startoldUnitObj=math.unit(numberParser.parse(i),e),i=startoldUnitObj.toNumber(u),startoldUnitObj=math.unit(numberParser.parse(r),o),r=startoldUnitObj.toNumber(u),s=i===r?f:f-i-(f-r),h=s/p,h>=50.8?!0:($(t).data("invalid-minimumspeedthreshold",languageList.PDNMinimumSpeedThreshold),!1)}return!0});$.validator.unobtrusive.adapters.add("minimumspeedthreshold",function(n){n.rules.minimumspeedthreshold=0;n.messages.minimumspeedthreshold=function(){return String($(n.element).data("invalid-minimumspeedthreshold"),function(n){return entityMap[n]})}});$.validator.addMethod("greaterthan",function(n,t,i){return numberParser.parse(n)>numberParser.parse(i)});$.validator.unobtrusive.adapters.add("greaterthan",["value"],function(n){n.rules.greaterthan=n.params.value;n.messages.greaterthan=n.message});$.validator.addMethod("greaterthanorequalto",function(n,t,i){return numberParser.parse(n)>=numberParser.parse(i)});$.validator.unobtrusive.adapters.add("greaterthanorequalto",["value"],function(n){n.rules.greaterthanorequalto=n.params.value;n.messages.greaterthanorequalto=n.message});$.validator.addMethod("extendedvalidation",function(n,t,i){for(var y=JSON.parse(i),r,u,l,e,o,f,a,c=0;c<y.length;c++)if(r=y[c],r.type=="TwoField"){if(u=!1,l=$(r.parameters.otherpropertyname).val(),n.trim()==""||l.trim()=="")u=!0;else if($.isNumeric(n)&&$.isNumeric(l)){e=numberParser.parse(n);o=numberParser.parse(l);switch(r.parameters.operator){case"=":u=e==o;break;case"!=":case"<>":u=e!=o;break;case"<":u=e<o;break;case"<=":u=e<=o;break;case">":u=e>o;break;case">=":u=e>=o}}if(!u)return $(t).attr("data-val-extendedvalidation",r.message),!1}else if(r.type=="SingleUnitFeild"){if(f=!1,a=r.parameters.comparevalue,n.trim()=="")f=!0;else if($.isNumeric(n)&&$.isNumeric(a)){var s=numberParser.parse(n),h=numberParser.parse(a),w=$(t),b=w.attr("id"),v=b.replace("_Value","_UnitSelected"),k=r.parameters.compareunit,d=$("select#"+v),g=$("select#"+v+" option:selected"),nt=g.val(),tt=$("select#"+v+" option:contains("+k+")").val(),p=d.attr("data-changefunc");p!=""&&p!=undefined;switch(r.parameters.operator){case"=":f=s==h;break;case"!=":case"<>":f=s!=h;break;case"<":f=s<h;break;case"<=":f=s<=h;break;case">":f=s>h;break;case">=":f=s>=h}}if(!f)return $(t).attr("data-val-extendedvalidation",r.message),!1}else return $(t).attr("data-val-extendedvalidation",languageList.ValidatorUndefinedRule+" "+r.type),!1;return!0});$.validator.unobtrusive.adapters.add("extendedvalidation",["rules"],function(n){n.rules.extendedvalidation=n.params.rules;n.messages.extendedvalidation=function(n,t){return $(t).attr("data-val-extendedvalidation")}}),function(n){n.fn.multiple_emails=function(t){var i=n.extend({},{checkDupEmail:!0,theme:"Bootstrap",position:"top"},t),r="";return i.theme.toLowerCase()=="Bootstrap".toLowerCase()?r='<a href="#" class="multiple_emails-close" title="'+pageGlobal.languageList.Remove+'"><span class="glyphicon glyphicon-remove"><\/span><\/a>':i.theme.toLowerCase()=="SemanticUI".toLowerCase()||i.theme.toLowerCase()=="Semantic-UI".toLowerCase()||i.theme.toLowerCase()=="Semantic UI".toLowerCase()?r='<a href="#" class="multiple_emails-close" title="'+pageGlobal.languageList.Remove+'"><i class="remove icon"><\/i><\/a>':i.theme.toLowerCase()=="Basic".toLowerCase()&&(r='<a href="#" class="multiple_emails-close" title="'+pageGlobal.languageList.Remove+'"><i class="basicdeleteicon">'+pageGlobal.languageList.Remove+"<\/i><\/a>"),this.each(function(){function c(n){var t=n?'checked="checked"':"",i=n?"":'checked="checked"';return'<td align="center"><input type="radio" name="perm'+u+'" value="edit" style="width: auto; margin-bottom: auto; cursor: default;" '+t+'/><\/td><td align="center"><input type="radio" name="perm'+u+'" value="view" style="width: auto; margin-bottom: auto; cursor: default;" '+i+"/><\/td>"}function h(i,e){var s=i.val().trim().replace(/^,|,$/g,"").replace(/^;|;$/g,""),l,a,h;for(s=s.replace(/"/g,""),s=s.split(/[\s,;]+/),l=[],a=new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i),h=0;h<s.length;h++)e===!0&&o.val().indexOf(s[h])!=-1?s[h]&&s[h].length>0&&new function(){var n=t.find(".email_name[data-email="+s[h].toLowerCase().replace(".","\\.").replace("@","\\@")+"]");n.css("font-weight","bold");setTimeout(function(){n.css("font-weight","")},1500)}:a.test(s[h])==!0?(t.append(n('<tr class="multiple_emails-email" data-row-index="'+u+'"><td><span class="email_name" data-email="'+s[h].toLowerCase()+'">'+s[h]+"<\/span><\/td><\/tr>")),n("<td>"+r+"<\/td>").insertBefore(t.find("tr:last td:first")).click(function(t){n(this).parent().remove();f();t.preventDefault()}),n(c(!0)).insertAfter(t.find("tr:last td:last")).change(function(){f()}),u++):l.push(s[h]);l.length>0?i.val(l.join("; ")).addClass("multiple_emails-error"):i.val("");f()}function f(){var t=[],i=o.siblings(".multiple_emails-container");i.find(".multiple_emails-email").each(function(){t.push({email:n(this).find("span.email_name").html(),permission:n(this).find('input[type="radio"]:checked').val()})});o.val(JSON.stringify(t)).trigger("change")}function y(n){try{JSON.parse(n)}catch(t){return!1}return!0}var o=n(this),u=0,t=n('<table class="multiple_emails-ul" style="width:100%"><\/table>'),e,s;t.append(n('<tr><th width="32"><\/th><th>'+pageGlobal.languageList.Email+'<\/th><th align="center" style="width: 5em; text-align:center;">'+pageGlobal.languageList.Edit+'<\/th><th align="center" style="width: 5em; text-align:center;">'+pageGlobal.languageList.View+"<\/th><\/tr>"));var v=jQuery.parseJSON(n(this).val()),l=[],a=[];return n.each(v,function(t,i){n.inArray(i.email,l)==-1&&(l.push(i.email),a.push(i))}),n(this).val()!=""&&y(n(this).val())&&n.each(a,function(i,e){t.append(n('<tr class="multiple_emails-email" data-row-index="'+u+'"><td><span class="email_name" data-email="'+e.email.toLowerCase()+'">'+e.email+"<\/span><\/td><\/tr>"));n("<td>"+r+"<\/td>").insertBefore(t.find("tr:last td:first")).click(function(t){n(this).parent().remove();f();t.preventDefault()});n(c(e.permission=="edit")).insertAfter(t.find("tr:last td:last")).change(function(){f()});u++}),e=n('<input type="text" class="multiple_emails-input text-left" placeholder="'+pageGlobal.languageList.EmailPlaceholder+'" />').on("keyup",function(t){n(this).removeClass("multiple_emails-error");var u=n(this).val().length,r;window.event?r=t.keyCode:t.which&&(r=t.which);r==9||r==32||r==188?h(n(this),i.checkDupEmail):r==13&&(h(n(this),i.checkDupEmail),t.preventDefault())}).on("blur",function(){n(this).val()!=""&&h(n(this),i.checkDupEmail)}),s=n('<div class="multiple_emails-container" />').click(function(){e.focus()}),i.position.toLowerCase()==="top"?s.append(t).append(e).insertAfter(n(this)):s.append(e).append(t).insertBefore(n(this)),n(this).hide()})}}(jQuery),function(n){var t=!1,r,i;typeof define=="function"&&define.amd&&(define(n),t=!0);typeof exports=="object"&&(module.exports=n(),t=!0);t||(r=window.Cookies,i=window.Cookies=n(),i.noConflict=function(){return window.Cookies=r,i})}(function(){function n(){for(var n=0,r={},t,i;n<arguments.length;n++){t=arguments[n];for(i in t)r[i]=t[i]}return r}function t(i){function r(t,u,f){var o,h,l,e,s;if(typeof document!="undefined"){if(arguments.length>1){f=n({path:"/"},r.defaults,f);typeof f.expires=="number"&&(h=new Date,h.setMilliseconds(h.getMilliseconds()+f.expires*864e5),f.expires=h);try{o=JSON.stringify(u);/^[\{\[]/.test(o)&&(u=o)}catch(y){}return u=i.write?i.write(u,t):encodeURIComponent(String(u)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape),document.cookie=[t,"=",u,f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":""].join("")}t||(o={});for(var a=document.cookie?document.cookie.split("; "):[],v=/(%[0-9A-Z]{2})+/g,c=0;c<a.length;c++){l=a[c].split("=");e=l.slice(1).join("=");e.charAt(0)==='"'&&(e=e.slice(1,-1));try{if(s=l[0].replace(v,decodeURIComponent),e=i.read?i.read(e,s):i(e,s)||e.replace(v,decodeURIComponent),this.json)try{e=JSON.parse(e)}catch(y){}if(t===s){o=e;break}t||(o[s]=e)}catch(y){}}return o}}return r.set=r,r.get=function(n){return r.call(r,n)},r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,i){r(t,"",n(i,{expires:-1}))},r.withConverter=t,r}return t(function(){})});numberParser=new parseDecimalNumber;$(document).ready(function(){UnitConversionInstall()})