// tiny necessities

//var $ = document.getElementById;
function $(e){
	if( typeof(e) != 'string' ) 	return e;
	if( document.getElementById ) 	return document.getElementById(e); 	// please, please, please
	else if( document.all ) 		return document.all[e]; 			// d'oh!
}

function qw(s){ return s.split(/\s+/); }

try { undefined; }catch(e){ var undefined; } // is your browser really that old and crappy?  seriously... UPGRADE!

// and just a few, handy-dandy methods, soon to be extracted
var Util = new Object();
Util.hmap = function(that, func, all){
	// return this.properties().map(function(p){ func(this[p], p); });
	var returns = [];
	for(var i in that)
		if( typeof(that[i]) != 'function' || all ) // ignore methods unless requested
			returns[returns.length] = func(that[i], i);
	return returns;
}
Util.compact = function(that){
	var compacted = [];
	for(var i=0; i<that.length; ++i)
		if(that[i] != null && that[i] != undefined)
			compacted[compacted.length] = that[i];
	return compacted;
};
Util.map = function(that, func){
	var returns = [];
	if( that.length )
		for(var i=0; i<that.length; ++i)
			returns[returns.length] = func(that[i], i);
	return returns;
};
