Home directory for Malawi's wwwroot
Duncan Ewan
2021-02-19 3e758c29e0fde36fc088efcfc88f9a3014432b64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * Copyright (c) 1995-2005 Macromedia, Inc. All rights reserved. 
*/
// $Revision: 1.49 $
// Vars
Vars = function(qStr) {
    this.numVars = 0;
    if(qStr != null) {
        var nameValue, name;
        var pairs = qStr.split('&');
        var pairLen = pairs.length;
        for(var i = 0; i < pairLen; i++) {
            var pair = pairs[i];
            if( (pair.indexOf('=')!= -1) && (pair.length > 3) ) {
                var nameValue = pair.split('=');
                var name = nameValue[0];
                var value = nameValue[1];
                if(this[name] == null && name.length > 0 && value.length > 0) { 
                    this[name] = value;
                    this.numVars++;
                }
            }
        } 
    }
}
Vars.prototype.toString = function(pre) {
    
    var result = '';
    if(pre == null) { pre = ''; }
    for(var i in this) {
        if(this[i] != null && typeof(this[i]) != 'object' && typeof(this[i]) != 'function' && i != 'numVars') {
            result += pre + i + '=' + this[i] + '&';
        }
    }
    if(result.length > 0) result = result.substr(0, result.length-1);
    return result;
}
getSearch = function(wRef) {
 
    var searchStr = '';
    if(wRef.location.search.length > 1) {
        searchStr = new String(wRef.location.search);
        searchStr = searchStr.substring(1, searchStr.length);
    }
    return searchStr;
}
var lc_id = Math.floor(Math.random() * 100000).toString(16);
if (this != top)
{
        // Bug Number 66391. Added try catch block while setting the properties Windows.lc_id, Windows.getSearch and Windows.Vars to catch the permission denied exception.
        try
        {
            top.Vars = Vars;
            top.getSearch = getSearch;
            top.lc_id = lc_id;
        }  
        catch(e){}
}