/*  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                        UDC.c_query.js
    
                             -~|~-

    Copyright (c) Samuel Trygger. All Rights Reserved. You may
    use this code only if this entire copyright notice appears
    unchanged.

    Contact samuel@trygger.nu for all other uses.

                             -~|~-

    Description : Parses a URL query string, and lets you access the received
                  values through their keys.
    Requires    : Nothing in particular.
    Tested with : Microsoft Internet Explorer 6.0.2600.0000     Win2000
                  Netscape Communicator 4.79                    Win2000
                  Netscape 6.2                                  Win2000
    Author      : Samuel Trygger
    Contact     : samuel@trygger.nu
    Home Page   : http://samuel.trygger.nu/devzone/javascript/

    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  */

/*  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  */
    var _HLP_VAR_QUERY_VERSION = 1.1;
/*  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  */
    function c_query() {
        this.length  = 0;
        this.VERSION = _HLP_VAR_QUERY_VERSION;
        if (arguments[0] + '' != 'undefined' && arguments[0]) this.parseQuery();

        return this;
    }
/*  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  */
    function _HLP_FNC_QUERY_ParseQuery() {
        var loc  = window.location.href;
        var q    = loc.indexOf('?');
        var pairs;

        if (q == -1) return false;
        
        loc = loc.substring(q + 1);
        pairs = loc.split('&');
        for (var i = 0; i < pairs.length; i++) {
            var kvp = pairs[i].split('=');
            this[this.length] = new _HLP_OBJ_QUERY_KeyValPair(kvp[0], kvp[1]);
            this.length++;
        }
    }
    c_query.prototype.parseQuery = _HLP_FNC_QUERY_ParseQuery;
/*  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  */
    function _HLP_FNC_QUERY_GetVal(key) {
        var ret = '';
        for (var i = 0; i < this.length; i++) {
            if (this[i].key == key) ret = this[i].val;
        }
        return ret;
    }
    c_query.prototype.getVal = _HLP_FNC_QUERY_GetVal;
/*  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  */
    function _HLP_OBJ_QUERY_KeyValPair(key, val) {
        this.key = key;
        this.val = val;
        
        return this;
    }
/*  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  */
