function printr(obj, use_alert){
	var desc = 'Type: '+ typeof(obj) +"\r\n--------------------\r\n\r\n";
	var num = 0;
	for(var i in obj){
		desc += i +' = '+ (typeof(obj[i]) == 'function' ? '[FUNCTION]' : obj[i]) +"\r\n";
		if(use_alert){
			desc += "\r\n\r\n";
			alerted = false;
			if(!(++num%10)){
				alerted = true;
				alert(desc);
				desc = '';
			}
		}else{
			debug(desc);
			desc = '';
		}
	}
	if(use_alert && !alerted){
		alert(desc);
	}
}

function debug(msg){
	var obj = $('debug');
	if(!obj){
		obj = document.createElement('textarea');
		obj.replaced = true;
		obj.id = 'debug';
		if(!obj.style.width) obj.style.width = '600px';
		if(!obj.style.height) obj.style.height = '400px';
		document.body.appendChild(obj);
	}
	obj.value += "\r\n"+ msg;
	obj.scrollTop = obj.scrollHeight;
}

function getType(obj){
	var obj = $(obj);
	alert(typeof(obj));
}
