/*
	Generic Utilities
*/
var mcf = function() {
	
	/*
		Read a page's GET URL variables and return them as an associative array.
	*/
	this.getUrlVars = function() {		
		var vars = [], hash;
		var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
		
		for(var i = 0; i < hashes.length; i++) {
		    hash = hashes[i].split('=');
		    vars.push(hash[0]);
		    vars[hash[0]] = hash[1];
		}
		
		return vars;
	};
	
	
	
	/*
		Dump an object to easily view its contents
	*/
	this.dump = function(theObj){
		
		if(theObj.constructor == Array || theObj.constructor == Object) {
			document.write("<ul>")
			for(var p in theObj) {
				if(theObj[p].constructor == Array || theObj[p].constructor == Object){
					document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
					document.write("<ul>");
					print_r(theObj[p]);
					document.write("</ul>");
				} else {
					document.write("<li>["+p+"] => "+theObj[p]+"</li>");
				}
			}
			document.write("</ul>");
		}
	}

	
};

var mcf = new mcf();
