function var_dump(o){
		
		if(typeof o == 'object' || typeof o == 'array' || typeof o == 'function'){
			var txt = ''
			for(var prop in o){
				txt += prop + " = " + o[prop] + "\n";
			}
		}
		else if(typeof o == 'string' || typeof o == 'number' ){
			var txt = o;
		}
		else if(typeof o == 'boolean'){
			var txt = (o) ? 'true' : 'false';
		}
		else{
			var txt = o;
		}
		return txt;	
	}
	
function debug($obj) {
	    if (window.console && window.console.log){
			window.console.log(var_dump($obj));
		}
	};