behaviour_rules["td.evento"] = function(element){ element.onclick = function(evt){ var evento = evt ? evt : window.event; var target = evento.target ? evento.target : evento.srcElement; Ajax("componente/ajax_getevento?id=1566&evento="+target.id.substr(6),cambiaEvento) return false; } }; function cambiaEvento(){ if(request.readyState==4){ var doc=request.responseXML.firstChild setText("titulo_evento",doc.getAttribute("titulo")) setText("descripcion_evento",doc.getAttribute("descripcion")) setText("fecha_evento",doc.getAttribute("fecha")) var forms=document.getElementById("borrar_evento").getElementsByTagName("form") forms[0].action="componente/c_borra_evento?id=1566&evento="+doc.getAttribute("id"); var container_imagen=document.getElementById("imagen_evento"); while(container_imagen.firstChild) container_imagen.removeChild(container_imagen.firstChild) if(doc.getAttribute("image")){ var img=document.createElement("img"); img.setAttribute("src","../files/fotos_evento/"+doc.getAttribute("id")+"_200.jpg"); img.setAttribute("width","100"); container_imagen.appendChild(img); } /* var foto=document.getElementById("foto_actual_galeria").firstChild; foto.src="../files/upload/"+doc.getAttribute("imagen"); //foto.height=doc.getAttribute("alto");*/ } } function setText(elemento,texto){ elemento=document.getElementById(elemento); while(elemento.firstChild) elemento.removeChild(elemento.firstChild) elemento.appendChild(document.createTextNode(texto)) } function Ajax(query,func){ if (window.XMLHttpRequest) request=new XMLHttpRequest() else if (window.ActiveXObject) request=new ActiveXObject("Microsoft.XMLHTTP") if (request!=null) { request.onreadystatechange=func; request.open("GET",query,true) request.send(null) } }