var request = {
	query:function(v) {
		var p = new RegExp(v + "=([^?&]*)", "ig");
		var u = location.search;
		return u.match(p) ? u.match(p)[0].substr(v.length + 1) : null;
	}
}


var wiz = {};
wiz.util = {};
wiz.util.query = function(v) {
	var p = new RegExp(v + "=([^?&]*)", "ig");
	var u = location.search;
	return u.match(p) ? u.match(p)[0].substr(v.length + 1) : null;
};

wiz.util.serialize = function(a) {
	var s = [];
	if (a.constructor == Array) {
		for (var i = 0; i < a.length; i++) {
			s.push(a[i].name + '=' + encodeURIComponent(a[i].value));
		}
	} else {
		for (var j in a) {
			s.push(j + '=' + encodeURIComponent(a[j]));
		}
	}
	return s.join('&');
}

wiz.util.unSerialize = function(s, opt_type) {
	var tmp = s.split("&"), result = {};
	for (var i = 0; i < tmp.length; i++) {
		var index = tmp[i].indexOf("=");
		var k = tmp[i].substr(0, index);
		var v = tmp[i].substr(index + 1);
		result[k] = decodeURIComponent(v);
	}
	return result;
}
