function $(id){return document.getElementById(id);}
function $$(o,tagname){return o.getElementsByTagName(tagname);}
function $$0(o,tagname){return o.getElementsByTagName(tagname).item(0);}
if (typeof(String.prototype.trim) == 'undefined') {
	String.prototype.trim = function () {
	    return this.replace(/^\s*/,'').replace(/\s*$/,'');
	};
}
if (typeof(Array.prototype.indexOf) == 'undefined') {
	Array.prototype.indexOf = function( v, b, s ) {
	 for( var i = +b || 0, l = this.length; i < l; i++ ) {
	  if( this[i]===v || s && this[i]==v ) { return i; }
	 }
	 return -1;
	};
}
if (typeof(Array.prototype.unique) == 'undefined') {
	Array.prototype.unique = function( b ) {
	 var a = [], i, l = this.length;
	 for( i=0; i<l; i++ ) {
	  if( a.indexOf( this[i], 0, b ) < 0 ) { a.push( this[i] ); }
	 }
	 return a;
	};
}
if (typeof(Array.prototype.trim) == 'undefined') {
	Array.prototype.trim = function() {
	 var a = [], i, l = this.length;
	 for( i=0; i<l; i++ ) {
	  if(this[i].trim() != '') { a.push(this[i]); }
	 }
	 return a;
	};
}
if (typeof(Array.prototype.forEach) == 'undefined') {
	Array.prototype.forEach = function( f ) {
	 var i = this.length, j, l = this.length;
	 for( i=0; i<l; i++ ) { if( ( j = this[i] ) ) { f( j ); } }
	};
}
if (typeof(String.prototype.toint) == 'undefined') {
	String.prototype.toint = function() {
	 return parseInt(this);
	};
}
if (typeof(String.prototype.sanitize) == 'undefined') {
	String.prototype.sanitize = function() {
	 return this.replace(/[<>]/g,'');
	};
}

