function xmlhttpPost(strURL,ima,secc) {
    var xmlHttpReq = false;
    var self = this;
	strURL=strURL+'.php';
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
	updatepage("Cargando...",secc);
	window.location.hash="iniciopagina"; 
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText,secc);
        }
    }
    self.xmlHttpReq.send(ima);
}
function getquerystring(ima) {

    qstr = 'i=' + ima;  // ATENCION: no '?' antes de la cadena de la consulta
    return qstr;
}
function updatepage(str,secc){
    document.getElementById(secc).innerHTML = str;
}
function toggler_foto(id,let,tx){
	el = document.getElementById(id);
	var display = el.style.display ? '' : 'none';
	if (el.style.display){
		document.getElementById(let).innerHTML="Ocultar "+tx;
	}
	else
	{
		document.getElementById(let).innerHTML="Mostrar "+tx;
	}
	
	el.style.display = display;

}



function enl_aj(){
	// set mouse plus cursor, assign IDs, fix IE alt tooltip bug for thumbs 
    enl_imglist = document.getElementsByTagName('img');  
	//alert(enl_imglist)  
    for (var enl_i=0; enl_i<enl_imglist.length; enl_i++) 
    { 
      if (typeof enl_imglist[enl_i].onclick == 'function') 
	  { 
        enl_ui = eval(enl_imglist[enl_i].onclick).toString(); 
        if (enl_ui.search(/enlarge/) != -1) 
        { 
          enl_imglist[enl_i].title = ''; 
          if (enl_isie) enl_imglist[enl_i].galleryimg = 'no'; 
          if (!enl_imglist[enl_i].id) enl_imglist[enl_i].id = 'enl_autoid'+enl_i; 
          enl_setcur(enl_imglist[enl_i],enl_pluscur,'pointer','hand'); 
        } 
      }
	} 
	//alert("ejecutaaddo "+enl_i+" veces...");
}
function xmlhttpPost2(strURL,ima,secc){
	var xmlHttpReq = false;
    var self = this;
	strURL=strURL+'.php';
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
	updatepage("Cargando...",secc);
	window.location.hash="iniciopagina"; 
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText,secc);
			enl_aj();
        }
    }
    self.xmlHttpReq.send(ima);
}


function l_2(strURL,ima,secc,strURL2,ima2,secc2) {
    var xmlHttpReq = false;
    var self = this;
	strURL=strURL+'.php';
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
	updatepage("Cargando...",secc);
	window.location.hash="iniciopagina"; 
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText,secc);
			xmlhttpPost2(strURL2,ima2,secc2);
        }
    }
    self.xmlHttpReq.send(ima);
}