PageSourceSearch

https://myamericanalliance.com/wp-content/themes/AACCTheme/scripts/globald059.js?vid=4

js myamericanalliance.com collected 2026-10-08 15:49:13 UTC 14,847 bytes, 502 lines download raw bytes

1function log(msg) {
2    typeof console != 'undefined' ? console.log(msg) : $.noop();
3}
4
5/*
6* Purl (A JavaScript URL parser) v2.3.1
7* Developed and maintanined by Mark Perkins, [email protected]
8* Source repository: https://github.com/allmarkedup/jQuery-URL-Parser
9* Licensed under an MIT-style license. See https://github.com/allmarkedup/jQuery-URL-Parser/blob/master/LICENSE for details.
10*/
11
12(function (factory) {
13    if (typeof define === 'function' && define.amd) {
14        define(factory);
15    } else {
16        window.purl = factory();
17    }
18})(function () {
19
20
21    var tag2attr = {
22        a: 'href',
23        img: 'src',
24        form: 'action',
25        base: 'href',
26        script: 'src',
27        iframe: 'src',
28        link: 'href',
29        embed: 'src',
30        object: 'data'
31    },
32
33
34        key = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'], // keys available to query
35
36
37        aliases = { 'anchor': 'fragment' }, // aliases for backwards compatability
38
39
40        parser = {
41            strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
42            loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
43        },
44
45
46        isint = /^[0-9]+$/;
47
48
49    function parseUri(url, strictMode) {
50        var str = decodeURI(url),
51        res = parser[strictMode || false ? 'strict' : 'loose'].exec(str),
52        uri = { attr: {}, param: {}, seg: {} },
53        i = 14;
54
55
56        while (i--) {
57            uri.attr[key[i]] = res[i] || '';
58        }
59
60
61        // build query and fragment parameters
62        uri.param['query'] = parseString(uri.attr['query']);
63        uri.param['fragment'] = parseString(uri.attr['fragment']);
64
65
66        // split path and fragement into segments
67        uri.seg['path'] = uri.attr.path.replace(/^\/+|\/+$/g, '').split('index.html');
68        uri.seg['fragment'] = uri.attr.fragment.replace(/^\/+|\/+$/g, '').split('index.html');
69
70
71        // compile a 'base' domain attribute
72        uri.attr['base'] = uri.attr.host ? (uri.attr.protocol ? uri.attr.protocol + '://' + uri.attr.host : uri.attr.host) + (uri.attr.port ? ':' + uri.attr.port : '') : '';
73
74
75        return uri;
76    }
77
78
79    function getAttrName(elm) {
80        var tn = elm.tagName;
81        if (typeof tn !== 'undefined') return tag2attr[tn.toLowerCase()];
82        return tn;
83    }
84
85
86    function promote(parent, key) {
87        if (parent[key].length === 0) return parent[key] = {};
88        var t = {};
89        for (var i in parent[key]) t[i] = parent[key][i];
90        parent[key] = t;
91        return t;
92    }
93
94
95    function parse(parts, parent, key, val) {
96        var part = parts.shift();
97        if (!part) {
98            if (isArray(parent[key])) {
99                parent[key].push(val);
100            } else if ('object' == typeof parent[key]) {
101                parent[key] = val;
102            } else if ('undefined' == typeof parent[key]) {
103                parent[key] = val;
104            } else {
105                parent[key] = [parent[key], val];
106            }
107        } else {
108            var obj = parent[key] = parent[key] || [];
109            if (']' == part) {
110                if (isArray(obj)) {
111                    if ('' !== val) obj.push(val);
112                } else if ('object' == typeof obj) {
113                    obj[keys(obj).length] = val;
114                } else {
115                    obj = parent[key] = [parent[key], val];
116                }
117            } else if (~part.indexOf(']')) {
118                part = part.substr(0, part.length - 1);
119                if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
120                parse(parts, obj, part, val);
121                // key
122            } else {
123                if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
124                parse(parts, obj, part, val);
125            }
126        }
127    }
128
129
130    function merge(parent, key, val) {
131        if (~key.indexOf(']')) {
132            var parts = key.split('[');
133            parse(parts, parent, 'base', val);
134        } else {
135            if (!isint.test(key) && isArray(parent.base)) {
136                var t = {};
137                for (var k in parent.base) t[k] = parent.base[k];
138                parent.base = t;
139            }
140            if (key !== '') {
141                set(parent.base, key, val);
142            }
143        }
144        return parent;
145    }
146
147
148    function parseString(str) {
149        return reduce(String(str).split(/&|;/), function (ret, pair) {
150            try {
151                pair = decodeURIComponent(pair.replace(/\+/g, ' '));
152            } catch (e) {
153                // ignore
154            }
155            var eql = pair.indexOf('='),
156                brace = lastBraceInKey(pair),
157                key = pair.substr(0, brace || eql),
158                val = pair.substr(brace || eql, pair.length);
159
160
161            val = val.substr(val.indexOf('=') + 1, val.length);
162
163
164            if (key === '') {
165                key = pair;
166                val = '';
167            }
168
169
170            return merge(ret, key, val);
171        }, { base: {} }).base;
172    }
173
174
175    function set(obj, key, val) {
176        var v = obj[key];
177        if (typeof v === 'undefined') {
178            obj[key] = val;
179        } else if (isArray(v)) {
180            v.push(val);
181        } else {
182            obj[key] = [v, val];
183        }
184    }
185
186
187    function lastBraceInKey(str) {
188        var len = str.length,
189            brace,
190            c;
191        for (var i = 0; i < len; ++i) {
192            c = str[i];
193            if (']' == c) brace = false;
194            if ('[' == c) brace = true;
195            if ('=' == c && !brace) return i;
196        }
197    }
198
199
200    function reduce(obj, accumulator) {
201        var i = 0,
202            l = obj.length >> 0,
203            curr = arguments[2];
204        while (i < l) {
205            if (i in obj) curr = accumulator.call(undefined, curr, obj[i], i, obj);
206            ++i;
207        }
208        return curr;
209    }
210
211
212    function isArray(vArg) {
213        return Object.prototype.toString.call(vArg) === "[object Array]";
214    }
215
216
217    function keys(obj) {
218        var key_array = [];
219        for (var prop in obj) {
220            if (obj.hasOwnProperty(prop)) key_array.push(prop);
221        }
222        return key_array;
223    }
224
225
226    function purl(url, strictMode) {
227        if (arguments.length === 1 && url === true) {
228            strictMode = true;
229            url = undefined;
230        }
231        strictMode = strictMode || false;
232        url = url || window.location.toString();
233
234
235        return {
236
237
238            data: parseUri(url, strictMode),
239
240
241            // get various attributes from the URI
242            attr: function (attr) {
243                attr = aliases[attr] || attr;
244                return typeof attr !== 'undefined' ? this.data.attr[attr] : this.data.attr;
245            },
246
247
248            // return query string parameters
249            param: function (param) {
250                return typeof param !== 'undefined' ? this.data.param.query[param] : this.data.param.query;
251            },
252
253
254            // return fragment parameters
255            fparam: function (param) {
256                return typeof param !== 'undefined' ? this.data.param.fragment[param] : this.data.param.fragment;
257            },
258
259
260            // return path segments
261            segment: function (seg) {
262                if (typeof seg === 'undefined') {
263                    return this.data.seg.path;
264                } else {
265                    seg = seg < 0 ? this.data.seg.path.length + seg : seg - 1; // negative segments count from the end
266                    return this.data.seg.path[seg];
267                }
268            },
269
270
271            // return fragment segments
272            fsegment: function (seg) {
273                if (typeof seg === 'undefined') {
274                    return this.data.seg.fragment;
275                } else {
276                    seg = seg < 0 ? this.data.seg.fragment.length + seg : seg - 1; // negative segments count from the end
277                    return this.data.seg.fragment[seg];
278                }
279            }
280
281
282        };
283
284
285    }
286
287    purl.jQuery = function ($) {
288        if ($ != null) {
289            $.fn.url = function (strictMode) {
290                var url = '';
291                if (this.length) {
292                    url = $(this).attr(getAttrName(this[0])) || '';
293                }
294                return purl(url, strictMode);
295            };
296
297
298            $.url = purl;
299        }
300    };
301
302
303    purl.jQuery(window.jQuery);
304
305
306    return purl;
307
308
309});
310
311/*******************
312* Cookie Management Functions
313*******************/
314function ReadCookie(cookieName) {
315    var theCookie = "" + document.cookie;
316    var ind = theCookie.indexOf(cookieName);
317    if (ind == -1 || cookieName == "") return "";
318    var ind1 = theCookie.indexOf(';', ind);
319    if (ind1 == -1) ind1 = theCookie.length;
320    return unescape(theCookie.substring(ind + cookieName.length + 1, ind1));
321}
322
323function createCookie(name, value, minutes) {
324    if (minutes) {
325        var date = new Date();
326        date.setTime(date.getTime() + (minutes * 60 * 1000));
327        var expires = "; expires=" + date.toGMTString();
328    }
329    else var expires = "";
330    document.cookie = name + "=" + value + expires + "; path=/";
331}
332
333function eraseCookie(name) {
334    createCookie(name, "", -1);
335}
336
337/*******************
338* Modal Wireups
339*******************/
340function oModal(Top, Width, Height, OverlayOpacity) {
341    var t = 0, w = 450, h = 450, opacity = 0.7;
342    if (typeof Top != 'undefined') { t = Top; }
343    if (typeof Width != 'undefined') { w = Width; }
344    if (typeof Height != 'undefined') { h = Height; }
345    if (typeof OverlayOpacity != 'undefined') { opacity = OverlayOpacity; }
346    var overlay = $("#nOverlay");
347    var modal = $("#nModal");
348    modal.width(w);
349    modal.height(h);
350    var modal_width = modal.outerWidth();
351    var modal_height = modal.outerHeight();
352    w = modal_width / 2;
353    if (t == 0) {
354        if ($(window).height() < (modal_height - 50)) {
355            t = 50;
356        } else {
357            t = (($(window).height() - modal_height) / 2) - 1
358        }
359    }
360    overlay.css({ "display": "block", opacity: 0 });
361    overlay.fadeTo(200, opacity);
362    modal.css({ "display": "block", "opacity": 0, "margin-left": -w + "px", "top": t + "px" });
363    modal.fadeTo(200, 1);
364}
365
366function cModal() {
367    $("#nOverlay").fadeOut(200);
368    $("#nModal").css({ "display": "none" })
369}
370
371/*******************
372* Equalize container heights
373*******************/
374function equalHeight(group) {
375    var tallest = 0;
376
377    group.css('height', 'auto');
378    group.each(function () {
379        var thisHeight = $(this).height();
380        if (thisHeight > tallest) {
381            tallest = thisHeight;
382        }
383    });
384    group.height(tallest);
385}
386
387/*******************
388* Debouncer
389*******************/
390function debouncer(func, timeout) {
391    var timeoutID, timeout = timeout || 100;
392    return function () {
393        var scope = this, args = arguments;
394        clearTimeout(timeoutID);
395        timeoutID = setTimeout(function () {
396            func.apply(scope, Array.prototype.slice.call(args));
397        }, timeout);
398    }
399}
400
401/*******************
402* AJAX caller; returns the response; function accepting must interpret correctly
403*******************/
404/*
405function execAJAX(sClass, sAction, sParams, sDataType, sType, bAsync) {
406    var retval = null;
407    var data = $.ajax({
408        url: "/ajax/__ajax.aspx",
409        async: bAsync,
410        dataType: sDataType,
411        type: sType,
412        data: { "t": "" + sClass + "", "a": "" + sAction + "", "p": "" + sParams + "", "g": "" + Math.uuidFast() + "" },
413        success: function (response) {
414            retval = response;
415        },
416        error: function (xhr, ajaxOptions, thrownError) {
417            Notify('AJAX ERROR: ' + xhr.status + ' - ' + thrownError);
418        }
419    });
420    return retval;
421}
422*/
423
424function execAJAX(sClass, sAction, sParams, sDataType, sType, bAsync, callback) {
425    var retval = null;
426    var data = $.ajax({
427        url: "/ajax/__ajax.aspx",
428        async: bAsync,
429        dataType: sDataType,
430        type: sType,
431        data: { "t": "" + sClass + "", "a": "" + sAction + "", "p": "" + sParams + "", "g": "" + Math.uuidFast() + "" },
432        success: function (response) {
433            if (callback) {
434                callback(response);
435            } else {
436                return response;
437            } 
438        },
439        error: function (xhr, ajaxOptions, thrownError) {
440            Notify('AJAX ERROR: ' + xhr.status + ' - ' + thrownError);
441        }
442    });
443}
444
445function IsAJAXResponseValid(Response, AutoProcess, _class, _method, _params) {
446    if (Response != null) {
447        if (AutoProcess == true) {
448            if (Response.status == "success") {
449                return true;
450            } else {
451                Notify(Response.errorDescription);
452                return false;
453            }
454        } else {
455            return true;
456        }
457    } else {
458        Notify('AJAX ERROR: ' + _class + ' - ' + _method + ' - ' + _params);
459        return false;
460    }
461}
462
463//This function extends the math class to create a guid for using to ensure no caching
464(function () {
465    // Private array of chars to use
466    var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
467    Math.uuidFast = function () {
468        var chars = CHARS, uuid = new Array(36), rnd = 0, r;
469        for (var i = 0; i < 36; i++) {
470            if (i == 8 || i == 13 || i == 18 || i == 23) {
471                uuid[i] = '-';
472            } else if (i == 14) {
473                uuid[i] = '4';
474            } else {
475                if (rnd <= 0x02) rnd = 0x2000000 + (Math.random() * 0x1000000) | 0;
476                r = rnd & 0xf;
477                rnd = rnd >> 4;
478                uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
479            }
480        }
481        return uuid.join('');
482    };
483})();
484
485
486/*******************
487* START ONLOAD
488*******************/
489
490
491
492
493/*******************
494* END ONLOAD
495*******************/
496
497
498
499
500
501
502

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.