
	Inheritence.extend(String.prototype, { 
		
		/* Gets all numbers from a string and returns an array if more than one */
			
		parseInts: function() {
			var theArray = this.split(/\D+/g);
		
			/* Mozilla returns empty item if split occured at beginning or end of the string so must remove these if present */
			
			if(isNaN(parseInt(theArray[0]))) 
				theArray.shift();
			if(isNaN(parseInt(theArray[theArray.length-1]))) 
				theArray.pop();
				
			return (theArray.length == 1)? 
				theArray[0]: 
				theArray;
		},
			
		/* Removes hyphens from hyphenated words and makes following letter uppercase 
			looks for (hyphen)(letter)
			returns string with hyphens replaced with uppercase letter
			or orginal string if no hyphens */

		toFirstUpper: function() {
		
			var regEx = /(-)([a-z])/;
			var reArray;
			
			return (reArray = this.match(regEx))?
				this.replace(regEx, reArray[2].toUpperCase()):
				this;
		},
		
		stripScripts: function() {
			
			var RE_script = '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)';
			return this.replace(RE_script, '');
		},
		
		evalScripts: function() {
			
			var script = '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)';
			var regExp = new RegExp(script, 'img');
			var scripts = this.match(regExp) || [];
			for(var i = 0; i < scripts.length; i++)
				eval((scripts[i].match(script, 'im'))[1]);
		},

		trim: function(){
		    return this.replace(/^\s*|\s*$/g,'');
		}
	});
	
