// JavaScript Document

var timerID=null;


function server_interaction_START(){
	init_tooltips();
	server_interation_OPPS();
}

function server_interaction_STOP(){
	if (timerID!=null){
	clearTimeout(timerID);
	}
}

function server_interation_OPPS(){
	
	document.getElementById('sigStat').name="MicodataSIG::Comprobando el estado del servicio.<br> ...Espere...";
	document.getElementById('sigStat').scr='img/ok.png';
	document.getElementById('idStat').name="MicodataID::Comprobando el estado del servicio.<br> ...Espere...";
    document.getElementById('idStat').scr='img/ask.png';
	document.getElementById('docsStat').name="MicodataDOCS::Comprobando el estado del servicio.<br> ...Espere...";
	document.getElementById('docsStat').scr='img/ask.png';
	
	var ajax=nuevoAjax();
	ajax.open("POST", "includes/includesPHP/web_productStatus.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			var text = ajax.responseText
			var info = text.split("#");
			
			var temp = info[0].split("|");
			document.getElementById('sigStat').name="MicodataSIG::"+temp[1];
			document.getElementById('sigStat').src=temp[0];
			
			temp = info[1].split("|");
			document.getElementById('idStat').name="MicodataID::"+temp[1];
			document.getElementById('idStat').src=temp[0];
			
			temp = info[2].split("|");
			document.getElementById('docsStat').name="MicodataDOCS::"+temp[1];
			document.getElementById('docsStat').src=temp[0];
		
			//init_tooltips();
			timerID=setTimeout(function(){server_interation_OPPS()}, 5000);
			}
	 	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send('H=0');
}
