var mooalert = new Class({
	initialize: function(template){
		this.test(template);
	},
	test : function(template){

		/*

		<div id="mooalert_outer">
		<div id="mooalert_inner">
		<div class="content">

		</div>
		</div>
		</div>

		*/

		var mooalert_outer = new Element('div',{'id': 'mooalert_outer'});
		var mooalert_inner = new Element('div',{'id': 'mooalert_inner'});

		var mooalert_header = new Element('div',{'class': 'header'});
		var mooalert_footer = new Element('div',{'class': 'footer'});

		var html='<p class="ajax"></p>';

		var mooalert_content = new Element('div',{'class': 'content','html':html});

		mooalert_inner.adopt([mooalert_header,mooalert_content,mooalert_footer]);

		$(document.body).adopt([mooalert_outer,mooalert_inner]);


		new Request.HTML({
			method: 'post',
			url: '/linsenajax.php',
			evalScripts:false,
			evalResponse:false,
			onSuccess:function(responseTree, responseElements, responseHTML, responseJavaScript)
			{
				$$('#mooalert_inner div.content').set('html',responseHTML);
					eval(responseJavaScript);
			}
		}).send("element=mooalert&template="+template+'');


		/*
		new Request({
		method: 'post',
		url: '/linsenajax.php',
		onSuccess:function(response)
		{
		var responsejs = response.match(/<script>([\s\S]*?)<\/script>/gi);
		$$('#mooalert_inner div.content').set('html',response);
		eval(responsejs);
		}
		}).send("element=mooalert&template="+template+'');
		*/
	}
});

/*

url - (string: defaults to null) The URL to request.
method - (string: defaults to 'post') The HTTP method for the request, can be either 'post' or 'get'.
data - (string: defaults to '') The default data for Request:send, used when no data is given.
link - (string: defaults to 'ignore') Can be 'ignore', 'cancel' and 'chain'.
'ignore' - Any calls made to start while the request is running will be ignored. (Synonymous with 'wait': true from 1.11)
'cancel' - Any calls made to start while the request is running will take precedence over the currently running request. The new request will start immediately, canceling the one that is currently running. (Synonymous with 'wait': false from 1.11)
'chain' - Any calls made to start while the request is running will be chained up, and will take place as soon as the current request has finished, one after another.
async - (boolean: defaults to true) If set to false, the requests will be synchronous and freeze the browser during request.
encoding - (string: defaults to 'utf-8') The encoding to be set in the request header.
headers - (object) An object to use in order to set the request headers.
isSuccess - (function) Overrides the built-in isSuccess function.
evalScripts - (boolean: defaults to false) If set to true, script tags inside the response will be evaluated.
evalResponse - (boolean: defaults to false) If set to true, the entire response will be evaluated. Responses with javascript content-type will be evaluated automatically.
emulation - (boolean: defaults to true) If set to true, other methods than 'post' or 'get' are appended as post-data named '_method' (used in rails)
urlEncoded - (boolean: defaults to true) If set to true, the content-type header is set to www-form-urlencoded + encoding
noCache - (boolean; defaults to false) If true, appends a unique noCache value to the request to prevent caching. (IE has a bad habit of caching ajax request values. Including this script and setting the noCache value to true will prevent it from caching. The server should ignore the noCache value.)
*/