function popup(ventana)
{ 
	win = window.open(ventana, '_blank', 'width=420,height=330,resizable=0,scrollbars=1');
}

function doRem()
{
	document.forms.Rem.submit();
}
function VerLista ( iLista ){
	var hWin = window.open('http://www.medtech.com.ar/VerLista.asp?lista=' + iLista +'&sty=/lista.css', 'Lista', 'width=600,height=400,status=no,scrollbars=yes,left=50,top=50');
	if (hWin)
		hWin.focus()
} 

// listener del event
function handleHttpResponse() {
	
	if (http.readyState == 4) {	  
	  if (http.responseText.indexOf('invalid') == -1) {
		var xmlDocument		= http.responseXML; 
		de = xmlDocument.documentElement
		if (de!=null)
					
			document.getElementById("iCantidadClinicas").innerHTML=  de.childNodes[0].attributes[0].nodeValue ;
			document.getElementById("iCantidadUsuarios").innerHTML=  de.childNodes[1].attributes[0].nodeValue ;
			document.getElementById("iCantidadLogueados").innerHTML=  de.childNodes[2].attributes[0].nodeValue ;
			document.getElementById("iCantidadClinicasLogueados").innerHTML=  de.childNodes[3].attributes[0].nodeValue ;			
			document.getElementById("iCantidadTurnos").innerHTML=  de.childNodes[4].attributes[0].nodeValue ;			


			
      }
     isWorking = false;

  }

}

function callServer(){
	if ( LastSecond == 0 ) {
		//document.getElementById("refresco").innerHTML = "..."

		document.getElementById("iCantidadClinicas").innerHTML="" ;
		document.getElementById("iCantidadUsuarios").innerHTML="" ;
		document.getElementById("iCantidadLogueados").innerHTML="" ;
		document.getElementById("iCantidadClinicasLogueados").innerHTML= ""  ;			
		document.getElementById("iCantidadTurnos").innerHTML=  "";			


		http.open("GET", "/turnosPortal/getXML.asp?" + Math.random() , true);
		isWorking = true;
		//http.overrideMimeType('text/xml');
		http.onreadystatechange = handleHttpResponse;
		http.send(null);
		//handleHttpResponse();
		LastSecond = SegundosRefresco
	}
	else{	
		LastSecond--;
		document.getElementById("refresco").innerHTML = "refreshing in "+LastSecond+" secs.";
	}

}