function AllowOnlyDeleteBackspaceAndArrows(n){n.keyCode>=37&&n.keyCode<=40||n.keyCode!==8&&n.keyCode!==46&&n.preventDefault()}function GetFormattedDate(n){var r,t,i;return r=$(n).prop("type")!="date"?$(n).datepicker("getDate"):$.datepicker.parseDate("yy-mm-dd",$(n).val()),t=r.getMonth()+1,t<10&&(t="0"+t),i=r.getDate(),i<10&&(i="0"+i),t+"/"+i+"/"+r.getFullYear()}function ValidateLicenseeData(n){(n==null||n==undefined||n.length==0)&&AHRICommonJsFunctions.getInstance().SetAutoCompleteValue("ManufacturerAC",[""])}function ValidateStartAndEndDates(n,t){if(n.length<=0||t<=0)return!0;var i=new Date(n),r=new Date(t);return i>r?(alert("Start Date should be less than End Date"),!1):!0}function RadioApplyEvents(){SetRadioPropertiesOnLoad();GlpPriceEditableAndSetMatrixHeaderString();SetQuoteCoverValuesOnLoad(1);$(".userselections").mousedown(function(){$(this).attr("previous-value",$(this).prop("checked"))});$(".userselections").click(function(){var n=parseInt($(this).attr("headerlevelid"));SetRadioPropertiesOnClick(this,n);GlpPriceEditableAndSetMatrixHeaderString()})}function SetRadioPropertiesOnClick(n,t){var f,r,i;$(n).attr("previous-value").toLowerCase()=="true"&&$(n).prop("checked",!1);var o=$(n).prop("checked"),u=t+1,s=$(n).attr("id"),e=parseInt($("#hdnTotalNoOfLevels").val());if(o)for(f=!1,$(".userselections").each(function(){var i,n;if($(this).attr("headerlevelid")==u)$(this).attr("isDisabled")?($(this).prop("checked",!1),$(this).attr("disabled","disabled")):$(this).removeAttr("disabled");else if($(this).attr("headerlevelid")==t)if(i=$(this).prop("exceptionId")!=undefined?$(this).prop("exceptionId").split("~"):$(this).attr("exceptionId").split("~"),$(this).attr("id")==s)for(n=0;n<i.length;n++)$("#"+i[n]).attr("isDisabled",!0),$("#"+i[n]).prop("checked",!1),$("#"+i[n]).attr("disabled","disabled");else for(n=0;n<i.length;n++)$("#"+i[n]).removeAttr("isDisabled"),$("#"+i[n]).removeAttr("disabled")}),i=u+1;i<=e;i++)f?$(".userselections[headerlevelid="+i+"]").each(function(){$(this).prop("checked",!1);$(this).attr("disabled","disabled")}):(r=!1,$(".userselections[headerlevelid="+i+"]").each(function(){r||(r=$(this).prop("checked"))}),f=!r);else for(i=u;i<=e;i++)$(".userselections[headerlevelid="+i+"]").each(function(){$(this).prop("checked",!1);$(this).attr("disabled","disabled")})}function SetQuoteCoverValuesOnLoad(){$("#divMatrix :radio:checked").each(function(){var n=$(this).attr("headerlevelid"),t=$(this).attr("modelPrefix"),i=$(this).attr("levelItemDescription"),r=$("#spnCalculatedGLP").text();SetQuoteCoverValues(n,t,i,r)})}function SetRadioPropertiesOnLoad(){for(var t,r=parseInt($("#hdnTotalNoOfLevels").val()),i=!1,n=1;n<=r;n++)i?$(".userselections[headerlevelid="+n+"]").each(function(){$(this).prop("checked",!1);$(this).attr("disabled","disabled")}):(t=!1,$(".userselections[headerlevelid="+n+"]").each(function(){var i,n;if(!t)if($(this).attr("previous-value").toLowerCase()=="true"&&($(this).prop("checked",!0),t=!0),i=$(this).prop("exceptionId")!=undefined?$(this).prop("exceptionId").split("~"):$(this).attr("exceptionId").split("~"),$(this).prop("checked"))for(n=0;n<i.length;n++)$("#"+i[n]).attr("isDisabled",!0),$("#"+i[n]).prop("checked",!1),$("#"+i[n]).attr("disabled","disabled");else for(n=0;n<i.length;n++)$("#"+i[n]).removeAttr("isDisabled"),$("#"+i[n]).removeAttr("disabled")}),t||(i=!0))}function GlpPriceEditableAndSetMatrixHeaderString(){var n=$("#spnMatrixNameFromDb").html(),t=[],i=parseFloat($("#spnBaseModelGLP").text().replace("$","").replace(",",""));$(".userselections").each(function(){$(this).attr("IsCbarF")&&$(this).prop("checked")?$($(this).context.parentElement.parentElement).find("input[type='text']").removeAttr("onkeydown"):$($(this).context.parentElement.parentElement).find("input[type='text']").attr("onkeydown","javascript:return false;");$(this).prop("checked")&&(t.push(new UserSelections(this.getAttribute("modelPrefix"),this.value)),i+=parseFloat(this.getAttribute("glp")))});$("#spnCalculatedGLP").html("$"+i.formatMoney(2));$(t).each(function(){n+=this.ModelPrefix+"-"});$("#spnUserSelectionString").html(n.substr(0,n.length-1))}function SetQuoteCoverValues(n,t,i,r){var u="GvQuotationSummary";setGridColumnValueByNameInCurrency(u,n,"txtModelOptionValue","INPUT",t);setGridColumnValueByNameInCurrency(u,n,"lblModelLvelDescription","SPAN",i);$(".calculatedGLPText").val(r)}function setGridColumnValueByNameInCurrency(n,t,i,r,u){var o=getGridRow(n,t),f,e;if(null!=o&&(f=o.getElementsByTagName(r),f.length>0))for(e=0;e<f.length;e++)f[e].type=="text"?f[e].id.indexOf(i)>0&&(f[e].value=u):f[e].tagName=="SPAN"?f[e].id.indexOf(i)>0&&(f[e].innerHTML=u):f[e].tagName=="A"?f[e].id.indexOf(i)>0&&(f[e].innerText=u):f[e].type=="hidden"&&f[e].id.indexOf(i)>0&&(f[e].value=u);return null}function getGridRow(n,t){return(gridViewCtl=document.getElementById(n),null!=gridViewCtl)?gridViewCtl.rows[t]:null}function MatrixAppendDoller(n){var t=$(n).val()==""?0:parseFloat($(n).val().replace("$","").replace(/,/g,""));$($(n).context.parentElement.parentElement).find(".userselections").attr("glp",t);$(n).val("$"+t.formatMoney(2));SetMatrixHeaderString()}function SetMatrixHeaderString(){var n=$("#spnMatrixNameFromDb").html(),t=[],i=parseFloat($("#spnBaseModelGLP").text().replace("$","").replace(",",""));$(".userselections").each(function(){$(this).prop("checked")&&(t.push(new UserSelections(this.getAttribute("modelPrefix"),this.value)),i+=parseFloat(this.getAttribute("glp")))});$("#spnCalculatedGLP").html("$"+i.formatMoney(2));$(t).each(function(){n+=this.ModelPrefix+"-"});$("#spnUserSelectionString").html(n.substr(0,n.length-1))}var AHRICommonJsFunctions=function(n,t){function f(){function s(){var t=$(n).innerWidth();t<=r?$(".leftHeaderLogo").find("img:eq(0)").attr({src:"~/Content/Images/AHRI_Ph.png",style:"height:50px; width:130px"}):t>r&&t<=u?$(".leftHeaderLogo").find("img:eq(0)").attr({src:"~/Content/Images/AHRI_Tb.png",style:"height:50px; width:160px"}):$(".leftHeaderLogo").find("img:eq(0)").attr({style:"height:80px; width:196px"})}function h(t){var i=$(n).innerWidth();i<=r&&(typeof t=="function"?t(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]):Array.isArray(t)&&$.each(t,function(n){n()}))}function c(t){var i=$(n).innerWidth();i<=u&&(typeof t=="function"?t(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]):Array.isArray(t)&&$.each(t,function(n){n()}))}function l(t){var i=$(n).innerWidth();i>u&&(typeof t=="function"?t(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]):Array.isArray(t)&&$.each(t,function(n){n()}))}function a(){}function e(n,t){if($.isArray(t)){n.indexOf("#")<0&&(n="#"+n);var i=$(n).attr("bindingPropertyName");$("input[type=hidden][id="+i+"]").val("").val(t.join(","))}else console.log("arrayOfValues parameter for the function in setAutoCompleteValue is not an array")}function v(n){e(n,[""])}function o(t,r,u,e,o,s,h,c){$.ajax({url:t,type:r,contentType:"application/json; charset=utf-8",data:u,dataType:e==null||typeof e=="undefined"?"json":e,beforeSend:function(){typeof o=="function"&&o()},success:function(t){if(i(),typeof s=="function"){try{XMLHttpRequest.status==401&&n.location.replace("/Logon/LogOut");s(t)}catch(r){}typeof c=="function"&&c(t)}},error:function(t,r,u){i();typeof h=="function"?(XMLHttpRequest.status==401&&n.location.replace("/Logon/LogOut"),h(t,r,u)):(XMLHttpRequest.status==401&&n.location.replace("/Logon/LogOut"),f())}})}function y(n,t,r,u,e,o,s,h){$.ajax({url:n,type:t,contentType:"application/json; charset=utf-8",data:r,async:!1,dataType:u==null||typeof u=="undefined"?"json":u,beforeSend:function(){typeof e=="function"&&e()},success:function(n){i();typeof o=="function"&&(o(n),typeof h=="function"&&h(n))},error:function(n,t,r){i();typeof s=="function"?s(n,t,r):f()}})}function p(n,t,i,r,u){var f,e;console.log(typeof i);f={};typeof i=="function"&&(f=i(),console.log(f));e={searchText:t,ananymousObject:JSON.stringify(f)};console.log(e);o(n,"GET",e,"json",null,r,null,u)}function w(n,t){$("#"+t).val($(n).val())}function b(n,t,i){n.indexOf("#")<0&&(n="#"+n);t||($(n).find('option[value=""]').length==0?$(n).find("option").remove():$(n).find('option[value!=""]').remove());$.each(i,function(t,i){$(n).append($("<option><\/option>").attr("value",i.id).text(i.label))})}function k(n,t,i){$("div.loading-overlay").height($("#"+n).height());$("div.loading-overlay").find("div.loading-overlay-content").text(i);$("#"+n+"_loading-overlay").length<=0?$("#"+n).loading({stoppable:t,message:i,theme:"dark"}):$("#"+n+"_loading-overlay").show()}function i(){$(".loading-overlay").hide()}function d(n,t){var r=$("#StatusSection"),i=r.find('div[role="alert"]'),u;if(i.length==0){var f=$("<span><\/span>").html("&times;"),e=$("<button><\/button>").append(f.attr("area-hidden","false")),o=$("<div><\/div>").append(e.attr({"class":"close","data-dismiss":"alert","aria-label":"Close"})).attr({"class":"alert alert-dismissable",role:"alert"}),s=$("<div><\/div>").append(o).attr("class","col-md-12");r.append(s);i=r.find('div[role="alert"]')}i.children("span").remove();u="color:#468847 !important";n?i.removeClass("alert-danger").addClass("alert-success"):(i.removeClass("alert-success").addClass("alert-danger"),u="color:rgba(168, 68, 66, 1) !important");i.append($("<span><\/span>").attr({style:u}).text(t));r.show()}function g(){var n=[];(function(){var t;$("select").on("focus",function(){t=this.value}).change(function(){n.push(t);t=this.value})})();$("li > a, a").on("click",function(){AHRICommon.HideProgressbar();$("[type = text]").each(function(){this.value!=""&&($("#SaveChangesModal").modal(),event.preventDefault())});$("option").each(function(){var t=$.inArray($(this).val(),n);t>-1&&(AHRICommon.HideProgressbar(),$("#SaveChangesModal").modal(),event.preventDefault())})})}var nt=function(n){return n},tt=function(){var i=null,n=null,t=null;return{assignProgramFunctionField:function(r,u,f,e){i=r;n=$("#"+f);t=$("#"+u);r!=null&&r.length>0&&AHRICommonJsFunctions.getInstance().DoAsyncCall(r,"POST",JSON.stringify({inputValue:[t.val(),$("#ProgramId").val()],functionName:e}),"Json",null,this.onSuccess,this.onFailure,null)},onSuccess:function(t){n!=null&&n.length>0&&n.val(t.Result)},onFailure:function(){i=null;n=null;t=null}}},it=function(n,t,i,r){if(n!=null&&n.length>0){var u=n.indexOf(",")==-1?$("#"+n):$(n);u.length>0&&u.numeric({decimal:t,negative:i,decimalPlaces:r})}},rt=function(n,t,i){if(t!=null&&t.length>0){var r=t.split(",");r.length>0&&$.each(r,function(t,r){if($("input:radio[name="+n.id+"]:checked").val()=="1")$("#"+r).removeAttr("disabled"),$("#"+r).attr("disabled",!1),$("#"+r).attr("required",!0),$("input:radio[name="+r+"]").attr("disabled",!1),$("input:radio[name="+r+"]").removeAttr("disabled"),$("input:radio[name="+r+"]").attr("required",!0);else if($("#"+r).attr("disabled",!0),$("#"+r).removeAttr("required"),$("input:radio[name="+r+"]").attr("disabled",!0),$("input:radio[name="+r+"]").removeAttr("required"),i=="1"){var u=document.getElementById(r);u&&(u.tagName.toUpperCase()=="SELECT"?$("#"+r+" option:selected").removeAttr("selected"):u.type.toUpperCase()=="RADIO"?$("input:radio[name="+r+"]").prop("checked",!1):$("#"+r).val(""))}})}},ut=function(n,t,i){if(t!=null&&t.length>0){var r=t.split(",");r.length>0&&$.each(r,function(t,r){if($("input:radio[name="+n.id+"]:checked").val()=="1")$("#"+r).attr("disabled",!1);else if($("#"+r).attr("disabled",!0),i=="1"){var u=document.getElementById(r);u&&(u.tagName.toUpperCase()=="SELECT"?$("#"+r+" option:selected").removeAttr("selected"):u.type.toUpperCase()=="RADIO"?$("input:radio[name="+r+"]").prop("checked",!1):$("#"+r).val(""))}})}},ft=function(n,t){if(t!=null&&t.length>0){var i=t.split(",");i.length>0&&$.each(i,function(t,i){$("#"+n).val()!=""?$("#"+i).removeAttr("disabled"):($("#"+i).val(""),$("#"+i).attr("disabled",!0))})}},et=function(n,t,i,r,u){if(t!=null&&t.length>0){var t=t.split(",");t.length>0&&$.each(t,function(t,f){var o=$("#"+n+" option:selected").val(),s=!0,e;u==1&&$("#"+n+" option:selected").length!=1&&(s=!1);s&&i.indexOf(o)>=0&&o!=""?($("#"+f).removeAttr("disabled"),$("#"+f).attr("required",!0),$("input[name="+f+"]").removeAttr("disabled"),$("input[name="+f+"]").attr("required",!0)):($("#"+f).attr("disabled",!0),$("#"+f).removeAttr("required"),$("input[name="+f+"]").attr("disabled",!0),$("input[name="+f+"]").removeAttr("required"),r=="1"&&(e=document.getElementById(f),e&&(e.tagName.toUpperCase()=="SELECT"?$("#"+f+" option:selected").removeAttr("selected"):e.type.toUpperCase()=="RADIO"?$("input:radio[name="+f+"]").prop("checked",!1):$("#"+f).val(""))))})}},ot=function(n,t,i,r){if(t!=null&&t.length>0){var t=t.split(",");t.length>0&&$.each(t,function(t,u){var e=$("#"+n+" option:selected").val(),f;e!=""&&i.indexOf(e)>=0?($("#"+u).removeAttr("disabled"),$("input[name="+u+"]").removeAttr("disabled")):($("#"+u).attr("disabled",!0),$("#"+u).removeAttr("required"),$("input[name="+u+"]").attr("disabled",!0),$("input[name="+u+"]").removeAttr("required"),r=="1"&&(f=document.getElementById(u),f&&(f.tagName.toUpperCase()=="SELECT"?$("#"+u+" option:selected").removeAttr("selected"):f.type.toUpperCase()=="RADIO"?$("input:radio[name="+u+"]").prop("checked",!1):$("#"+u).val(""))))})}},st=function(n,t,i){if(n!=null&&n.length>0){var r="",u="",e=0,f=0,n=n.split(",");n.length>0&&$.each(n,function(n,o){if(r=t.split(";"),e=r.length,$.each(r,function(t,i){u=i.split(":");$("#"+u[n]).val()==u[1]?f++:f--}),f==e)$("#"+o).removeAttr("disabled"),$("#"+o).attr("required",!0),$("input[name="+o+"]").removeAttr("disabled"),$("input[name="+o+"]").attr("required",!0);else if($("#"+o).removeAttr("required"),$("#"+o).attr("disabled",!0),$("input[name="+o+"]").attr("disabled",!0),$("input[name="+o+"]").removeAttr("required"),i=="1"){var s=document.getElementById(o);s&&(s.tagName.toUpperCase()=="SELECT"?$("#"+o+" option:selected").removeAttr("selected"):s.type.toUpperCase()=="RADIO"?$("input:radio[name="+o+"]").prop("checked",!1):$("#"+o).val(""))}})}},ht=function(n,t,i){var e;if(n!=null&&n.length>0){var r="",u="",o=0,f=0;r=t.split(";");o=r.length;$.each(r,function(n,t){u=t.split(":");$("#"+u[0]).val()==u[1]?f++:f--});e=n.split(",");e.length>0&&$.each(e,function(n,t){if(f==o)$("#"+t).removeAttr("disabled"),$("#"+t).attr("required",!0),$("input[name="+t+"]").removeAttr("disabled"),$("input[name="+t+"]").attr("required",!0);else if($("#"+t).removeAttr("required"),$("input[name="+t+"]").removeAttr("required"),$("#"+t).attr("disabled",!0),i=="1"){var r=document.getElementById(t);r&&(r.tagName.toUpperCase()=="SELECT"?$("#"+t+" option:selected").removeAttr("selected"):r.type.toUpperCase()=="RADIO"?$("input:radio[name="+t+"]").prop("checked",!1):$("#"+t).val(""))}})}},ct=function(n,t,i,r,u,f){if(i!=null&&i.length>0){var i=i.split(",");i.length>0&&$.each(i,function(i,e){var s=$("#"+n+" option:selected").val(),h=$("#"+t+" option:selected").val(),o;s!=""&&h!=""&&r.indexOf(s)>=0&&u.indexOf(h)>=0?($("#"+e).removeAttr("disabled"),$("#"+e).attr("required",!0),$("input[name="+e+"]").removeAttr("disabled"),$("input[name="+e+"]").attr("required",!0)):($("#"+e).attr("disabled",!0),$("#"+e).removeAttr("required"),$("input[name="+e+"]").attr("disabled",!0),$("input[name="+e+"]").removeAttr("required"),f=="1"&&(o=document.getElementById(e),o&&(o.tagName.toUpperCase()=="SELECT"?$("#"+e+" option:selected").removeAttr("selected"):o.type.toUpperCase()=="RADIO"?$("input:radio[name="+e+"]").prop("checked",!1):$("#"+e).val(""))))})}},lt=function(n,t,i){if(t!=null&&t.length>0){var f,r="",e=0,u=0,t=t.split(",");f=n.split(";");e=f.length;$.each(f,function(n,t){var i;r=t.split(":");switch(r[2]){case"0":$("#"+r[0]).val()==r[1]?u++:u--;break;case"1":i=$("#"+r[0]+" option:selected").val();i==r[1]?u++:u--;break;case"2":i=$("input[name='"+r[0]+"']:checked").val();i==r[1]?u++:u--}});t.length>0&&$.each(t,function(n,t){if(u==e)$("#"+t).removeAttr("disabled"),$("#"+t).attr("required",!0),$("input[name="+t+"]").removeAttr("disabled"),$("input[name="+t+"]").attr("required",!0);else if($("#"+t).removeAttr("required"),$("#"+t).attr("disabled",!0),$("input[name="+t+"]").attr("disabled",!0),$("input[name="+t+"]").removeAttr("required"),i=="1"){var r=document.getElementById(t);r&&(r.tagName.toUpperCase()=="SELECT"?$("#"+t+" option:selected").removeAttr("selected"):r.type.toUpperCase()=="RADIO"?$("input:radio[name="+t+"]").prop("checked",!1):$("#"+t).val(""))}})}},at=function(n,t){if(t!=null&&t.length>0){var u,i="",f=0,r=0,t=t.split(",");u=n.split(";");f=u.length;$.each(u,function(n,t){var u;i=t.split(":");switch(i[2]){case"0":$("#"+i[0]).val()==i[1]?r++:r--;break;case"1":u=$("#"+i[0]+" option:selected").val();u==i[1]?r++:r--;break;case"2":u=$("input[name='"+i[0]+"']:checked").val();u==i[1]?r++:r--}});t.length>0&&$.each(t,function(n,t){r==f?($("#"+t).attr("disabled",!1),$("input[name="+t+"]").removeAttr("disabled")):($("#"+t).removeAttr("required"),$("#"+t).attr("disabled",!0),$("input[name="+t+"]").attr("disabled",!0),$("input[name="+t+"]").removeAttr("required"))})}},vt=function(n,t,i,r,u){if(i!=null&&i.length>0){var i=i.split(",");i.length>0&&$.each(i,function(i,f){var e=$("#"+n+" option:selected").val(),o=$("input[name='"+t+"']:checked").val();r.indexOf(e)>=0&&o==u?($("#"+f).removeAttr("disabled"),$("#"+f).attr("required",!0),$("input[name="+value+"]").removeAttr("disabled"),$("input:radio[name="+value+"]").attr("required",!0)):($("#"+f).attr("disabled",!0),$("#"+f).removeAttr("required"),$("input[name="+value+"]").attr("disabled",!0),$("input[name="+value+"]").removeAttr("required"))})}},yt=function(n,t){var r,i;t!=null&&t.length>0&&($("#"+n+" :selected").text()=="Draft"?(r=$(":input"),$.each(r,function(n,t){$("#"+t.id).removeAttr("required")})):(i=t.split(","),i.length>0&&$.each(i,function(n,t){$("#"+t).removeAttr("disabled");$("#"+t).attr("required",!0)})))},pt=function(n,t,i){if(t!=null&&t.length>0){var r=t.split(",");r.length>0&&$.each(r,function(t,r){var u=$("#"+r),f;$("input:radio[name="+n.id+"]:checked").val()=="1"?(u.removeAttr("disabled"),u.attr("required",!0),$("input:radio[name="+r+"]").removeAttr("disabled"),$("input:radio[name="+r+"]").attr("required",!0)):(u.attr("disabled",!0),u.removeAttr("required"),$("input:radio[name="+r+"]").attr("disabled",!0),$("input:radio[name="+r+"]").removeAttr("required"),i=="1"&&(f=document.getElementById(r),f&&(f.tagName.toUpperCase()=="SELECT"?$("#"+r+" option:selected").removeAttr("selected"):f.type.toUpperCase()=="RADIO"?$("input:radio[name="+r+"]").prop("checked",!1):u.val(""))))})}},wt=function(n,t){if(t!=null&&t.length>0){var i=t.split(",");i.length>0&&$.each(i,function(t,i){var r=$("#"+i),u;$("input:radio[name="+n.id+"]:checked").val()=="1"?(r.removeAttr("disabled"),r.attr("required",!0),$("input:radio[name="+i+"]").removeAttr("disabled"),$("input:radio[name="+i+"]").attr("required",!0)):(r.attr("disabled",!0),r.removeAttr("required"),$("input:radio[name="+i+"]").attr("disabled",!0),$("input:radio[name="+i+"]").removeAttr("required"),($("#ModelStatusId :selected").val()!="36"&&$("#ModelStatusId :selected").val()!="38"||$("#hdnSubmittoEnergyStar").val()!="True"&&$("#EnergyStarWithdrawalComments").val()=="")&&(u=document.getElementById(i),u&&(u.tagName.toUpperCase()=="SELECT"?$("#"+i+" option:selected").removeAttr("selected"):u.type.toUpperCase()=="RADIO"?$("input:radio[name="+i+"]").prop("checked",!1):r.val(""))))})}},bt=function(n,t,i){var f=$("#commandType").val(),e=$("#hdnRoleId").val(),r,u;t!=null&&t.length>0&&(r=[],i!=null&&i.length>0&&(r=i.split(",")),u=t.split(","),u.length>0&&$.each(u,function(t,i){var u=$("#"+i),s,o;$("input:radio[name="+n.id+"]:checked").val()!="1"||f!=1&&e==7?(u.attr("disabled",!0),u.removeAttr("required"),$("input:radio[name="+i+"]").attr("disabled",!0),$("input:radio[name="+i+"]").removeAttr("required"),($("#ModelStatusId :selected").val()!="36"&&$("#ModelStatusId :selected").val()!="38"||$("#hdnSubmittoEnergyStar").val()!="True"&&$("#EnergyStarWithdrawalComments").val()=="")&&(f!=1&&e==7||(o=document.getElementById(i),o&&(o.tagName.toUpperCase()=="SELECT"?$("#"+i+" option:selected").removeAttr("selected"):o.type.toUpperCase()=="RADIO"?$("input:radio[name="+i+"]").prop("checked",!1):u.val(""))))):(u.removeAttr("disabled"),$("input:radio[name="+i+"]").removeAttr("disabled"),s=!0,$.each(r,function(n,t){i==t&&(s=!1)}),s&&(u.attr("required",!0),$("input:radio[name="+i+"]").attr("required",!0)))}))},kt=function(n,t,i){var r,u,f;t!=null&&t.length>0&&(r=t.split(","),r.length>0&&n!=null&&n.length>0&&(u=!1,f=n.split(","),$.each(f,function(n,t){$("input:radio[name="+t+"]:checked").val()=="1"&&(u=!0)}),$.each(r,function(n,t){var r=$("#"+t),f;u?(r.removeAttr("disabled"),r.attr("required",!0),$("input:radio[name="+t+"]").removeAttr("disabled"),$("input:radio[name="+t+"]").attr("required",!0)):(r.attr("disabled",!0),r.removeAttr("required"),$("input:radio[name="+t+"]").attr("disabled",!0),$("input:radio[name="+t+"]").removeAttr("required"),i=="1"&&(f=document.getElementById(t),f&&(f.tagName.toUpperCase()=="SELECT"?$("#"+t+" option:selected").removeAttr("selected"):f.type.toUpperCase()=="RADIO"?$("input:radio[name="+t+"]").prop("checked",!1):r.val(""))))})))},dt=function(n,t,i){if(t!=null&&t.length>0){var r=t.split(",");r.length>0&&$.each(r,function(t,r){if($("input:radio[name="+n.id+"]:checked").val()=="0")$("#"+r).removeAttr("disabled"),$("#"+r).attr("required",!0),$("input:radio[name="+r+"]").removeAttr("disabled"),$("input:radio[name="+r+"]").attr("required",!0);else if($("#IsLocked").val()||$("#"+r).val(""),$("#"+r).attr("disabled",!0),$("#"+r).removeAttr("required"),$("input:radio[name="+r+"]").attr("disabled",!0),$("input:radio[name="+r+"]").removeAttr("required"),i=="1"){var u=document.getElementById(r);u&&(u.tagName.toUpperCase()=="SELECT"?$("#"+r+" option:selected").removeAttr("selected"):u.type.toUpperCase()=="RADIO"?$("input:radio[name="+r+"]").prop("checked",!1):$("#"+r).val(""))}})}},gt=function(n,t,i,r){var u,f;t!=null&&t.length>0&&(u=t.split(","),u.length>0&&$.each(u,function(t,i){if(($("#"+n).val()=="Cooling Only"||$("#"+n).val()=="Heating and Cooling")&&parseInt($("#AHRIType option:selected").val())>0)$("#"+i).removeAttr("disabled"),$("#"+i).attr("required",!0),$("input:radio[name="+i+"]").removeAttr("disabled"),$("input:radio[name="+i+"]").attr("required",!0);else if($("#"+i).attr("disabled",!0),$("#"+i).removeAttr("required"),$("input:radio[name="+i+"]").attr("disabled",!0),$("input:radio[name="+i+"]").removeAttr("required"),r=="1"){var u=document.getElementById(i);u&&(u.tagName.toUpperCase()=="SELECT"?$("#"+i+" option:selected").removeAttr("selected"):u.type.toUpperCase()=="RADIO"?$("input:radio[name="+i+"]").prop("checked",!1):$("#"+i).val(""))}}));i!=null&&i.length>0&&(f=i.split(","),f.length>0&&$.each(f,function(t,i){if(($("#"+n).val()=="Heating Only"||$("#"+n).val()=="Heating and Cooling")&&parseInt($("#AHRIType option:selected").val())>0)$("#"+i).removeAttr("disabled"),$("#"+i).attr("required",!0),$("input:radio[name="+i+"]").removeAttr("disabled"),$("input:radio[name="+i+"]").attr("required",!0);else if($("#IsLocked").val()||$("#"+i).val(""),$("#"+i).attr("disabled",!0),$("#"+i).removeAttr("required"),$("input:radio[name="+i+"]").attr("disabled",!0),$("input:radio[name="+i+"]").removeAttr("required"),r=="1"){var u=document.getElementById(i);u&&(u.tagName.toUpperCase()=="SELECT"?$("#"+i+" option:selected").removeAttr("selected"):u.type.toUpperCase()=="RADIO"?$("input:radio[name="+i+"]").prop("checked",!1):$("#"+i).val(""))}}))},ni=function(n,t,i,r,u){var f,e;i!=null&&i.length>0&&(f=i.split(","),f.length>0&&$.each(f,function(i,r){if(($("#"+t).val()=="Cooling Only"||$("#"+t).val()=="Heating and Cooling")&&$("input:radio[name="+n.id+"]:checked").val()=="1"&&$("#IsLocked").is(":checked")==!1&&parseInt($("#AHRIType option:selected").val())>0)$("#"+r).removeAttr("disabled"),$("#"+r).attr("required",!0),$("input:radio[name="+r+"]").removeAttr("disabled"),$("input:radio[name="+r+"]").attr("required",!0);else if($("#IsLocked").val()||$("#"+r).val(""),$("#"+r).attr("disabled",!0),$("#"+r).removeAttr("required"),$("input:radio[name="+r+"]").attr("disabled",!0),$("input:radio[name="+r+"]").removeAttr("required"),u=="1"){var f=document.getElementById(r);f&&(f.tagName.toUpperCase()=="SELECT"?$("#"+r+" option:selected").removeAttr("selected"):f.type.toUpperCase()=="RADIO"?$("input:radio[name="+r+"]").prop("checked",!1):$("#"+r).val(""))}}));r!=null&&r.length>0&&(e=r.split(","),e.length>0&&$.each(e,function(i,r){if(($("#"+t).val()=="Heating Only"||$("#"+t).val()=="Heating and Cooling")&&$("input:radio[name="+n.id+"]:checked").val()=="1"&&$("#IsLocked").is(":checked")==!1&&parseInt($("#AHRIType option:selected").val())>0)$("#"+r).removeAttr("disabled"),$("#"+r).attr("required",!0),$("input:radio[name="+r+"]").removeAttr("disabled"),$("input:radio[name="+r+"]").attr("required",!0);else if($("#IsLocked").val()||$("#"+r).val(""),$("#"+r).attr("disabled",!0),$("#"+r).removeAttr("required"),$("input:radio[name="+r+"]").attr("disabled",!0),$("input:radio[name="+r+"]").removeAttr("required"),u=="1"){var f=document.getElementById(r);f&&(f.tagName.toUpperCase()=="SELECT"?$("#"+r+" option:selected").removeAttr("selected"):f.type.toUpperCase()=="RADIO"?$("input:radio[name="+r+"]").prop("checked",!1):$("#"+r).val(""))}}))},ti=function(n,i,r,u){if(i!=null&&i.length>0){var i=i.split(","),e=$("#"+n).val(),r=r.split(","),f=!0;e!=t&&e!=null&&i.length>0&&r.length>0&&$.each(e,function(n,t){return $.each(r,function(n,i){if(t==i)return f=!0,!1;f=!1}),f?!1:void 0});$.each(i,function(n,t){if(f)$("#"+t).removeAttr("disabled"),$("#"+t).attr("required",!0),$("input[name="+t+"]").removeAttr("disabled"),$("input:radio[name="+t+"]").attr("required",!0);else if($("#"+t).attr("disabled",!0),$("#"+t).removeAttr("required"),$("input[name="+t+"]").attr("disabled",!0),$("input[name="+t+"]").removeAttr("required"),u=="1"){var i=document.getElementById(t);i&&(i.tagName.toUpperCase()=="SELECT"?$("#"+t+" option:selected").removeAttr("selected"):i.type.toUpperCase()=="RADIO"?$("input:radio[name="+t+"]").prop("checked",!1):$("#"+t).val(""))}})}},ii=function(n,i,r,u){if(i!=null&&i.length>0){var i=i.split(","),e=$("#"+n).val(),r=r.split(","),f=!0;e!=t&&e!=null&&i.length>0&&r.length>0&&$.each(e,function(n,t){return $.each(r,function(n,i){if(t==i)return f=!0,!1;f=!1}),f?!1:void 0});$.each(i,function(n,t){if(f)$("#"+t).removeAttr("disabled"),$("#"+t).attr("required",!1),$("input[name="+t+"]").removeAttr("disabled"),$("input:radio[name="+t+"]").attr("required",!1);else if($("#"+t).attr("disabled",!0),$("#"+t).removeAttr("required"),$("input[name="+t+"]").attr("disabled",!0),$("input[name="+t+"]").removeAttr("required"),u=="1"){var i=document.getElementById(t);i&&(i.tagName.toUpperCase()=="SELECT"?$("#"+t+" option:selected").removeAttr("selected"):i.type.toUpperCase()=="RADIO"?$("input:radio[name="+t+"]").prop("checked",!1):$("#"+t).val(""))}})}},f=function(){n.location.href="/Error/Show"},ri=function(n){var t=n.which?n.which:event.keyCode;return t>31&&(t<48||t>57)?(alert("Please enter numeric value"),!1):!0};return{UseResponsiveImages:s,ExecuteOnPhones:h,ExecuteOnTablets:c,ExecuteOnDesktops:l,GetAutoCompleteValue:a,SetAutoCompleteValue:e,OnChangeAutoCompleteValue:v,DoAsyncCall:o,DoSyncCall:y,AutoComplete:p,SetModelName:w,AddDropDownData:b,DummyFunction:nt,ShowOverlay:k,HideOverlay:i,ShowStatusMessage:d,ShowSavePlugIn:g,AssignValueToField:tt,AllowNumeric:it,EnableOrDisable:rt,AddOrRemoveRequired:yt,EnableOrDisableWithReq:pt,EnableorDisablewithReqSubmittoEnergyStar:wt,RoleBasedSubmittoEnergyStarEnableDisable:bt,EnableOrDisableWithReqCoolHeat:gt,EnableOrDisableWithReqCoolHeat2:ni,ShowErrorPage:f,isWholeNumber:ri,EnableOrDisableOnDropDown:et,EnableOrDisableOnTextBox:ft,EnableOrDisableOnDropDownWithTwo:ct,EnableOrDisableOnDropDownWithOpt:ot,EnableOrDisableWithNoReq:dt,EnableOrDisableOnMultipleFieldsWithValues:st,EnableordisableOnMultipleFieldsAlltypeWithValues:lt,EnableOrDisableWithOptional1:ut,EnableOrDisableOnMultipleFieldsWithValuesWithOptional:ht,EnableOrDisableOnSoldIn:ti,EnableordisableOnMultipleFieldsAlltypeWithOptional:at,EnableorDisableOnDropDownWithRadio:vt,EnableOrDisableWithReqForMultipleRadio:kt,EnableorDisableOnSoldInOptional:ii}}function e(){return i||(i=new f),i}var i=null,r=767,u=970;return{getInstance:e}}(window),AHRICommon;$(function(){$("a").click(function(){try{$("input:radio[name="+this.id+"]").is(":disabled")||($("input:radio[name="+this.id+"]").prop("checked",!1),$("input:radio[name="+this.id+"]").trigger("change"))}catch(n){}})});AHRICommon={ShowProgressbar:function(){$("#dvProgressBar").css("z-index","100000000000");$("#dvProgressBar").fadeIn(150)},HideProgressbar:function(){$("#dvProgressBar").fadeOut(150)}}