	// Ajax functionality
	var ajaxBase = 'http://www.toucanweb.net/~icehols/inc/ajax/';
	function dispatchAjax(url, data){
		if(url && url != ''){
			var xmlHttpReq = false;
			var self = this;
			if (window.XMLHttpRequest){
				self.xmlHttpReq = new XMLHttpRequest();
			} else if (window.ActiveXObject){
				self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
			}
			self.xmlHttpReq.open('POST', ajaxBase+url, true);
			self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			self.xmlHttpReq.onreadystatechange = function(){
				if(self.xmlHttpReq.readyState == 4){
					handleAjax(self.xmlHttpReq.responseText);
				}
			}
			self.xmlHttpReq.send("data="+serialize(data));
		}
	}
	function handleAjax(response){
		eval(response);
		return false;
	}
	function serialize(inp){
		var getType = function( inp ){
			var type = typeof inp, match;
			if(type == 'object' && !inp){
				return 'null';
			}
			if (type == "object") {
				if(!inp.constructor){
					return 'object';
				}
				var cons = inp.constructor.toString();
				if (match = cons.match(/(\w+)\(/)) {
					cons = match[1].toLowerCase();
				}
				var types = ["boolean", "number", "string", "array"];
				for (key in types) {
					if (cons == types[key]) {
						type = types[key];
						break;
					}
				}
			}
			return type;
		};
	 
		var type = getType(inp);
		var val;
		switch (type) {
			case "undefined":
				val = "N";
				break;
			case "boolean":
				val = "b:" + (inp ? "1" : "0");
				break;
			case "number":
				val = (Math.round(inp) == inp ? "i" : "d") + ":" + inp;
				break;
			case "string":
				val = "s:" + inp.length + ":\"" + inp + "\"";
				break;
			case "array":
				val = "a";
			case "object":
				if (type == "object") {
					var objname = inp.constructor.toString().match(/(\w+)\(\)/);
					if (objname == undefined) {
						return;
					}
					objname[1] = serialize(objname[1]);
					val = "O" + objname[1].substring(1, objname[1].length - 1);
				}
				var count = 0;
				var vals = "";
				var okey;
				for (key in inp) {
					okey = (key.match(/^[0-9]+$/) ? parseInt(key) : key);
					vals += serialize(okey) +
							serialize(inp[key]);
					count++;
				}
				val += ":" + count + ":{" + vals + "}";
				break;
		}
		if (type != "object" && type != "array") val += ";";
		return val;
	}
