PageSourceSearch

https://pro.realquest.com/scripts/lib_init.js?v=26.9.0

js realquest.com collected 2026-10-05 01:38:51 UTC 51,837 bytes, 1,377 lines download raw bytes

1var arrNavList = new Array("Home", "Multi_Subjects_Search", "Custom_Search", "Foreclosure_Search", "Street_Map_Search", "Document_Number_Search", "Parcel_Map_Search", "Customer_Preferences", "Admin_Setup", "Product_Help");
2var arrNavBarList = new Array("Coverage", "Sample_Reports", "Contact_Us");
3var sampleWin = null;
4var reportWIN = null;
5var CompsSingleWIN = null;
6var FinishDLWIN = null;
7var DocumentNoWIN = null;
8var BuildingPermitWIN = null;
9var changepasswordWIN = null;
10var radiussearchWIN = null;
11var mapViewerWIN = null;
12var customerCenterWIN = null;
13var contacusWIN = null;
14var myprofileWIN = null;
15var SEARCHHELP = null;
16var liveChatWIN = null;
17var RetrieveSavedFormatWIN = null;
18var disclaimerWin = null;
19var gRQ = "no";
20var status = null;
21//var whatsnewpopupversion = "8.5.0";  // to be updated with each release, along with matching server-side value in Manager.java
22var fileUpload = "N";
23
24function getCookieValue(name) {
25    var cookiePattern = new RegExp('(?:^|;\\s*)' + name.replace(/([.$?*|{}()\[\]\\/+^])/g, '\\$1') + '=([^;]*)');
26    var match = document.cookie.match(cookiePattern);
27    if (!match) {
28        return null;
29    }
30
31    try {
32        return decodeURIComponent(match[1]);
33    } catch (e) {
34        return match[1];
35    }
36}
37
38function isUnsafeHttpMethod(method) {
39    var normalized = (method || 'GET').toUpperCase();
40    return normalized === 'POST' || normalized === 'PUT' || normalized === 'PATCH' || normalized === 'DELETE';
41}
42
43function isSameOriginUrl(url) {
44    if (!url) {
45        return true;
46    }
47
48    var normalized = String(url);
49
50    if (typeof URL === 'function') {
51        try {
52            var parsed = new URL(normalized, window.location.href);
53            return parsed.origin === window.location.origin;
54        } catch (e) {
55            return false;
56        }
57    }
58
59    var parser = document.createElement('a');
60    parser.href = normalized;
61
62    if (!parser.host) {
63        return true;
64    }
65
66    return parser.protocol === window.location.protocol && parser.host === window.location.host;
67}
68
69function setCsrfHeader(xhr) {
70    var token = getCookieValue('XSRF-TOKEN');
71    if (token) {
72        xhr.setRequestHeader('X-XSRF-TOKEN', token);
73    }
74}
75
76function ensureCsrfTokenOnForm(form) {
77    if (!form) {
78        return;
79    }
80
81    var method = (form.method || 'GET').toUpperCase();
82    if (!isUnsafeHttpMethod(method)) {
83        return;
84    }
85
86    if (!isSameOriginUrl(form.action)) {
87        return;
88    }
89
90    var csrfToken = getCookieValue('XSRF-TOKEN');
91    if (!csrfToken) {
92        return;
93    }
94
95    var csrfInput = form.elements['_csrf'] || (form.getElementsByName ? form.getElementsByName('_csrf')[0] : null);
96    if (csrfInput) {
97        csrfInput.value = csrfToken;
98        return;
99    }
100
101    var hidden = document.createElement('input');
102    hidden.type = 'hidden';
103    hidden.name = '_csrf';
104    hidden.value = csrfToken;
105    form.appendChild(hidden);
106}
107
108function ensureCsrfTokenOnForms() {
109    if (!document.forms) {
110        return;
111    }
112
113    for (var i = 0; i < document.forms.length; i++) {
114        ensureCsrfTokenOnForm(document.forms[i]);
115    }
116}
117
118function configureCsrfForDynamicForms() {
119    if (!document.addEventListener) {
120        return;
121    }
122
123    document.addEventListener('submit', function(event) {
124        var form = event && event.target;
125        if (form && form.tagName && form.tagName.toUpperCase() === 'FORM') {
126            ensureCsrfTokenOnForm(form);
127        }
128    }, true);
129}
130
131function configureCsrfForAjax() {
132    if (typeof jQuery === 'undefined') {
133        return;
134    }
135
136    jQuery.ajaxSetup({
137        beforeSend: function(xhr, settings) {
138            var method = settings && settings.type ? settings.type : 'GET';
139            var targetUrl = settings && settings.url ? settings.url : '';
140            if (isUnsafeHttpMethod(method) && isSameOriginUrl(targetUrl)) {
141                setCsrfHeader(xhr);
142            }
143        }
144    });
145}
146
147function configureCsrfForFetch() {
148    if (typeof window.fetch !== 'function') {
149        return;
150    }
151
152    // Idempotency guard: avoid re-wrapping if this runs more than once.
153    if (window.fetch.__csrfWrapped) {
154        return;
155    }
156
157    var originalFetch = window.fetch;
158    window.fetch = function(input, init) {
159        var method = 'GET';
160        var url = null;
161
162        if (typeof input === 'string') {
163            url = input;
164        } else if (typeof URL !== 'undefined' && input instanceof URL) {
165            url = input.href;
166        } else if (input && typeof input.url === 'string') {
167            url = input.url;
168            if (input.method) {
169                method = input.method;
170            }
171        } else if (input && typeof input.href === 'string') {
172            url = input.href;
173        } else if (input && typeof input.toString === 'function') {
174            var asString = input.toString();
175            if (asString && asString !== '[object Object]') {
176                url = asString;
177            }
178        }
179
180        if (init && init.method) {
181            method = init.method;
182        }
183
184        if (isUnsafeHttpMethod(method) && url && isSameOriginUrl(url)) {
185            var token = getCookieValue('XSRF-TOKEN');
186            if (token) {
187                init = init || {};
188                var headers = init.headers;
189
190                if (!headers && input && input.headers) {
191                    if (typeof Headers !== 'undefined') {
192                        headers = new Headers(input.headers);
193                    } else {
194                        headers = input.headers;
195                    }
196                }
197
198                if (!headers) {
199                    headers = {};
200                }
201
202                if (typeof Headers !== 'undefined' && headers instanceof Headers) {
203                    headers.set('X-XSRF-TOKEN', token);
204                } else if (Array.isArray(headers)) {
205                    headers.push(['X-XSRF-TOKEN', token]);
206                } else {
207                    headers['X-XSRF-TOKEN'] = token;
208                }
209
210                init.headers = headers;
211            }
212        }
213
214        return originalFetch.call(this, input, init);
215    };
216    window.fetch.__csrfWrapped = true;
217}
218
219function configureCsrfForXmlHttpRequest() {
220    if (typeof XMLHttpRequest === 'undefined' || !XMLHttpRequest.prototype || !XMLHttpRequest.prototype.open || !XMLHttpRequest.prototype.send || !XMLHttpRequest.prototype.setRequestHeader) {
221        return;
222    }
223
224    // Idempotency guard: avoid re-wrapping the prototype if this runs more than once.
225    if (XMLHttpRequest.prototype.send.__csrfWrapped) {
226        return;
227    }
228
229    var originalOpen = XMLHttpRequest.prototype.open;
230    var originalSend = XMLHttpRequest.prototype.send;
231    var originalSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader;
232
233    XMLHttpRequest.prototype.setRequestHeader = function(name, value) {
234        if (!this._requestHeaders) {
235            this._requestHeaders = {};
236        }
237
238        if (name) {
239            this._requestHeaders[String(name).toLowerCase()] = true;
240        }
241
242        return originalSetRequestHeader.apply(this, arguments);
243    };
244
245    XMLHttpRequest.prototype.open = function(method, url) {
246        this._csrfMethod = (method || 'GET').toUpperCase();
247        this._csrfUrl = url;
248        this._requestHeaders = {};
249        return originalOpen.apply(this, arguments);
250    };
251
252    XMLHttpRequest.prototype.send = function() {
253        var hasCsrfHeader = this._requestHeaders && this._requestHeaders['x-xsrf-token'];
254        if (isUnsafeHttpMethod(this._csrfMethod) && isSameOriginUrl(this._csrfUrl) && !hasCsrfHeader) {
255            try {
256                setCsrfHeader(this);
257            } catch (e) {
258            }
259        }
260        return originalSend.apply(this, arguments);
261    };
262    XMLHttpRequest.prototype.send.__csrfWrapped = true;
263}
264
265// Transport-level CSRF interceptors (fetch / XMLHttpRequest / jQuery.ajax) must be
266// installed SYNCHRONOUSLY when this script loads, i.e. before any inline page scripts
267// execute during HTML parsing. Inline <script> blocks run before DOMContentLoaded, so
268// deferring these interceptors to DOMContentLoaded caused parse-time state-changing
269// calls (e.g. /setActualUserName and /api/cookies/set on the usage/activity report page)
270// to be sent without the X-XSRF-TOKEN header and rejected with HTTP 403. The
271// XMLHttpRequest interceptor also covers jQuery's $.post/$.ajax, which use XHR under the
272// hood, regardless of whether jQuery has finished loading at this point.
273function installCsrfTransportInterceptors() {
274    configureCsrfForAjax();
275    configureCsrfForFetch();
276    configureCsrfForXmlHttpRequest();
277}
278
279// DOM/form CSRF wiring needs the parsed DOM, so it runs on DOMContentLoaded.
280function initializeCsrfProtection() {
281    ensureCsrfTokenOnForms();
282    configureCsrfForDynamicForms();
283    // Re-apply jQuery.ajaxSetup in case jQuery loaded after this script ran; the
284    // transport interceptors themselves are idempotent enough for this to be safe.
285    configureCsrfForAjax();
286}
287
288// Install transport interceptors immediately so parse-time requests are protected.
289installCsrfTransportInterceptors();
290
291if (document.addEventListener) {
292    document.addEventListener('DOMContentLoaded', initializeCsrfProtection);
293} else if (window.attachEvent) {
294    window.attachEvent('onload', initializeCsrfProtection);
295} else {
296    var originalOnLoad = window.onload;
297    window.onload = function() {
298        if (typeof originalOnLoad === 'function') {
299            originalOnLoad();
300        }
301        initializeCsrfProtection();
302    };
303}
304
305function getFile(filename, target, id) {
306    strContent = getFileContent(filename);
307    displayFooter(true);
308    if (id == arrNavList[0]) {
309        showHide('open', 'SearchOption');
310        showHide('close', 'SwitchContent');
311        showHide('close', 'DIV_Customer_Preferences');
312    } else if (id == arrNavList[1]) {
313        showContent(strContent, target);
314        showHide('close', 'SearchOption');
315    } else {
316        displayFooter(false);
317        showContent(strContent, target);
318        showHide('close', 'SearchOption');
319    }
320    offTopNavFocus();
321    offTopNavBarFocus();
322    for (i = 0; i < arrNavBarList.length; i++) {
323        if (id == arrNavBarList[i]) {
324            document.getElementById(id).className = "buttonon";
325        }
326    }
327    for (i = 0; i < arrNavList.length; i++) {
328        if (id == arrNavList[i]) {
329            onTopNavFocus(id);
330        }
331    }
332}
333
334function offTopNavFocus() {
335    for (i = 0; i < arrNavList.length; i++) {
336        var menu = document.getElementById(arrNavList[i]);
337        var cell = document.getElementById("td" + arrNavList[i]);
338        if (menu && cell) {
339            menu.className = "search_menu";
340            //cell.background="../images/tabbar.gif";
341            //document.getElementById("img"+arrNavList[i]).src="../images/tab.gif";
342        }
343    }
344}
345
346function offTopNavBarFocus() {
347    for (i = 0; i < arrNavBarList.length; i++) {
348        document.getElementById(arrNavBarList[i]).className = "button";
349    }
350}
351
352function onTopNavFocus(id) {
353    try {
354        if (id == "Document_Number_Search") {
355            // do nothing
356        } else {
357            document.getElementById(id).className = "search_menuon";
358        }
359        //document.getElementById("td"+id).background="../images/tabbaron.gif";
360        //document.getElementById("img"+id).src="../images/tabon.gif";
361    } catch (ex) {
362    }
363}
364
365function onTopNavBarFocus(id) {
366    try {
367        document.getElementById(id).className = "buttonon";
368    } catch (ex) {
369    }
370}
371
372function getRequest(uri, callbackF, failF) {
373
374    $.get(encodeURI(uri), callbackF).fail(failF);
375}
376
377function getFileContent(filename) {
378    try {
379        if (navigator.appName == "Microsoft Internet Explorer")
380            objHttp = new ActiveXObject("Microsoft.XMLHTTP");
381        else
382            objHttp = new XMLHttpRequest();
383
384        objHttp.open("GET", encodeURI(filename), false);
385        objHttp.send(null);
386        var strDoc = objHttp.responseText;
387        return strDoc;
388        //$.get(encodeURI(filename), function(data){
389        //var strDoc = data.responseText;
390        //return strDoc;
391        //});
392    } catch (ex) {
393        return "";
394    }
395}
396
397function sendFileContent(fileContent, stype) {
398    try {
399        if (navigator.appName == "Microsoft Internet Explorer")
400            objHttp = new ActiveXObject("Microsoft.XMLHTTP");
401        else
402            objHttp = new XMLHttpRequest();
403
404        objHttp.open("Post", urljspprog + "&action=getvalue&type=" + stype, false);
405        objHttp.send(fileContent);
406        var strDoc = objHttp.responseText;
407        return strDoc;
408    } catch (ex) {
409        return "";
410    }
411}
412
413function init(strPage, strType) {
414    gRQ = "yes";
415    if (sid !== "") {
416        initKey();
417        displayFooter(true);
418    }
419    if (strPage == 'Batch_Search') return;
420    if (strPage.indexOf("Search") != -1 || (strPage.length > 0 && "|Property_List|Customer_Preferences|AVMs|AnalyticsArchive|BasicReports|passportCascadeRptArchive".indexOf(strPage) != -1)) {
421        if (("AnalyticsArchive".indexOf(strPage) == -1 || "BasicReports".indexOf(strPage) == -1 || "|AVMs|".indexOf(strPage) == -1) && "|vp4archive|vectorarchive|hvearchive|hvcarchive|incomeproarchive|loansafearchive|loansafeFraudarchive|loansafeAppraisalarchive|bpoCheckarchive|loansafeCollateralarchive|loansafeRiskarchive|barreportarchive|historyproarchive|historyproreviewarchive|hvcsearch|hve|hvc|pass|powerbase|hpa|".indexOf(strType) == -1) {
422            displayComparable();
423            displayReportOptions("checked");
424            displayFooter(true);
425        }
426        updateReportOptions(strPage);
427        if (strPage.indexOf("Search") != -1 || "|AVMs|".indexOf(strPage) != -1 || "BasicReports".indexOf(strPage) != -1 || "|AnalyticsArchive|".indexOf(strPage) != -1 || "passportCascadeRptArchive".indexOf(strPage) != -1) {
428            setProperty();
429            if (strPage.indexOf("Search") != -1) {
430                displaySearchForm();
431                setCountyState();
432                if ("Street_Map_Search|Multi_Subjects_Search|Custom_Search|Foreclosure_Search|Document_Number_Search|Parcel_Map_Search".indexOf(strPage) != -1 && strPage.length > 0) {
433                    onTopNavFocus(strPage);
434                    /* for go-back */
435                    if ("Street_Map_Search" == strPage && null != document.forms[0] && null != document.forms[0].lat && null != document.forms[0].lon) {
436                        if (document.forms[0].lat.value.length > 0 && document.forms[0].lon.value.length > 0) {
437                            gLat = document.forms[0].lat.value;
438                            gLon = document.forms[0].lon.value;
439                            if (document.forms[0].scale.value.length > 0)
440                                gScale = document.forms[0].scale.value;
441                            if (document.forms[0].layers.value.length > 0)
442                                gLayers = document.forms[0].layers.value;
443                            if (document.forms[0].shape.value.length > 0)
444                                gGPL_Shape = document.forms[0].shape.value;
445                            if (document.forms[0].points.value.length > 0)
446                                gGPL_Points = document.forms[0].points.value;
447                            if (document.forms[0].gplcriteria.value.length > 0)
448                                gGPL_Search_String = document.forms[0].gplcriteria.value;
449                            if (document.forms[0].savedzoomlevel.value.length > 0)
450                                gGPL_Zoom = document.forms[0].savedzoomlevel.value;
451                            if (document.forms[0].savedmapview.value.length > 0)
452                                gGPL_Mapview = document.forms[0].savedmapview.value;
453                        }
454                        if (localStorage.getItem('lastrqmapinfo') != null && gGPL_Shape != "") {
455                            var lastrqmapinfo = localStorage.getItem('lastrqmapinfo');
456                            var arr = lastrqmapinfo.split(",");
457                            // Re-load the last saved Search Tools
458                            if (arr.length >= 5) {
459                                searchToolsWindowState = new String(arr[4]);
460                            } else {
461                                searchToolsWindowState = "visible";  // default Search Tools window to visible
462                            }
463                            // Re-load the last saved Map Tags layer
464                            if (arr.length >= 6)
465                                mapTagsLayer = new String(arr[5]);
466                            else
467                                mapTagsLayer = layerValues;  // default to the Values layer (permission checked below)
468
469                            // Re-load the last Map Foreclosures layer state
470                            if (arr.length >= 7) {
471                                mapForeclosuresLayer = new String(arr[6]);
472                            } else {
473                                mapForeclosuresLayer = "on";   // default to ON
474                            }
475                            // Re-load the last Map Parcels layer state
476                            if (arr.length >= 8) {
477                                mapParcelsLayer = new String(arr[7]);
478                            } else {
479                                mapParcelsLayer = "on";   // default to ON
480                            }
481                            // Re-load the last Map For Sale layer state
482                            if (arr.length >= 9) {
483                                mapForSaleLayer = new String(arr[8]);
484                            } else {
485                                mapForSaleLayer = "on";
486                            }
487                            // Re-load the last Map Distressed layer state
488                            if (arr.length >= 10) {
489                                mapDistressedState = new String(arr[9]);
490                            } else {
491                                mapDistressedState = "on";   // default to ON
492                            }
493
494                            localStorage.setItem('lastrqmapinfo', gGPL_Zoom + "," + gLat + "," + gLon + "," + gGPL_Mapview + "," + searchToolsWindowState + "," + mapTagsLayer + "," + mapForeclosuresLayer + "," + mapParcelsLayer + "," + mapForSaleLayer + "," + mapDistressedState);
495                        }
496
497                        initMap(gLat, gLon, gScale, gLayers, gGPL_Shape, gGPL_Points);
498
499                        if (document.forms[0].gplcriteria.value.length > 0)
500                            gGPL_Search_String = document.forms[0].gplcriteria.value;
501                        //if (gGPL_Search_String.length>0)
502                        //	displayPropertyList("");
503                    }
504                } else {
505                    onTopNavFocus('Home');
506                    displayUserInputOptions();
507                    if ("Map_Subject_Search" == strPage) {
508                        GetSubjectMap();
509                    }
510                }
511            } else if ("|AVMs|".indexOf(strPage) != -1) {
512                onAVMAnalyticsReportChanged(document.forms[0].avmana_archivedreporttype);
513            } else if ("|BasicReports|".indexOf(strPage) != -1) {
514                onAVMAnalyticsReportChanged(document.forms[0].avmana_reporttype);
515            } else if ("|AnalyticsArchive|".indexOf(strPage) != -1) {
516                onAVMAnalyticsReportChanged(document.forms[0].avmana_reporttype);
517            }
518            //else if("|AnalyticsArchive|".indexOf(strPage)!=-1||"|AVMs|".indexOf(strPage)!=-1){onAVMAnalyticsReportChanged(document.forms[0].avmana_reporttype);}
519        } else if (strPage == "Customer_Preferences") {
520            displayReportOptions("all");
521            onTopNavFocus(strPage);
522        } else if (strPage == "Property_List") {
523            if ("foreclosure|multisubjects|streetmapgpl".indexOf(strType) != -1 && strType.length > 0) {
524                showSelected(true);
525                onTopNavFocus(t2p(strType));
526            } else if ("vp4archive" == strType) {
527                //do nothing
528            } else if (gtab == "cs")
529                onTopNavFocus('Custom_Search');
530            else if (gtab == "fc")
531                onTopNavFocus('Foreclosure_Search');
532            else if ("documentnumber" == strType)
533                onTopNavFocus('Document_Number_Search');
534            else if (gtab == "sl")
535                onTopNavFocus('Multi_Subjects_Search');
536            else if (gtab == "st") {
537                onTopNavFocus('Street_Map_Search');
538            } else
539                onTopNavFocus('Home');
540
541            if (rs == 'y') {
542                setContent(document.forms[0]);
543            }
544        }
545    } else if (strPage == "main") {
546        onTopNavFocus('Home');
547    } else if (strPage == "Input" && fileUpload != 'Y') {
548        // Add delay for production environment to ensure all libraries and global variables are loaded
549        setTimeout(function() {
550            if (typeof setProperty === 'function') {
551                setProperty();
552            }
553        }, 200);
554    } else if (strPage == "Sample_Reports") {
555            animate();
556            onTopNavBarFocus(strPage);    
557        } else if (strPage == "Product_Help") {
558        onTopNavFocus(strPage);
559    } else if (strPage == "Contact_Us") {
560        onTopNavBarFocus(strPage);
561    } else if (strPage == "error" && strType == "suggestions") {
562        onTopNavFocus('Home');
563    } else if (strPage == "Admin") {
564        onTopNavFocus('Admin_Setup');
565    }
566    resize();
567}
568
569function resize() {
570    var footerHeightOffset = 240;
571    if (getQueryVariable("client") == "private") {
572        footerHeightOffset = 132;
573    }
574
575    try {
576        // In IE7 and above, changing the height of the element fires another resize event, calling resize again in an infinite loop
577        // so need to disable the resize event before changing the height, then re-enable after
578        // removeEHandler(window, 'resize', arguments.callee);
579        window.removeEventListener('resize', arguments.callee, false);
580
581
582        if ("Map_Subject_Search" == page) {
583            map.ResizeMap();
584        }
585
586        if (null != document.getElementById('expand') && getHeight() > footerHeightOffset) {
587            //document.getElementById('expand').style.height = getHeight() - footerHeightOffset;
588            document.getElementById('expand').height = getHeight() - footerHeightOffset - 120;
589        }
590
591        // addEHandler(window, 'resize', arguments.callee);
592        window.addEventListener('resize', arguments.callee, false);
593    } catch (ex) {
594
595    }
596}
597
598function Validate_main_Form(form) {
599    if (!form.username.value.length) {
600        alert("Please enter a username.");
601        form.username.focus();
602        return false;
603    }
604    if (!form.password.value.length) {
605        alert("Please enter a password.");
606        form.password.focus();
607        return false;
608    }
609    SetCookie("rqusr", form.remember.checked ? form.username.value : "");
610    showHide('close', 'SearchOption');
611    showHide('close', 'top_nav');
612    showHide('open', 'Processing');
613}
614
615function trim(str) {
616    if (null == str || typeof (str) == "undefined")
617        return "";
618    else
619        return str.replace(/^\s*/, "").replace(/\s*$/, "");
620}
621
622function validatelogin(form) {
623    if (typeof (form.username) != "undefined") {
624        form.username.value = trim(form.username.value);
625    }
626    if (typeof (form.password) != "undefined") {
627        form.password.value = trim(form.password.value);
628    }
629
630    if (!form.username.value.length) {
631        alert("Please enter a username.");
632        form.username.focus();
633        return false;
634    }
635    if (!form.password.value.length) {
636        alert("Please enter a password.");
637        form.password.focus();
638        return false;
639    }
640    var sUsername = form.username.value;
641    if (sUsername.indexOf("@") != -1) {
642        //form.action = "https://"+window.location.host+"/rq/jump.aspx";
643        //form.action = "http://beta.visioncore.com/RQ/default.aspx";
644        //alert(form.action);
645    }
646
647    if (form.remember) {
648        SetCookie("rqusr", form.remember.checked ? form.username.value : "");
649    }
650
651    return true;
652}
653
654async function initLogin(form) {
655    if (!form || !form.username || !form.remember) {
656        // Not a login form — skip the cookie fetch
657        return;
658    }
659    var username = await GetCookie("rqusr");
660    if (username) {
661        form.username.value = username;
662        form.remember.checked = true;
663        form.password.focus();
664        SetCookie("rqusr", form.remember.checked ? form.username.value : "");
665    } else {
666        form.username.focus();
667    }
668}
669
670function GetCookie(name) {
671    return fetch("/api/cookies/get/" + encodeURIComponent(name))
672        .then(res => {
673            if (!res.ok) return null;  // cookie not found
674            // res.text() returns a Promise, so we must chain .then() to get the actual text
675            return res.text().then(text => decodeURIComponent(text));
676        })
677        .catch(() => null);
678}
679
680function SetCookie(name, value) {
681    // Prepare parameters for backend
682    const params = new URLSearchParams({
683        cookieName: name,
684        cookieValue: encodeURIComponent(value),
685        maxAge: 189345600,
686        path: "/"
687    });
688
689    // Call backend to set HttpOnly cookie
690    fetch("/api/cookies/set?" + params.toString(), {
691        method: "POST"
692    })
693        .then(response => {
694            if (!response.ok) {
695                throw new Error("Failed to set cookie");
696            }
697        })
698        .catch(error => {
699            console.error("Error calling backend to set cookie:", error);
700        });
701}
702
703
704function enableDisable(method, section) {
705    try {
706        var sectionObj = document.getElementById(section);
707        if (null != sectionObj) {
708            if (method == "enable") {
709                sectionObj.disabled = false;
710            } else if (method == "disable") {
711                sectionObj.disabled = true;
712            }
713        }
714    } catch (ex) {
715    }
716}
717
718function showHide(method, section) {
719    try {
720        var sectionObj = document.getElementById(section);
721        if (null != sectionObj) {
722            if (method == "open") {
723                sectionObj.style.display = "";
724            } else if (method == "close") {
725                sectionObj.style.display = "none";
726            }
727        }
728    } catch (ex) {
729    }
730}
731
732function showContent(content, target) {
733    try {
734        content = "<FONT class='sub'>" + content + "</FONT>";
735        var showContentObj = document.getElementById(target);
736        if (null != showContentObj) { /*&&null!=showContentObj.innerHTML*/
737            if (showContentObj.innerHTML != content) {
738                showContentObj.innerHTML = content;
739            } else {
740                showContentObj.innerHTML = "";
741            }
742        }
743    } catch (ex) {
744    }
745}
746
747function setContentText(content, target) {
748    if (document.all) {
749        document.getElementById(target).innerText = content;
750    } else {
751        document.getElementById(target).textContent = content;
752    }
753}
754
755function getContentText(target) {
756    if (document.all) {
757        return document.getElementById(target).innerText;
758    } else {
759        return document.getElementById(target).textContent;
760    }
761}
762
763function showContentNoFontWrapper(content, target) {
764    try {
765        var showContentObj = document.getElementById(target);
766        if (null != showContentObj) {
767            if (showContentObj.innerHTML != content) {
768                showContentObj.innerHTML = content;
769            } else {
770                showContentObj.innerHTML = "";
771            }
772        }
773    } catch (ex) {
774    }
775}
776
777function createTableOpen_bak() {
778    document.write("<TABLE cellspacing=0 cellpadding=0 border=0 align=center><TR><TD bgcolor=#cccccc colspan=2 height=7 rowspan=2><IMG height=7 src=\"../images/corner1.gif\" width=7></TD><TD bgcolor=#cccccc height=1> <IMG height=1 src=\"../images/clearpixel.gif\" border=0></TD>
778<TD bgcolor=#cccccc colspan=2 height=7 rowspan=2> <IMG height=7 src=\"../images/corner2.gif\" width=7></TD>\
779	 </TR><TR valign=top><TD><IMG height=6 src=\"../images/clearpixel.gif\" width=1 border=0></TD></TR><TR valign=top><TD width=1 bgcolor=#cccccc><IMG height=1 src=\"../images/clearpixel.gif\" width=1 border=0></TD><TD width=6> <IMG height=1 src=\"../images/clearpixel.gif\" width=6 border=0></TD><TD bgcolor=\"#FFFFFF\" valign=\"top\">");
780}
781
782function createTableClose_bak() {
783    document.write("</TD><TD width=6><IMG height=1 src=\"../images/clearpixel.gif\" width=6 border=0></TD><TD width=1 bgcolor=#cccccc><IMG height=1 src=\"../images/clearpixel.gif\" width=1 border=0></TD></TR><TR valign=bottom><TD colspan=2 height=7 rowspan=2> <IMG height=7 src=\"../images/corner3.gif\" width=7></TD><TD><IMG height=6 src=\"../images/clearpixel.gif\" width=1 border=0></TD>\
784     <TD colspan=2 height=7 rowspan=2><IMG height=7 src=\"../images/corner4.gif\" width=7></TD></TR><TR><TD bgcolor=#cccccc><IMG height=1 src=\"../images/clearpixel.gif\" border=0></TD></TR></TABLE>");
785}
786
787function createTableOpen() {
788    document.write("<DIV class='round-border-box'>");
789}
790
791// to solve the issue of [Information is not aligned when a Custom Cascade report with THVx]
792window.onload = function (){
793
794    if (typeof window !== 'undefined' && window.jQuery && window.jQuery.fn) {
795        (function (jq) {
796            // Fix the Homeowner Association Report MADLRQ-23062
797            // make the content of the report in center like the report header
798            jq('.hoa').css("margin-left", "auto")
799            jq('.hoa').css("margin-right", "auto")
800            jq('.hoa').css("padding", "5px !important")
801
802            // make the report data table contains start from the left and make space between its columns
803            jq('.hoa table').css("text-align", "left")
804            jq('.hoa .hoaDataTable td+td').css("width", "25%")
805
806            // fix the table title to be in same header
807            jq('#vh .vh-columns').css("height", "50px")
808            jq('#vh .vh-blue').css("background-color", "transparent")
809        }(window.jQuery));
810    }
811
812    // fixing the report name [THVx for Risk Management & THVx for Originations]
813    if (document.getElementById("vhall")) {
814        document.getElementById("vhall").innerHTML = document.getElementById("vhall").innerHTML.replace("THV?", "THV<sup>x</sup>");
815        document.getElementById("vhall").innerHTML = document.getElementById("vhall").innerHTML.replace("THV?", "THV<sup>x</sup>");
816        
817    }
818    if (document.getElementById("vh")) {
819        document.getElementById("vh").children[9].innerHTML = document.getElementById("vh").children[9].innerHTML.replace("THV?", "THV<sup>x</sup>");
820        document.getElementById("vh").children[9].innerHTML = document.getElementById("vh").children[9].innerHTML.replace("THV?", "THV<sup>x</sup>");
821    }
822
823    // The standalone THVx report renders that blue section outside
824    // any border. Match that layout by moving each .modelx-cascade-div out of its
825    // .round-border-box so it becomes a full-width sibling right after the box, leaving the
826    // border to wrap only the summary. Runs after the THV? -> THVx fix above so #vh.children
827    // indexing is unaffected.
828    var thvxSections = document.querySelectorAll(".modelx-cascade-div");
829    for (var i = 0; i < thvxSections.length; i++) {
830        var thvxSection = thvxSections[i];
831        var borderBox = thvxSection.closest ? thvxSection.closest(".round-border-box") : null;
832        if (borderBox && borderBox.parentNode) {
833            borderBox.parentNode.insertBefore(thvxSection, borderBox.nextSibling);
834        }
835    }
836
837}
838
839function popUpMapViewer(url){
840    var w = 800;  var h = 600;
841    LeftPosition=(screen.width)?(screen.width-w)/2:100;
842    TopPosition=(screen.height)?(screen.height-h)/2:100;
843    settings='width='+w+',height='+h+',screenX='+LeftPosition+',screenY='+TopPosition+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
844    mapViewerWIN = open(url,"MapViewer",settings);
845}
846
847function createTableClose() {
848    document.write("</DIV>");
849}
850
851function getTableOpen() {
852    return ("<TABLE cellspacing='0' cellpadding='0' border='0' align='center'><TR><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner1.gif' width='7'></TD><TD style='border-top: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner2.gif' width='7'></TD></TR><TR valign='top'><TD><IMG height='5' src='../images/clearpixel.gif' width='1' border='0'></TD></TR><TR valign='top'><TD width='1' style='border-left: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD width='5'><IMG height='1' src='../images/clearpixel.gif' width='5' border='0'></TD><TD bgcolor='#FFFFFF' valign='top'>");
853}
854
855function getTableClose() {
856    return ("</TD><TD width='5'><IMG height='1' src='../images/clearpixel.gif' width='5' border='0'></TD><TD width='1' style='border-right: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD></TR><TR valign='bottom'><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner3.gif' width='7'></TD><TD style='border-bottom: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner4.gif' width='7'></TD></TR></TABLE>");
857}
858
859function getHeight() {
860    h = 0;
861    if (window.innerWidth) {
862        w = window.innerWidth;
863        h = window.innerHeight;
864    } else if (document.documentElement) {
865        w = (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth);
866        h = (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight);
867    }
868    return h;
869}
870
871function getWidth() {
872    if (window.innerWidth) {
873        w = window.innerWidth;
874        h = window.innerHeight;
875    } else if (document.all) {
876        w = document.body.clientWidth;
877        h = document.body.clientHeight;
878    }
879    return w;
880}
881
882function popUpURL(urlpop) {
883    var w = 720;
884    var h = (screen.height) * 0.75;
885    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
886    TopPosition = 10;
887    settings = 'width=' + w + ',height=' + h + ',screenX=' + LeftPosition + ',screenY=' + TopPosition + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=yes,location=no,directories=no,status=yes,menubar=yes,toolbar=yes,resizable=yes';
888    sampleWin = open(urlpop, "Report", settings);
889}
890
891function displayFooter(option) {
892    if (option) {
893        showHide('open', 'footer_agreement');
894        showHide('open', 'footer_agreement_private');/*showHide('close','footer_privacy');*/
895    } else {
896        showHide('close', 'footer_agreement');
897        showHide('close', 'footer_agreement_private');/*showHide('open','footer_privacy');*/
898    }
899}
900
901function setPermission() {
902    // DWRController.setPrinDataSession("YES");
903    $.post("/setPrinDataSession", {"sesVal": "YES"});
904}
905
906function MM_findObj(n, d) {
907    var p, i, x;
908    if (!d) d = document;
909    if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
910        d = parent.frames[n.substring(p + 1)].document;
911        n = n.substring(0, p);
912    }
913    if (!(x = d[n]) && d.all) x = d.all[n];
914    for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
915    for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
916    if (!x && document.getElementById) x = document.getElementById(n);
917    return x;
918}
919
920function createTableOpen_withshade() {
921    document.write("<TABLE cellspacing=0 cellpadding=0 align=center border=0><TR><TD><IMG height=6 alt='' src='../images/tbllt1.gif' width=9 border=0></TD>
921<TD background=../images/tblt1.gif><IMG src='../images/tblo.gif'></TD><TD><IMG height=6 alt='' src='../images/tblrt1.gif' width=9 border=0></TD></TR><TR><TD width=9 background=../images/tbllm1.gif><IMG src='../images/tblo.gif'></TD><TD>");
922}
923
924function createTableClose_withshade() {
925    document.write("</TD><TD background=../images/tblrm1.gif><IMG src='../images/tblo.gif'></TD></TR><TR><TD><IMG height=10 alt='' src='../images/tbllb1.gif' width=9 border=0></TD><TD valign=bottom width=9 background=../images/tblb1.gif><IMG alt='' src='../images/tblo.gif' border=0></TD><TD><IMG height=10 alt='' src='../images/tblrb1.gif' width=9 border=0></TD></TR></TABLE>");
926}
927
928function MM_swapImgRestore() {
929    var i, x, a = document.MM_sr;
930    for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
931}
932
933function MM_swapImage() {
934    var i, j = 0, x, a = MM_swapImage.arguments;
935    document.MM_sr = new Array;
936    for (i = 0; i < (a.length - 2); i += 3) if ((x = MM_findObj(a[i])) != null) {
937        document.MM_sr[j++] = x;
938        if (!x.oSrc) x.oSrc = x.src;
939        x.src = a[i + 2];
940    }
941}
942
943function MM_checkNum(Num, strField) {
944    for (i = 0; i < (Num.length); i++) {
945        if (Num.charAt(i) < '0' || Num.charAt(i) > '9') {
946            alert("Please enter number for " + strField);
947            return false;
948        }
949    }
950    return true;
951}
952
953function checkOpenWin() {
954    try {
955        if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("MSIE 5.0") != -1) {
956            return true;
957        }
958        if (null != reportWIN && !reportWIN.closed) {
959            reportWIN.focus();
960            return false;
961        }
962        if (null != FinishDLWIN && !FinishDLWIN.closed) {
963            FinishDLWIN.focus();
964            return false;
965        }
966        if (null != radiussearchWIN && !radiussearchWIN.closed) {
967            radiussearchWIN.focus();
968            return false;
969        }
970        if (null != changepasswordWIN && !changepasswordWIN.closed) {
971            changepasswordWIN.focus();
972            return false;
973        }
974        if (null != sampleWin && !sampleWin.closed) {
975            sampleWin.focus();
976            return false;
977        }
978        if (null != CompsSingleWIN && !CompsSingleWIN.closed) {
979            CompsSingleWIN.focus();
980            return false;
981        }
982        if (null != DocumentNoWIN && !DocumentNoWIN.closed) {
983            DocumentNoWIN.focus();
984            return false;
985        }
986        if (null != BuildingPermitWIN && !BuildingPermitWIN.closed) {
987            BuildingPermitWIN.focus();
988            return false;
989        }
990        if (null != mapViewerWIN && !mapViewerWIN.closed) {
991            mapViewerWIN.focus();
992            return false;
993        }
994        if (null != customerCenterWIN && !customerCenterWIN.closed) {
995            customerCenterWIN.focus();
996            return false;
997        }
998        if (null != contacusWIN && !contacusWIN.closed) {
999            contacusWIN.focus();
1000            return false;
1001        }
1002        if (null != myprofileWIN && !myprofileWIN.closed) {
1003            myprofileWIN.focus();
1004            return false;
1005        }
1006
1007        if (null != SEARCHHELP) {
1008            if (!SEARCHHELP.closed) {
1009                SEARCHHELP.focus();
1010                return false;
1011            }
1012        }
1013        //if(null!=liveChatWIN&&!liveChatWIN.closed){liveChatWIN.focus(); return false;}
1014        if (null != RetrieveSavedFormatWIN && !RetrieveSavedFormatWIN.closed) {
1015            RetrieveSavedFormatWIN.focus();
1016            return false;
1017        }
1018        return true;
1019    } catch (ex) {
1020    }
1021}
1022
1023//Following function is used to make the given form elements as readonly type based on the staus sent from the caller as true or false.
1024function makeReadOnlyFormElements(formName, readonlyelements, status) {
1025    try {
1026        var formDoc = "document." + formName + ".elements";
1027        var nLen = formDoc.length;
1028        for (var i = 0; i < nLen; i++) {
1029            var fieldName = document.forms[0].elements[i].name;
1030            var fieldNameValueLen = document.forms[0].elements[i].value.length;
1031            if (readonlyelements.indexOf(fieldName) > -1) {
1032                if (fieldNameValueLen > 0) {
1033                    document.forms[0].elements[i].readOnly = status;
1034                }
1035            }
1036        }
1037    } catch (ex) {/*alert(e);*/
1038    }
1039}
1040
1041function runDisable() {
1042    //showHide("open","bodycontent");
1043}
1044
1045function disableFormElement(status) {
1046    var nLen = document.forms[0].elements.length;
1047    for (var i = 0; i < nLen; i++) {
1048        document.forms[0].elements[i].disabled = status;
1049    }
1050}
1051
1052function closeReport() {
1053    var top = self.screenTop;
1054    if (top > 9000) {
1055        closeAllWindows();
1056    }
1057}
1058
1059function closeAllWindows() {
1060    try {
1061        if (null != sampleWin) {
1062            sampleWin.close();
1063        }
1064        if (null != reportWIN) {
1065            reportWIN.close();
1066        }
1067        if (null != CompsSingleWIN) {
1068            CompsSingleWIN.close();
1069        }
1070        if (null != FinishDLWIN) {
1071            FinishDLWIN.close();
1072        }
1073        if (null != DocumentNoWIN) {
1074            DocumentNoWIN.close();
1075        }
1076        if (null != BuildingPermitWIN) {
1077            BuildingPermitWIN.close();
1078        }
1079        if (null != changepasswordWIN) {
1080            changepasswordWIN.close();
1081        }
1082        if (null != radiussearchWIN) {
1083            radiussearchWIN.close();
1084        }
1085        if (null != mapViewerWIN) {
1086            mapViewerWIN.close();
1087        }
1088        if (null != customerCenterWIN) {
1089            customerCenterWIN.close();
1090        }
1091        if (null != contacusWIN) {
1092            contacusWIN.close();
1093        }
1094        if (null != myprofileWIN) {
1095            myprofileWIN.close();
1096        }
1097        if (null != SEARCHHELP) {
1098            SEARCHHELP.close();
1099        }
1100        //if (null!=liveChatWIN) {liveChatWIN.close();}
1101        if (null != RetrieveSavedFormatWIN) {
1102            RetrieveSavedFormatWIN.close();
1103        }
1104        if (null != window.frames["stf_mapclient"].vFrame.reportWIN) {
1105            window.frames["stf_mapclient"].vFrame.reportWIN.close();
1106        }
1107    } catch (ex) {
1108    }
1109}
1110
1111function RorC() {
1112    try {
1113        closeAllWindows();
1114        var top = self.screenTop;
1115        if (top > 9000) {
1116            if (page.indexOf("Search") != -1 || "|VP4Archive|HVEArchive|HVEArchive|Property_List|Customer_Preferences|Retrieve|Product_Help|Admin|error|".indexOf(page) != -1) {
1117                if (null != self.opener) {
1118                } else if ("Admin" == page && "yes" == winPopup) {
1119                } else if (page == "" && type == "getreport") {
1120                } else {
1121                    logoutCloseBrowser();
1122                }
1123            }
1124        }
1125    } catch (ex) {
1126    }
1127}
1128
1129function logoutCloseBrowser() {
1130    var sMsg = getFileContent(urljspprog + '&action=logout&type=close');
1131}
1132
1133function logoutCancel() {
1134    location.replace(urljspprog + '&action=logout');
1135}
1136
1137function logoutframes() {
1138    location.replace(urljspprog + '&page=error&action=switch&type=login');
1139}
1140
1141function runRedirect(url) {
1142    location.replace(url);
1143}
1144
1145function popLiveChat(urlpop) {
1146    var popcurrentTime = new Date().getTime();
1147    urlpop += "?&pop=" + popcurrentTime;
1148    var w = 650;
1149    var h = 350;
1150    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
1151    TopPosition = (screen.height) ? (screen.height - h) / 2 : 100;
1152    settings = 'width=' + w + ',height=' + h + ',screenX=' + LeftPosition + ',screenY=' + TopPosition + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=yes,location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
1153    liveChatWIN = open(urlpop, "liveChatWIN", settings);
1154}
1155
1156function popForgotPassword(url) {
1157    var w = 640;
1158    var h = 500;
1159    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
1160    TopPosition = (screen.height) ? (screen.height - h) / 2 : 100;
1161    settings = 'width=' + w + ',height=' + h + ',screenX=' + LeftPosition + ',screenY=' + TopPosition + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
1162    forgotPasswordWIN = open(url, "ForgotPassword", settings);
1163}
1164
1165function popUpDisclaimer(mapId) {
1166    try {
1167        var w = 640;
1168        var h = 440;
1169        var settings = 'help:0;resizable:0;dialogWidth:' + w + 'px;dialogHeight:' + h + 'px';
1170        var db = eval("dashBoard" + mapId);
1171
1172        var lat = db.mapControl.getCenter().lat();
1173        var lon = db.mapControl.getCenter().lng();
1174
1175        if (null == lat || null == lon) {
1176            alert("Parcel Boundary Disclaimer is not available");
1177        } else {
1178            var urlpop = "/jsp/mapdisclaimer.jsp?lat=" + lat + "&lon=" + lon;
1179            disclaimerWin = showModalDialog(urlpop, "Disclaimer", settings);
1180        }
1181    } catch (ex) {
1182        alert(ex.message);
1183    }
1184}
1185
1186function getQueryVariable(variable) {
1187    try {
1188        var query = new String(window.location.search);
1189        if (query.charAt(0) == '?') {
1190            query = query.replace('?', '&');
1191        }
1192        var vars = query.split("&");
1193        for (var i = 0; i < vars.length; i++) {
1194            var pair = vars[i].split("=");
1195            if (pair[0] == variable) {
1196                var sVal = pair[1];
1197                sVal = sVal.replace(/\+/gi, " ");
1198                return sVal;
1199            }
1200        }
1201        return "";
1202    } catch (ex) {
1203        return "";
1204    }
1205}
1206
1207function checkwhere(form) {
1208    if (!form.txtSearchAddr.value.length) {
1209        alert("Please enter search information.");
1210        form.txtSearchAddr.focus();
1211        return false;
1212    }
1213    return true;
1214}
1215
1216var w3c = (document.getElementById) ? true : false;
1217var ie = (document.all) ? true : false;
1218var N = -1;
1219
1220function createBar(w, h, bgc, brdW, brdC, blkC, speed, blocks, count, action) {
1221    if (ie || w3c) {
1222        var t = '<div id="_xpbar' + (++N) + '" style="visibility:visible; position:relative; overflow:hidden; width:' + w + 'px; height:' + h + 'px; background-color:' + bgc + '; border-color:' + brdC + '; border-width:' + brdW + 'px; border-style:solid; font-size:1px;">';
1223        t += '<span id="blocks' + N + '" style="left:-' + (h * 2 + 1) + 'px; position:absolute; font-size:1px">';
1224        for (i = 0; i < blocks; i++) {
1225            t += '<span style="background-color:' + blkC + '; left:-' + ((h * i) + i) + 'px; font-size:1px; position:absolute; width:' + h + 'px; height:' + h + 'px; '
1226            t += (ie) ? 'filter:alpha(opacity=' + (100 - i * (100 / blocks)) + ')' : '-Moz-opacity:' + ((100 - i * (100 / blocks)) / 100);
1227            t += '"></span>';
1228        }
1229        t += '</span></div>';
1230        document.write(t);
1231        var bA = (ie) ? document.all['blocks' + N] : document.getElementById('blocks' + N);
1232        bA.bar = (ie) ? document.all['_xpbar' + N] : document.getElementById('_xpbar' + N);
1233        bA.blocks = blocks;
1234        bA.N = N;
1235        bA.w = w;
1236        bA.h = h;
1237        bA.speed = speed;
1238        bA.ctr = 0;
1239        bA.count = count;
1240        bA.action = action;
1241        /*bA.togglePause=togglePause;*/
1242        bA.showBar = function () {
1243            this.bar.style.visibility = "visible";
1244        }
1245        bA.hideBar = function () {
1246            this.bar.style.visibility = "hidden";
1247        }
1248        bA.tid = setInterval('startBar(' + N + ')', speed);
1249        return bA;
1250    }
1251}
1252
1253function startBar(bn) {
1254    var t = (ie) ? document.all['blocks' + bn] : document.getElementById('blocks' + bn);
1255    if (parseInt(t.style.left) + t.h + 1 - (t.blocks * t.h + t.blocks) > t.w) {
1256        t.style.left = -(t.h * 2 + 1) + 'px';
1257        t.ctr++;
1258        if (t.ctr >= t.count) {
1259            eval(t.action);
1260            t.ctr = 0;
1261        }
1262    } else t.style.left = (parseInt(t.style.left) + t.h + 1) + 'px';
1263
1264}
1265
1266
1267function displayDynamicReportOptionGeoErrMsg() {
1268    if (showGeoErrorMsg) {
1269        $('#displayDynamicReportOptionsNoAccessMsg').show();
1270    } else {
1271        $('#displayDynamicReportOptionsNoAccessMsg').hide();
1272    }
1273}
1274
1275if (!window.location.origin) { // Some browsers (mainly IE) does not have this property, so we need to build it manually...
1276    window.location.origin = window.location.protocol + '//' + window.location.hostname + (window.location.port ? (':' + window.location.port) : '');
1277}
1278// var xyz = createBar(total_width,total_height,background_color,border_width,border_color,block_color,scroll_speed,block_count,scroll_count,action_to_perform_after_scrolled_n_times)
1279/* var bar1= createBar(90,20,'white',1,'black','orange',85,7,3,"");*/
1280
1281
1282var model = null;
1283
1284function showModalDialogForCustomAndForeclosure(url, arg, feature) {
1285    showModalDialog(url, arg, feature);
1286}
1287
1288function showAlert(state) {
1289    alert("In order to access your results list, you must agree to abide by the " + state + " anti-solicitation law.");
1290}
1291
1292function unload() {
1293    //model.onbeforeunload = function () {
1294    var myForm = window.opener.document.forms[0];
1295    var searchType = myForm.searchpagesubmit.value;
1296    if ("Foreclosure_Search" === searchType) {
1297        searchType = "foreclosure";
1298    } else if ("Custom_Search" === searchType) {
1299        searchType = "custom";
1300    }
1301    var state = eval("myForm.state_" + searchType + ".value");
1302    if (window.returnValue != "submitDialog") {
1303        // alert("In order to access your results list, you must agree to abide by the "+state+" anti-solicitation law.");
1304        window.parent.focus();
1305        //window.opener.showAlert(state);
1306    } else {
1307        window.opener.setSessionSolicitationValue(state);
1308        myForm.submit();
1309    }
1310    //}
1311}
1312
1313
1314function showModalDialog(url, arg, feature) {
1315    var opFeature = feature.split(";");
1316    var featuresArray = new Array()
1317    if (document.all) {
1318        for (var i = 0; i < opFeature.length - 1; i++) {
1319            var f = opFeature[i].split("=");
1320            featuresArray[f[0]] = f[1];
1321        }
1322    } else {
1323
1324        for (var i = 0; i < opFeature.length - 1; i++) {
1325            var f = opFeature[i].split(":");
1326            featuresArray[f[0].toString().trim().toLowerCase()] = f[1].toString().trim();
1327        }
1328    }
1329
1330    var h = "400px", w = "400px", l = "100px", t = "100px", r = "yes", c = "yes", s = "no";
1331    if (featuresArray["dialogheight"]) h = featuresArray["dialogheight"];
1332    if (featuresArray["dialogwidth"]) w = featuresArray["dialogwidth"];
1333    if (featuresArray["dialogleft"]) l = featuresArray["dialogleft"];
1334    if (featuresArray["dialogtop"]) t = featuresArray["dialogtop"];
1335    if (featuresArray["resizable"]) r = featuresArray["resizable"];
1336    if (featuresArray["center"]) c = featuresArray["center"];
1337    if (featuresArray["status"]) s = featuresArray["status"];
1338    var modelFeature = "height = " + h + ",width = " + w + ",left=" + l + ",top=" + t + ",model=yes,alwaysRaised=yes" + ",resizable= " + r + ",center=" + c + ",status=" + s;
1339    model = window.open(url, "", modelFeature, null);
1340    model.dialogArguments = arg;
1341
1342}
1343
1344function checkForActiveSession() {
1345    $.ajax({
1346        url: "/servlet/workflow/checkSessionData", success: function (data) {
1347            if (data == null || data.length == 0) {
1348                //  window.location.href = "/index.html";
1349            } else {
1350                if (data == true) {
1351                    window.location.href = "/servlet/workflow/main";
1352                } else {
1353
1354                    window.location.href = "/jsp/rq.jsp?action=switch&page=main";
1355                }
1356            }
1357        }
1358    });
1359}
1360
1361
1362function redirectToSessionExpiryPage() {
1363    sessionStorage.clear();
1364    window.top.location.href = "/jsp/rq.jsp?strPage=error";
1365}
1366
1367function redirectToLoginPage() {
1368    window.location.href = "/jsp/rq.jsp?page=error&action=logout";
1369}
1370
1371function getStatus() {
1372    return status;
1373}
1374
1375function setStatus(data) {
1376    status = data;
1377}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.