function Nuevo(){
	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 gogo(div,actual,total) { 
var cierro = div+actual;
if (document.getElementById(cierro).style.display == 'none') { 
document.getElementById(cierro).style.display = '';
}
else { 
document.getElementById(cierro).style.display = 'none';
}
var i = 1;
while(i<=total) { 
var cerrar = div+i;
if (i!=actual) {
document.getElementById(cerrar).style.display = 'none';
}
i++;
}

}

function change_image(a) { 
var changi = document.getElementById("imagen_change");
changi.src = 'img/gallery/'+a;
}


function image(id,what,titlee) {
document.getElementById("prodmask").innerHTML = '<img src="ajax-loader.gif">';
       ajax=Nuevo(); 
       ajax.open("POST", "ajax.php");
       ajax.onreadystatechange=function() {
       if (( ajax.readyState==4) && ( ajax.status == 200 )) { 
	document.getElementById("prodmask").innerHTML =  ajax.responseText;

       }
}
       ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("title="+titlee+"&id="+id+"&what="+what);
}
