//Created by Sean Kane (http://celtickane.com/programming/code/ajax.php)
//Feather Ajax v1.0.1

function AjaxObject101(readyStateDoneFunction) {
	this.createRequestObject = function() {
		try {
			var ro = new XMLHttpRequest();
		}
		catch (e) {
			var ro = new ActiveXObject("Microsoft.XMLHTTP");
		}
		return ro;
	}
	this.sndReq = function(action, url, data) {
		if (action.toUpperCase() == "POST") {
			this.http.open(action,url,true);
			this.http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			this.http.onreadystatechange = this.handleResponse;
			this.http.send(data);
		}
		else {
			this.http.open(action,url + '?' + data,true);
			this.http.onreadystatechange = this.handleResponse;
			this.http.send(null);
		}
	}
	this.handleResponse = function() {
		if ( me.http.readyState == 4) {
			if (typeof me.funcDone == 'function') { me.funcDone();}
			readyStateDoneFunction(me);
		}
		if ((me.http.readyState == 1) && (typeof me.funcWait == 'function')) { me.funcWait(); }
	}
	var me = this;
	this.http = this.createRequestObject();
	
	var funcWait = null;
	var funcDone = null;
}

var wstawTop10front = function(me){document.getElementById('hity_main').innerHTML = me.http.responseText;}

var wstawFormWyszFront = function(me){
	document.getElementById('wyszukiwarka_wczasy').innerHTML = me.http.responseText;
             	setAktywny(document.wyszgrupa.grupa.value);
		Lightbox.scanLinks();
}

var wstawFormWyszZest = function(me){
	document.getElementById('wysz_main').innerHTML = me.http.responseText;
}

