/*
 Copyright 2022 Mpowered Ventures Ltd.
 All rights reserved. info@mpowered.biz
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(b,a,d){b instanceof String&&(b=String(b));for(var c=b.length,e=0;e<c;e++){var h=b[e];if(a.call(d,h,e,b))return{i:e,v:h}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,a,d){if(b==Array.prototype||b==Object.prototype)return b;b[a]=d.value;return b};$jscomp.getGlobal=function(b){b=["object"==typeof globalThis&&globalThis,b,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var a=0;a<b.length;++a){var d=b[a];if(d&&d.Math==Math)return d}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(b,a){var d=$jscomp.propertyToPolyfillSymbol[a];if(null==d)return b[a];d=b[d];return void 0!==d?d:b[a]};
$jscomp.polyfill=function(b,a,d,c){a&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(b,a,d,c):$jscomp.polyfillUnisolated(b,a,d,c))};$jscomp.polyfillUnisolated=function(b,a,d,c){d=$jscomp.global;b=b.split(".");for(c=0;c<b.length-1;c++){var e=b[c];if(!(e in d))return;d=d[e]}b=b[b.length-1];c=d[b];a=a(c);a!=c&&null!=a&&$jscomp.defineProperty(d,b,{configurable:!0,writable:!0,value:a})};
$jscomp.polyfillIsolated=function(b,a,d,c){var e=b.split(".");b=1===e.length;c=e[0];c=!b&&c in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var h=0;h<e.length-1;h++){var l=e[h];if(!(l in c))return;c=c[l]}e=e[e.length-1];d=$jscomp.IS_SYMBOL_NATIVE&&"es6"===d?c[e]:null;a=a(d);null!=a&&(b?$jscomp.defineProperty($jscomp.polyfills,e,{configurable:!0,writable:!0,value:a}):a!==d&&($jscomp.propertyToPolyfillSymbol[e]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(e):$jscomp.POLYFILL_PREFIX+e,e=
$jscomp.propertyToPolyfillSymbol[e],$jscomp.defineProperty(c,e,{configurable:!0,writable:!0,value:a})))};$jscomp.polyfill("Array.prototype.find",function(b){return b?b:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");$jscomp.polyfill("Object.is",function(b){return b?b:function(a,b){return a===b?0!==a||1/a===1/b:a!==a&&b!==b}},"es6","es3");
$jscomp.polyfill("Array.prototype.includes",function(b){return b?b:function(a,b){var c=this;c instanceof String&&(c=String(c));var e=c.length;b=b||0;for(0>b&&(b=Math.max(b+e,0));b<e;b++){var d=c[b];if(d===a||Object.is(d,a))return!0}return!1}},"es7","es3");
$jscomp.checkStringArgs=function(b,a,d){if(null==b)throw new TypeError("The 'this' value for String.prototype."+d+" must not be null or undefined");if(a instanceof RegExp)throw new TypeError("First argument to String.prototype."+d+" must not be a regular expression");return b+""};$jscomp.polyfill("String.prototype.includes",function(b){return b?b:function(a,b){return-1!==$jscomp.checkStringArgs(this,a,"includes").indexOf(a,b||0)}},"es6","es3");window.dp_site_debug=!1;window.dp_site_formchg=!1;
function hndlEvntBeforeunload(b){if(window.dp_site_formchg)return(b||window.event).returnValue="You have some unsaved changes.",window.dp_site_debug&&console.log("in window.addEventListener('beforeunload'...: returning 'You have some unsaved changes.' which does the built-in ask"),"You have some unsaved changes.";window.dp_site_debug&&console.log("in window.addEventListener('beforeunload'...: returning undefined - which does NOT ask")}window.dp_paynow_clicked=!1;
document.addEventListener("visibilitychange",function(b){window.dp_site_debug&&console.log("Tab state: "+document.visibilityState);"visible"==document.visibilityState&&window.dp_paynow_clicked&&(window.dp_procmain("loadpage",["@@@SESSION_data_cp@@@"]),window.dp_paynow_clicked=!1)});var dp_timer,dp_timerTime,dpTimerTimeout=15;
function dp_checkTimer(){var b=new Date>dp_timerTime;window.clearTimeout(dp_timer);dp_timer=window.setTimeout(dp_checkTimer,5E3);window.dp_site_activity_chk&&b&&(window.clearTimeout(dp_timer),window.dp_site_activity_chk=!1,window.dp_site_debug&&console.log("checkTimer: "+(b?"Expired":"Valid")+", dp_site_activity_chk: "+(window.dp_site_activity_chk?"true":"false")),window.dp_procmain("loadpage",["010","@@@JS_Session_Expired@@@"]))}
function dp_updateTimerTimeout(b){window.dp_site_debug&&console.log("in dp_updateTimerTimeout("+parseInt(b,10)+")");dpTimerTimeout=parseInt(b,10)}function dp_updateTimer(){window.dp_site_activity_chk&&(dp_timerTime=new Date,dp_timerTime.setMinutes(dp_timerTime.getMinutes()+dpTimerTimeout),window.clearTimeout(dp_timer),dp_timer=window.setTimeout(window.dp_checkTimer,5E3))}
function dp_turnSessTimerOn(b){b?(window.dp_site_debug&&console.log("turning ON dp_site_activity_chk"),window.dp_turnOnActivityTimer()):(window.dp_site_debug&&console.log("turning OFF dp_site_activity_chk"),window.clearTimeout(dp_timer),window.dp_site_activity_chk=!1)}window.dp_site_activity_chk=!1;document.onmousemove=window.dp_updateTimer;document.onmouseup=window.dp_updateTimer;document.onkeypress=window.dp_updateTimer;
function dp_procmain(b,a){var d=window.getMobileOS();window.dp_site_debug&&console.log("in dp_procmain("+b+", "+a[0]+"); mobileOS: "+d);$(".modal-backdrop").remove();"loadpage"==b&&(window.dp_site_formchg=!1,window.removeEventListener("beforeunload",hndlEvntBeforeunload,!1),window.addEventListener("beforeunload",hndlEvntBeforeunload,!1),$("#loading-image").css("margin-top",Math.floor(window.innerHeight/2)-128+"px"),window.dp_site_debug&&console.log("screen: w/h: "+window.innerWidth+"px"+window.innerHeight+
"px"),window.addEventListener("orientationchange",function(){window.dp_site_debug&&console.log("screen: orientationchange: new w/h: "+window.innerWidth+"px"+window.innerHeight+"px");$("#loading-image").css("margin-top",Math.floor(window.innerHeight/2)-128+"px")}),window.addEventListener("resize",function(){window.dp_site_debug&&console.log("screen: resize: new w/h: "+window.innerWidth+"px"+window.innerHeight+"px");$("#loading-image").css("margin-top",Math.floor(window.innerHeight/2)-128+"px")}));
var c="<root>";c+="<v01>@@@DOCUPRO_VERSION@@@</v01>";c+="<v02>@@@DOCUPRO_PACKAGE@@@</v02>";c+="<v03>@@@DOCUPRO_BUILD@@@</v03>";c+="<dp_action>"+b+"</dp_action>";switch(b){case "loadpage":if(""===a[0]){window.dp_site_debug&&console.log("Attempted to load '' page, so forcing a main page load");window.dp_procmain("loadpage",["010"]);return}if("040"===a[0]&&($("#apptype-glyph").hasClass("glyphicon-warning-sign")||"Y"==$("#APP_TYPE").children("option:selected").data("dpnopropfail")&&$("#propaddr-glyph").hasClass("glyphicon-warning-sign"))){$("#errdivERROR").html("ERROR: "+
window.form_issues_msg);$("#errdivERROR").show();window.elementIsVisible(document.getElementById("errdivERROR"))||document.getElementById("errdivERROR").scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});return}c+="<data_cp>@@@SESSION_data_cp@@@</data_cp>";c+="<data_np>"+a[0]+"</data_np>";c+="<data_in>";$(".dp-input").each(function(a,b){c+='<x id="'+$(this).attr("id")+'" value="'+encodeURIComponent($(this).val().trim())+'"/>'});c+='<x id="EMAIL_ADDRESS" value="@@@SESSION_emailaddr@@@"/>';
c+='<x id="VERIFICATION_CODE" value="@@@SESSION_vrfycode@@@"/>';c+='<x id="FOLDER_ID" value="@@@SESSION_fldrid@@@"/>';c+="</data_in>";"@@@JS_Session_Signout@@@"==a[1]?(window.dp_site_debug&&console.log("found @@@JS_Session_Signout@@@"),c+='<react action="setidhtml" value1="infdivINFO" value2="'+a[1]+'"/>',c+='<webproxy action="preprocess" value1="NONE"/>'):"@@@JS_Session_Expired@@@"==a[1]&&(window.dp_site_debug&&console.log("found @@@JS_Session_Expired@@@"),c+='<react action="setidhtml" value1="infdivINFO" value2="'+
a[1]+'"/>',c+='<webproxy action="preprocess" value1="NONE"/>');break;case "propsrch":c+="<data_in>";c+='<x id="PROP_ADDR" value="'+encodeURIComponent(a[0])+'"/>';c+='<x id="APPSETTING_PROP_TYPES" value="'+encodeURIComponent(a[1])+'"/>';c+="</data_in>";break;case "uploaddoc":window.dp_site_debug&&console.log("flnm: ~"+window.dp_upl_file_name+"~ flsp: ~"+window.dp_upl_file_spec+"~ desc: ~"+window.dp_upl_file_desc+"~");c+='<data_in><x id="FOLDER_ID" value="@@@SESSION_fldrid@@@"/></data_in>';c+='<uploaddoc flnm="'+
encodeURIComponent(window.dp_upl_file_name)+'" flsp="'+window.dp_upl_file_spec+'" desc="'+encodeURIComponent(window.dp_upl_file_desc)+'" fini="'+encodeURIComponent(a[0])+'">';c+=window.btoa(a[1]);c+="</uploaddoc>";break;case "downloaddoc":c+='<data_in><x id="FOLDER_ID" value="@@@SESSION_fldrid@@@"/></data_in>',c+='<downloaddoc slice="'+window.dp_dnl_file_slice+'" flsp="'+window.dp_dnl_file_spec+'" desc="'+encodeURIComponent(window.dp_dnl_file_desc)+'" guid="'+encodeURIComponent(window.dp_dnl_file_guid)+
'" fini="'+encodeURIComponent(a[0])+'">',c+="</downloaddoc>"}c+="</root>";window.dp_site_debug&&console.log("postedGET (1st 500): "+c.substr(0,500));window.dp_site_debug&&console.log("About to AJAX webservice: WebProxy.asmx/webproxy wsmethod: dp_procmain");dp_turnSessTimerOn(!1);$("#loading").show();a=$.post("WebProxy.asmx/webproxy",{wsmethod:"dp_procmain",postedGET:encodeURIComponent(c)});a.always(function(){window.dp_resetInfAndErrDivs();$("#loading").hide();$(".progress").hide();$(".progress-bar").css("width",
"0%").attr("aria-valuenow","0");dp_turnSessTimerOn(!0)});a.fail(function(){$("#errdivERROR").html("ERROR: Oh snap, it looks like we hit a glitch. Try a reload, and it may magically fix itself. (in jqxr)");$("#errdivERROR").show();window.elementIsVisible(document.getElementById("errdivERROR"))||document.getElementById("errdivERROR").scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});a.done(function(a){window.dp_site_debug&&console.log("Raw data returned from web service: "+(500>=a.length?
a:a.substr(0,500)+"... +"+(a.length-500)+"bytes"));if("<?xml"!=a.substr(0,5))$("#errdivERROR").html("ERROR: xml doc not returned from web service."),$("#errdivERROR").show(),window.elementIsVisible(document.getElementById("errdivERROR"))||document.getElementById("errdivERROR").scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});else{var c=$.parseXML(a);if("OK"!=$(c).find("head").find("r01")[0].innerHTML)$("#errdivERROR").html($(c).find("head").find("r01")[0].innerHTML),$("#errdivERROR").show(),
window.elementIsVisible(document.getElementById("errdivERROR"))||document.getElementById("errdivERROR").scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});else{try{window.dp_site_debug&&console.log("dbginfo: "+decodeURIComponent($(c).find("dbginfo")[0].innerHTML))}catch(m){}var d=a=!1;c=$(c).find("reacts").find("x");for(var e=0;e<c.length;++e){var g=decodeURIComponent($(c[e].innerHTML).filter("react").attr("action")),f=decodeURIComponent($(c[e].innerHTML).filter("react").attr("value1")),
k=decodeURIComponent($(c[e].innerHTML).filter("react").attr("value2"));window.dp_site_debug&&console.log("processing react: "+g+" value1: "+f+" value2: "+k);switch(g){case "loadpage":window.scrollTo(0,0);$("#data_pg").html(k);window.dp_postPageLoadProcessing();if("010"==f)dp_turnSessTimerOn(!1),window.dp_paynow_clicked=!1;else if("030"==f)$("#apptype-glyph").css("color",window.glyphclr_neg),0<$("#APP_TYPE").find('option[value="***invalid***"]').length?$("#APP_TYPE").trigger("change"):($("#apptype-glyph").removeClass("glyphicon-warning-sign"),
$("#apptype-glyph").addClass("glyphicon-ok"),$("#apptype-glyph").css("color",window.glyphclr_pos),$("#apptype-glyph").hide()),$("#propaddr-glyph").css("color",window.glyphclr_neg),g=decodeURIComponent($("#APP_TYPE").children("option:selected").data("dptypemsg")),"undefined"===g||""===g?($("#APP_TYPE_MSG").html(""),$("#APP_TYPE_MSG").hide()):($("#APP_TYPE_MSG").html(g),$("#APP_TYPE_MSG").show()),$("#APP_PURPOSE").attr("placeholder",decodeURIComponent($("#APP_TYPE").children("option:selected").data("dppurp")));
else if("040"==f||"045"==f)window.cattypeappl=!1,window.grp1fldrstat=!1;break;case "setsessiontimeout":window.dp_updateTimerTimeout(f);break;case "setvarstr":try{eval(f+'="'+decodeURIComponent(k)+'";')}catch(m){window.dp_site_debug&&console.log("Failed setvarstr eval")}break;case "setvarnumbool":try{eval(f+"="+k+";")}catch(m){window.dp_site_debug&&console.log("Failed setvarnumbool eval")}break;case "setidhtml":$("#"+f).html(k);$("#"+f).show();"errdivERROR"==f&&(window.elementIsVisible(document.getElementById("errdivERROR"))||
document.getElementById("errdivERROR").scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}));break;case "addidhtml":"infdivINFO"==f&&$("#infdivINFO").html().includes(k)||($("#"+f).html($("#"+f).html().trim()+" "+k),$("#"+f).show());break;case "jqhide-elem":$(f).hide();break;case "setflsp":window.dp_upl_file_spec=f;break;case "propsrchrslt":$("#PROP_ADDR").attr("readOnly",!1);$("#addr-list").html(f);0<$("#addr-list").html().length&&$("#addr-list").is(":hidden")?($("#addr-button").dropdown("toggle"),
d=!0):""!==$("#addr-list").html()||$("#addr-list").is(":hidden")||$("#addr-button").dropdown("toggle");break;case "addattachment":g=$.parseXML(f);$("#attachmentstable").DataTable().table().row.add([$(g).find("col1")[0].innerHTML,$(g).find("col2")[0].innerHTML,$(g).find("col3")[0].innerHTML,$(g).find("col4")[0].innerHTML]);$("#attachmentstable").DataTable().table().draw();$("#attachmentstable tbody tr:first").css("background-color","bisque");break;case "setattachmenthref":window.dp_site_debug&&console.log("Apres sideloading the attachment...");
$(window.dp_dnl_element).find("img").attr("src","images/view.png");$(window.dp_dnl_element).removeClass("gremlins-test");window.dp_dnl_element.setAttribute("data-status","href");window.dp_dnl_element.href=decodeURIComponent(f);break;case "exception":a=!0;dp_turnSessTimerOn(!0);break;default:window.dp_site_debug&&"setsessid"!=g&&"delsessid"!=g&&console.log("***NO JS HANDLER*** found for react: "+g)}}a&&0===$(".panel-success").length&&($("#dp-force-home").show(),window.dp_site_debug&&console.log("unbinding/rebinding #dp-force-home handler"),
$("#dp-force-home").unbind("click"),$("#dp-force-home").click(function(a){a.preventDefault();window.dp_site_debug&&console.log("clicked #dp-force-home");window.dp_procmain("loadpage",["010","@@@JS_Session_Signout@@@"])}));window.dp_site_debug&&console.log("unbinding/rebinding a.addr-item class handler");$("a.addr-item").unbind("click");d&&$("a.addr-item").click(function(a){a.preventDefault();window.dp_site_debug&&console.log("$(this).data('propno'): "+$(this).data("propno"));$("#PROP_ADDR").val("").trigger("change");
$("#PROP_ADDR").val($(this)[0].innerHTML).trigger("change");$("#PROP_NUMBER").val($(this).data("propno")).trigger("change")});"uploaddoc"!=b||a||(window.dp_site_debug&&console.log("BACK OK from uploaddoc"),window.dp_upl_file_slice+=1,window.dp_handleFileUpload());"downloaddoc"!=b||a||(window.dp_site_debug&&console.log("BACK OK from downloaddoc"),a=Math.floor(Math.min(1024E3*(window.dp_dnl_file_slice+1),window.dp_dnl_file_size)/window.dp_dnl_file_size*100),window.dp_site_debug&&console.log("downloading slice: "+
(window.dp_dnl_file_slice+1)+" of "+Math.ceil(window.dp_dnl_file_size/1024E3)+" "+a.toString()+"%"),2<a&&$(".progress-bar").css("width",a.toString()+"%").attr("aria-valuenow",a.toString()),window.dp_dnl_file_slice+=1,window.dp_handleFileDownload())}}})}function dp_resetInfAndErrDivs(){$("#infdivINFO").html().includes("Connected to a Tempest TEST database.")||($("#infdivINFO").html(""),$("#infdivINFO").hide());$("#errdivERROR").html("");$("#errdivERROR").hide();$("#erronPAGE").hide()}
function dp_postPageLoadProcessing(){var b=/^[a-zA-Z0-9.!#$%&'*+\/=?\^_`{|}~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?)*$/gi;$("#propaddr-help-open-btn").click(function(a){a.preventDefault();$("#propaddr-help-open-btn").hide();$("#propaddr-help-close-btn").show();$("#propaddr-help").show();return!1});$("#propaddr-help-close-btn").click(function(a){a.preventDefault();$("#propaddr-help").hide();$("#propaddr-help-close-btn").hide();$("#propaddr-help-open-btn").show();
return!1});$("#appladdr1-show-btn").click(function(a){a.preventDefault();$("#appladdr1-show-btn").hide();$("#appladdr1-hide-btn").show();$("#APPL_ADDR1").show();return!1});$("#appladdr1-hide-btn").click(function(a){a.preventDefault();$("#APPL_ADDR1").val("").hide();$("#appladdr1-hide-btn").hide();$("#appladdr1-show-btn").show();return!1});$("#appladdr-help-open-btn").click(function(a){a.preventDefault();$("#appladdr-help-open-btn").hide();$("#appladdr-help-close-btn").show();$("#appladdr-help").show();
return!1});$("#appladdr-help-close-btn").click(function(a){a.preventDefault();$("#appladdr-help").hide();$("#appladdr-help-close-btn").hide();$("#appladdr-help-open-btn").show();return!1});$("#APP_TYPE").on("change",function(){window.dp_site_debug&&console.log("in #APP_TYPE handler");0<$("#APP_TYPE").find('option[value="***invalid***"]').length&&("***invalid***"===$("#APP_TYPE").val()?($("#apptype-glyph").removeClass("glyphicon-ok"),$("#apptype-glyph").addClass("glyphicon-warning-sign"),$("#apptype-glyph").css("color",
window.glyphclr_neg),$("#PROP_ADDR").attr("readOnly",!0),$("#APP_PURPOSE").attr("readOnly",!0),$("#APPL_FNAME").attr("readOnly",!0),$("#APPL_LNAME").attr("readOnly",!0),$("#APPL_ADDR1").attr("readOnly",!0),$("#APPL_ADDR2").attr("readOnly",!0),$("#APPL_ADDR3").attr("readOnly",!0),$("#APPL_PHONE").attr("readOnly",!0)):($("#apptype-glyph").removeClass("glyphicon-warning-sign"),$("#apptype-glyph").addClass("glyphicon-ok"),$("#apptype-glyph").css("color",window.glyphclr_pos),$("#PROP_ADDR").attr("readOnly",
!1),$("#APP_PURPOSE").attr("readOnly",!1),$("#APPL_FNAME").attr("readOnly",!1),$("#APPL_LNAME").attr("readOnly",!1),$("#APPL_ADDR1").attr("readOnly",!1),$("#APPL_ADDR2").attr("readOnly",!1),$("#APPL_ADDR3").attr("readOnly",!1),$("#APPL_PHONE").attr("readOnly",!1)));$("#PROP_ADDR").val("");$("#PROP_ADDR").trigger("input");$("#APP_PURPOSE").val("");var a=decodeURIComponent($("#APP_TYPE").children("option:selected").data("dptypemsg"));"undefined"===a||""===a?($("#APP_TYPE_MSG").html(""),$("#APP_TYPE_MSG").hide()):
($("#APP_TYPE_MSG").html(a),$("#APP_TYPE_MSG").show());$("#APP_PURPOSE").attr("placeholder",decodeURIComponent($("#APP_TYPE").children("option:selected").data("dppurp")))});window.dp_site_debug&&console.log("unbinding/rebinding .dp-signout class handler");$("a.dp-signout").unbind("click");$("a.dp-signout").click(function(a){a.preventDefault();window.dp_site_debug&&console.log("clicked a.dp-signout");window.cattypeappl&&window.grp1fldrstat&&(0<$("#dp-pay-now").length||0<$(".add-reqdoc-btn:visible").length||
0<$("#attachmentstable").length&&0===$("#attachmentstable").DataTable().table().rows().count())?($("#signout-warning-applfee").hide(),$("#signout-warning-uploads").hide(),$("#signout-warning-reqdocs").hide(),0<$("#dp-pay-now").length&&$("#signout-warning-applfee").show(),0<$(".add-reqdoc-btn:visible").length?$("#signout-warning-reqdocs").show():0===$("#attachmentstable").DataTable().table().rows().count()&&$("#signout-warning-uploads").show(),$("#signout-warning").modal("show")):window.dp_procmain("loadpage",
["010","@@@JS_Session_Signout@@@"])});$("#dp-signout-force").click(function(a){window.dp_procmain("loadpage",["010","@@@JS_Session_Signout@@@"])});window.dp_site_debug&&console.log("unbinding/rebinding .dp-loadpage class handler");$("a.dp-loadpage").unbind("click");$("a.dp-loadpage").click(function(a){a.preventDefault();window.dp_site_debug&&console.log("clicked a.dp-loadpage");window.dp_procmain($(this).data("val1"),[$(this).data("val2")])});window.dp_site_debug&&console.log("unbinding/rebinding .dp-action class handler");
$("a.dp-action").unbind("click");$("a.dp-action").click(function(a){a.preventDefault();window.dp_site_debug&&console.log("clicked a.dp-action: val1: "+$(this).data("val1")+" val2: "+$(this).data("val2"));switch($(this).data("val1")){case "loadpage":window.dp_procmain($(this).data("val1"),[$(this).data("val2")])}});window.dp_site_debug&&console.log("unbinding/rebinding .add-reqdoc-btn handler");$(".add-reqdoc-btn").unbind("click");$(".add-reqdoc-btn").click(function(a){a.preventDefault();window.dp_site_debug&&
console.log("clicked .add-reqdoc-btn");$(".dp-attach-stage1").show();$(".dp-attach-stage2").hide();window.dp_resetInfAndErrDivs();window.dp_upl_file_name=$(this).data("reqdoc-name")+".";window.dp_upl_btn_el=$(this);$("#add-reqdoc-input").click();return!1});try{document.getElementById("add-reqdoc-input").addEventListener("change",function(a){window.dp_resetInfAndErrDivs();window.dp_upl_file=a.target.files[0];window.dp_upl_file_name+=1==window.dp_upl_file.name.split(".").length?"":window.dp_upl_file.name.split(".").pop();
window.dp_upl_file_desc=window.dp_upl_btn_el.data("reqdoc-name");window.dp_upl_file_slice=0;window.dp_site_debug&&console.log("Reqdoc Upload file selected: "+window.dp_upl_file.name+", renamed to: "+window.dp_upl_file_name+", size: "+window.dp_upl_file.size);$("#dp-upload-sel-fn").html(window.dp_upl_file_name+" ("+(1>Math.round(window.dp_upl_file.size/1E3)/1E3?"<1":Math.round(window.dp_upl_file.size/1E3)/1E3).toString()+"MB)");window.dp_upl_file.name==window.dp_upl_file_name?$("#dp-rdfnamechg").hide():
($("#dp-rdfname1").html(window.dp_upl_file.name),$("#dp-rdfname2").html(window.dp_upl_file_name),$("#dp-rdfnamechg").show());$(".dp-attach-desc").val(window.dp_upl_file_desc);$(".dp-attach-desc").trigger("input");$(".dp-attach-desc").prop("disabled",!0);$(".dp-attach-upload").prop("disabled",!1);$(".dp-reset").hide();$(".dp-attach-stage1").hide();$(".dp-attach-stage2").show();$("html, body").animate({scrollTop:$(document).height()},"fast")})}catch(a){}window.dp_site_debug&&console.log("unbinding/rebinding #add-attach-btn handler");
$("#add-attach-btn").unbind("click");$("#add-attach-btn").click(function(a){a.preventDefault();window.dp_site_debug&&console.log("clicked #add-attach-btn");window.dp_resetInfAndErrDivs();window.dp_upl_btn_el=$(this);if(0<$("#add-reqdocs-first").length&&0<$(".add-reqdoc-btn:visible").length)$("#add-reqdocs-first").show(),window.setTimeout(function(){$("#add-reqdocs-first").hide()},2E3);else return $("#add-attach-input").click(),!1});try{document.getElementById("add-attach-input").addEventListener("change",
function(a){window.dp_resetInfAndErrDivs();window.dp_upl_file=a.target.files[0];window.dp_upl_file_name=window.dp_upl_file.name;window.dp_upl_file_slice=0;window.dp_site_debug&&console.log("Attachment Upload file selected: "+window.dp_upl_file_name+", size: "+window.dp_upl_file.size);$("#dp-upload-sel-fn").html(window.dp_upl_file_name+" ("+(1>Math.round(window.dp_upl_file.size/1E3)/1E3?"<1":Math.round(window.dp_upl_file.size/1E3)/1E3).toString()+"MB)");$("#dp-rdfnamechg").hide();$(".dp-attach-desc").val("");
$(".dp-attach-desc").trigger("input");$(".dp-attach-desc").prop("disabled",!1);$(".dp-attach-upload").prop("disabled",!0);$(".dp-reset").show();$(".dp-attach-stage1").hide();$(".dp-attach-stage2").show();$("html, body").animate({scrollTop:$(document).height()},"fast")})}catch(a){}window.dp_site_debug&&console.log("unbinding/rebinding .dp-attach-cancel class handler");$("a.dp-attach-cancel").unbind("click");$("a.dp-attach-cancel").click(function(a){a.preventDefault();window.dp_resetUploadGlobals();
$(".dp-reset").trigger("click");$(".dp-attach-stage2").hide();$(".dp-attach-stage1").show()});$('input[type="submit"]').closest("form").on("submit",function(a){window.dp_site_debug&&console.log("in generic input[type=submit] handler, form action: "+$(this).attr("action"));a.preventDefault();window.dp_site_formchg=!1;"upload"==$(this).attr("action")?(window.dp_upl_file_spec="",window.dp_upl_file_desc=$(".dp-attach-desc").val().trim(),$(".dp-attach-desc").prop("disabled",!1),$(".dp-reset").trigger("click"),
$(".dp-attach-stage2").hide(),$(".dp-attach-stage1").show(),window.dp_resetInfAndErrDivs(),$(".progress-bar").css("width","0%").attr("aria-valuenow","0"),window.dp_handleFileUpload()):window.dp_procmain("loadpage",[$(this).attr("action")])});$('input[type="reset"]').closest("form").on("reset",function(a){window.dp_site_debug&&console.log("in generic input[type=reset] handler");window.setTimeout(function(){0<$("#form030").length?(0<$("#APP_TYPE").find('option[value="***invalid***"]').length?$("#APP_TYPE").find('option[value="***invalid***"]').prop("selected",
!0).trigger("change"):($("#apptype-glyph").removeClass("glyphicon-ok"),$("#apptype-glyph").addClass("glyphicon-warning-sign"),$("#APP_TYPE_MSG").html(""),$("#APP_TYPE_MSG").hide(),$("#APP_PURPOSE").attr("placeholder",decodeURIComponent($("#APP_TYPE").children("option:selected").data("dppurp")))),$("#PROP_NUMBER").val("").trigger("change")):0<$("#form040").length&&($(".dp-attach-desc").prop("disabled",!1),$(".dp-attach-desc").trigger("input"));window.dp_resetInfAndErrDivs();window.dp_site_formchg=
!1},1)});$('input[type="text"]').on("change keyup paste",function(){window.dp_site_debug&&console.log("in generic input[type=text] handler");window.dp_site_formchg=!0});$(".dp-attach-desc").on("change keypress keyup keydown paste input",function(){window.dp_site_formchg=!0;this.value.length>this.maxLength&&(this.value=this.value.substr(0,this.maxLength));10<=this.value.length?$(".dp-attach-upload").prop("disabled",!1):$(".dp-attach-upload").prop("disabled",!0)});$(".dp-attach-upload").prop("disabled",
!0);$("#EMAIL_ADDRESS").on("keyup",function(){var a=b.test($("#EMAIL_ADDRESS").val())?"green":"yellow";window.dp_site_debug&&console.log("in EMAIL_ADDRESS handler: ~"+$("#EMAIL_ADDRESS").val()+"~: "+a);$("#EMAIL_ADDRESS").css("background-color","");$("#EMAIL_ADDRESS").val().length&&("green"==a?(window.dp_site_debug&&console.log("EMAIL_ADDRESS seems VALID"),$("#EMAIL_ADDRESS").css("background-color","#DFF0D8")):(window.dp_site_debug&&console.log("EMAIL_ADDRESS seems INVALID"),$("#EMAIL_ADDRESS").css("background-color",
"#FCF8E3")))});$(".dp-propsrch").on("input",function(){window.clearTimeout(window.g_propsrch);window.dp_site_debug&&console.log("in .dp-propsrch handler");""!==$("#PROP_NUMBER").val()&&$("#PROP_NUMBER").val("").trigger("change");var a=$(this).val();3>(a.match(/[0-9a-zA-Z]/g)||[]).length?window.dp_site_debug&&console.log("text length is < 3"):(a=a.replace(/\s+/g," ").trim(),window.dp_site_debug&&console.log("text length is >= 3; trimmed: "+a),window.g_propsrch=window.setTimeout(function(){window.dp_site_debug&&
console.log("ok, we're going to do a search for: "+a);$("#PROP_ADDR").attr("readOnly",!0);$("#addr-list").is(":hidden")||$("#addr-button").dropdown("toggle");window.dp_procmain("propsrch",[a,$("#APP_TYPE").children("option:selected").data("appstngproptypes")])},500))});$("#PROP_NUMBER").on("change",function(){window.dp_site_debug&&console.log("in #PROP_NUMBER handler");$("#PROP_NUMBER").val()?($("#propaddr-glyph").removeClass("glyphicon-warning-sign"),$("#propaddr-glyph").addClass("glyphicon-ok"),
$("#propaddr-glyph").css("color",window.glyphclr_pos)):($("#propaddr-glyph").removeClass("glyphicon-ok"),$("#propaddr-glyph").addClass("glyphicon-warning-sign"),$("#propaddr-glyph").css("color",window.glyphclr_neg))});window.dp_site_debug&&console.log("unbinding/rebinding .attach-file class handler");$(".attach-file").unbind("click");$(".attach-file").click(function(a){window.dp_dnl_element=this;window.dp_site_debug&&console.log("clicked attach-file: status: "+window.dp_dnl_element.getAttribute("data-status"));
"href"!==window.dp_dnl_element.getAttribute("data-status")&&(a.preventDefault(),$("#wrndivATTACH").hide(),parseInt($(window.dp_dnl_element).data("filesize"),10)>("undefined"!==typeof window.lgfilethresh?window.lgfilethresh:20971521)?$("#largedl-warning").modal("show"):(window.dp_resetDownloadGlobals(),window.dp_handleFileDownload()))});$("#dp-download-force").click(function(a){window.dp_resetDownloadGlobals();window.dp_handleFileDownload()});window.dp_site_debug&&console.log("unbinding/rebinding #dp-pay-now id handler");
$("#dp-pay-now").unbind("click");$("#dp-pay-now").click(function(a){window.dp_paynow_clicked=!0;$("#dp-after-pay-now").show()});window.dp_site_debug&&console.log("unbinding/rebinding #dp-reload-page id handler");$("#dp-reload-page").unbind("click");$("#dp-reload-page").click(function(a){a.preventDefault();window.location.reload()})}function dp_turnOnActivityTimer(){window.dp_site_activity_chk=!0;window.dp_updateTimer()}
function dp_resetUploadGlobals(){window.dp_upl_file_slice=0;window.dp_upl_file_spec="";window.dp_upl_file_desc=""}
function dp_handleFileUpload(){try{if($("#loading").show(),$(".progress").show(),1024E3*window.dp_upl_file_slice>window.dp_upl_file.size){$("#loading").hide();$(".progress").hide();$(".progress-bar").css("width","0%").attr("aria-valuenow","0");try{window.dp_upl_btn_el.hasClass("add-reqdoc-btn")&&(window.dp_upl_btn_el.parent().hide(),0==$(".add-reqdoc-btn:visible").length&&$("#dp-reqdocs-sec").hide())}catch(a){}window.dp_resetUploadGlobals();window.dp_turnOnActivityTimer()}else{var b=new window.FileReader;
b.onerror=function(){throw"An error occured reading the file to upload";};b.onabort=function(){throw"File upload was aborted";};b.onload=function(){var a=Math.floor(Math.min(1024E3*(window.dp_upl_file_slice+1),window.dp_upl_file.size)/window.dp_upl_file.size*100);window.dp_site_debug&&console.log("loaded slice: "+(window.dp_upl_file_slice+1)+" of "+Math.ceil(window.dp_upl_file.size/1024E3)+" "+a.toString()+"% ("+b.result.length+"): "+window.btoa(b.result).substr(0,80));2<a&&$(".progress-bar").css("width",
a.toString()+"%").attr("aria-valuenow",a.toString());window.dp_procmain("uploaddoc",[1024E3*(window.dp_upl_file_slice+1)>window.dp_upl_file.size?"1":"0",b.result])};b.readAsBinaryString(window.dp_upl_file.slice(1024E3*window.dp_upl_file_slice,1024E3*(window.dp_upl_file_slice+1)))}}catch(a){$("#loading").hide(),$("#errdivERROR").html("ERROR: we hit a glitch uploading the file: "+a.message),$("#errdivERROR").show(),window.elementIsVisible(document.getElementById("errdivERROR"))||document.getElementById("errdivERROR").scrollIntoView({behavior:"smooth",
block:"end",inline:"nearest"})}}function dp_resetDownloadGlobals(){window.dp_resetInfAndErrDivs();$(".progress-bar").css("width","0%").attr("aria-valuenow","0");window.dp_dnl_file_slice=0;window.dp_dnl_file_guid="";window.dp_dnl_file_size=$(window.dp_dnl_element).data("filesize");window.dp_dnl_file_desc=$(window.dp_dnl_element).data("filedesc");window.dp_dnl_file_spec=$(window.dp_dnl_element).data("filespec")}
function dp_handleFileDownload(){$("#loading").show();$(".progress").show();window.dp_site_debug&&console.log("in dp_handleFileDownload(): download file size: "+window.dp_dnl_file_size);1024E3*window.dp_dnl_file_slice>window.dp_dnl_file_size?($("#loading").hide(),$(".progress").hide(),$(".progress-bar").css("width","0%").attr("aria-valuenow","0"),window.dp_turnOnActivityTimer(),$("#wrndivATTACH").html(window.dp_dnl_open_inst),$("#wrndivATTACH").show()):window.dp_procmain("downloaddoc",[1024E3*(window.dp_dnl_file_slice+
1)>=window.dp_dnl_file_size?"1":"0"])}function getMobileOS(){var b="NotIosDroidWin",a=navigator.userAgent||navigator.vendor||window.opera;/windows phone/i.test(a)&&(b="Windows Phone");/android/i.test(a)&&(b="Android");/iPad|iPhone|iPod/.test(a)&&!window.MSStream&&(b="iOS");return b}
function dateToYYYYMMDDHHMISS(b){var a=b.getFullYear().toString(),d=(b.getMonth()+1).toString(),c=b.getDate().toString(),e=b.getHours().toString(),h=b.getMinutes().toString();b=b.getSeconds().toString();return a+(d[1]?d:"0"+d[0])+(c[1]?c:"0"+c[0])+(e[1]?e:"0"+e[0])+(h[1]?h:"0"+h[0])+(b[1]?b:"0"+b[0])};
