$.urlParam = function (name) {
    var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
    return (results == null) ? 0 : decodeURIComponent(results[1].replace(/\+/g, '%20')) || 0;
}

function parse() {
    var SEPARATOR = ',';

    var ht = 0;
    if ($.urlParam('ht') != null) {
        ht = $.urlParam('ht');
    }

    /*
    if ($.urlParam('s') != null) {
        var xy = $.urlParam('s').split('x');
        $('#myBar').width(xy[0]);
        $('#myBar').height(xy[1]);
    }
    */
    var hd = $.urlParam('hd') ? $.urlParam('hd').split(SEPARATOR) : [];
    for (var i = 0, max = hd.length; i < max; i++) {
        hd[i] = +hd[i];
    }
    var hl = $.urlParam('hl') ? $.urlParam('hl').split(SEPARATOR) : [];

    var twd = $.urlParam('twd') ? $.urlParam('twd').split(SEPARATOR) : [];
    for (var i = 0, max = twd.length; i < max; i++) {
        twd[i] = +twd[i];
    }
    var twl = $.urlParam('twl') ? $.urlParam('twl').split(SEPARATOR) : [];

    var al = $.urlParam('al') ? $.urlParam('al').split(SEPARATOR) : [];
    var ad = $.urlParam('ad') ? $.urlParam('ad').split(SEPARATOR) : [];
    for (var i = 0, max = ad.length; i < max; i++) {
        ad[i] = +ad[i];
    }

	var q = [];
	q['ht'] = ht;
	q['hl'] = hl;
    q['hd'] = hd;
	q['twl'] = twl;
    q['twd'] = twd;
	q['al'] = al;
	q['ad'] = ad;
	return q;
}
