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;
	
}

function cargar_pagina(dato)
{
	divresultado=document.getElementById('paginationdemo');
	var Aleatorio=parseInt(Math.random()*99999999);
	ajax=new objetoAjax();
	ajax.open("GET","galeria_muebles.php?pagina="+dato+"&rand="+Aleatorio,true);
	ajax.onreadystatechange=useHttpResponse;
	ajax.send(null)
}

function useHttpResponse() {

   if (ajax.readyState == 4) {
   		 if(ajax.status == 200) {
			divresultado.innerHTML=ajax.responseText;
		}
   }else{
		divresultado.innerHTML = '<div align = "center">..loading</div>';

   }
  
}

function ver_detalle(dato,cat){
	jQuery.ajax({ 
		url: "zoom.php?id="+dato+"&categoria="+cat,
		type: "GET",
		success: function(datos){	
			jQuery('#producto').fadeOut("slow",function(){jQuery('#producto').html(datos);});
			jQuery('#producto').fadeIn("slow"); 			
		}
	});
	
	//ver_detalle_zoom(dato);
	
}

function ver_detalle_zoom(dato){
	jQuery.ajax({ 
		url: "zoom.php?mueble="+dato,
		type: "GET",
		success: function(datos){	
			jQuery('#imagen_zoom').fadeOut("slow",
				function(){
					jQuery('#imagen_zoom').html(datos);
				});
			jQuery('#imagen_zoom').fadeIn("slow"); 			
		}
	});	
}

function ver_secciones(dato){
	jQuery.ajax({ 
		url: "ver_lista.php?tipo="+dato,
		type: "GET",
		success: function(datos){	
			jQuery('#subcat').fadeOut("slow",function(){jQuery('#subcat').html(datos);});
			jQuery('#subcat').fadeIn("slow"); 			
		}
	});
	
}


