var Common = {
	debug: true,
	navigate: function(parameters) {
		if(!Object.isString(parameters)) {
			parameters = Object.toQueryString(parameters);
		}
		window.location = "default.aspx?" + parameters;
	},
	log: function() {
		if(!this.debug) return;
		if(window.console) {
			console.log.apply(console, arguments);
		} else {
			if(!this.logger) {
				this.logger = new Element("div", {
					style: "height: 10px; position: absolute; left: 0px; bottom: 0px; width: 100%; background: #ccc; color: black; font-size: 10px; overflow: hidden;"
				}).observe("click", function() {
					if(this.getStyle("height") == "10px") {
						this.setStyle({ "height": "200px", "overflow": "auto" });
					} else {
						this.setStyle({ "height": "10px", "overflow": "hidden" });
					}
				});
				this.logger.insert(new Element("div", { style: "padding: 5px; margin: 5px; background: white;" }));
				$$("body")[0].insert(this.logger);
			}
			var str = ""
			$A(arguments).each(function(a, i) {
				if(i) str += ", ";
				str += a;
			});
			this.logger.down().insert(str + "<br />");
		}
	},
	document: function() {
		return $(document.documentElement) || $(document.body);
	}
};


