var evajs = new Class({
	
	initialize: function(responseText,options) {
		this.options = Object.extend({
			tagScript: new Array(),
			tagEndScript: new Array(),
			jsScripts: new Array(),
			totalScripts: 0,
			lastSIndex: 0,
			lastEindex: 0,
			vsc: "<script>",
			evsc: "</script>"
		}, options || {});
		this.responseText = responseText;
	},
	
	parse: function() {
		while (this.responseText.indexOf(this.options.vsc,this.options.lastSIndex) !== -1) {
			this.options.tagScript[this.options.tagScript.length] = this.responseText.indexOf(this.options.vsc,this.options.lastSIndex);
			this.options.tagEndScript[this.options.tagEndScript.length] = this.responseText.indexOf(this.options.evsc,this.options.lastEindex);
			this.options.lastSIndex = this.options.tagScript[this.options.tagScript.length-1]+8;
			this.options.lastEindex = this.options.tagEndScript[this.options.tagEndScript.length-1]+9;
			this.options.jsScripts[this.options.jsScripts.length] = this.responseText.substring(this.options.lastSIndex,this.options.tagEndScript[this.options.tagEndScript.length-1]);
		}
		this.options.totalScripts = this.options.jsScripts.length;
	},
	
	run: function() {
		for(i=0;i<this.options.jsScripts.length;i++) {
			eval(this.options.jsScripts[i]);
		}
	}
	
});