//////////////////////////////////////////////////
//--------------OBJETO AJAX---------------------//
function objetoAjax() {	
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
			xmlhttp = false;
  		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}
//---------------------------------------------//
/////////////////////////////////////////////////
//------------FUNCION BUSCANDO-----------------//
function buscando(){
	var loadingc='<center><img src="Imagenes/loading.gif" align="absmiddle"/><br><b>Buscando...</b></center>';
	return loadingc;
}
//---------------------------------------------//
/////////////////////////////////////////////////
//FUNCION SIGUIENTE
var idm=1;
function siguiente() {	
     idm++;
	 for(i=1; i <= 10; i++){
		var div=document.getElementById(i);
		if (div!=null)
		  div.style.display="none";
		if (idm == i){
		  if(div!=null){
			 div.style.display="block";
		  }else{
			   if(i==10){
				  idm=0;
				  siguiente();
			   }else{
				   idm++;
			   }	 
	      }	
		}
		  
	  }	
}
//----------------------------------------------//
/////////////////////////////////////////////////
//FUNCION ANTERIOR
function anterior() {
     idm--;
	 if (idm==0) idm=10;
	 for(i=10; i >= 1; i--){
		var div=document.getElementById(i);
		if (div!=null)
		  div.style.display="none";
		if (idm == i){
		 if(div!=null){
			 div.style.display="block";
			 }else{
			   if(i==1){
				  idm=10;
				  anterior();
			   }else{
				   idm--;
			   }	 
			 }	
		}
		  
	  }	
}
//////////////////////////////////////////////////
