// JavaScript Document

var http = createRequestObject();

var isBusy ='';
function sndReq(action,idoutput) {
	if (isBusy == true)
	{
		http.onreadystatechange = null;
		http.abort();
	}
	http.open('get', '/include/ajax.inc.php?'+action+'&idoutput='+idoutput);
	isBusy = true;
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function handleResponse() {
	if(http.readyState == 4){
		var response = http.responseText;
		var update = new Array();

		if(response.indexOf(']|[' != -1)) {
			update = response.split(']|[');
			document.getElementById(update[0]).src = update[1];
			if (update[1]=='http://www.passioneporno.com/img/thumb.jpg') {
				/*handleResponse.intervallo = window.setInterval(function () {
				//var intervallo = window.setInterval(function () {
				  sndReq('Url='+update[2],update[0]);
				},5000);*/
			} else {
				//clearInterval(handleResponse.intervallo);
			}
		}
	} else {
		isBusy = false;
	}
}

function remdiv(divid) {
	document.getElementById(divid+'minus').style.display='none';
	document.getElementById(divid).innerHTML = '';
	//var DIVtoRemove = document.getElementById(divid);
	//DIVtoRemove.parentNode.removeChild(DIVtoRemove);
}

