function addLoadEvent(func) {
	var oldonload = window.onload;
	if ( !window.onload ) {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

/*--- supportive functions for controlling classnames ---*/
String.prototype.attach = function ( sClass ) {
	var string = this;
	if ( string.contains( sClass ) ) {
		return string;	
	} else {
		return string += ( string != "" ? " " : "" ) + sClass;
	}
	
}
String.prototype.detach = function ( sClass ) {
	var string = this;
	return string.replace ( ( string.indexOf ( " " ) !=-1 ? " " : "" ) + sClass, "" );
}
String.prototype.contains = function ( sString ) {
	var string = this;
	return this.indexOf ( sString ) !=-1;
}

if ( !Array.prototype.push ) {
	Array.prototype.push = function ( item ) {
		this [ this.length ] = item;
		return this.length;
	}
}
