/**
 * Ein paar Metzhoden für Strings hinzufügen
 */
String.prototype.htmlEntities = function () {
   return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
};
String.prototype.htmlEntityDecode = function () {
   return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
};
String.prototype.trim = function () {
	return this.replace(/\s+$/,"").replace(/^\s+/,"");
};

Array.prototype.contains = function(obj) {
	var i, listed = false;
	for (i=0; i<this.length; i++) {
		if (this[i] === obj) {
			listed = true;
			break;
		}
	}
	return listed;
};

var parseQueryString = function() {
		
	var str = window.location.search;
	var objURL = {};

	str.replace(
		new RegExp( "([^?=&]+)(=([^&]*))?", "g" ),
		function( $0, $1, $2, $3 ){
			objURL[ $1 ] = $3;
		}
	);
	return objURL;
};