m=document;y=m.all;z=m.layers;ha=false;hb=true;hc=escape;function depura(hcx){}function datosServidor(){};datosServidor.prototype.iniciar=function(){depura("datosServidor.prototype.iniciar = function() {");try{this._xh=new XMLHttpRequest();}catch(e){var vj=new Array('MSXML2.XMLHTTP.5.0','MSXML2.XMLHTTP.4.0','MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP');var success=ha;for(var i=0;i<vj.length&&!success;i++){try{this._xh=new ActiveXObject(vj[i]);success=hb}catch(e){}}if(!success){return ha}return hb}};datosServidor.prototype.ocupado=function(){depura("datosServidor.prototype.ocupado = function() {");estadoActual=this._xh.readyState;return(estadoActual&&(estadoActual<4));};datosServidor.prototype.procesa=function(){depura("datosServidor.prototype.procesa = function() {");if(this._xh.readyState==4&&this._xh.status==200){this.procesado=hb}};datosServidor.prototype.enviar=function(hah,datos){depura("datosServidor.prototype.enviar = function(urlget,datos)");if(!this._xh){this.iniciar();}if(!this.ocupado()){this._xh.open("GET",hah,ha);this._xh.send(datos);if(this._xh.readyState==4&&this._xh.status==200){return this._xh.responseText}}return ha};vk="update.php";formVars="";changing=ha;function fieldEnter(campo,evt,idfld){depura('function fieldEnter(campo,evt,idfld)');evt=(evt)?evt:window.event;if(evt.keyCode==13&&campo.value!=""){elem=m.getElementById(idfld);remotos=new datosServidor;nt=remotos.enviar(vk+"?fieldname="+hc(elem.id)+"&content="+hc(campo.value)+"&"+formVars,"");noLight(elem);elem.innerHTML=nt;changing=ha;return ha}else{return hb}}function fieldBlur(campo,idfld){depura('function fieldBlur(campo,idfld) {');if(campo.value!=""){elem=m.getElementById(idfld);remotos=new datosServidor;nt=remotos.enviar(vk+"?fieldname="+hc(elem.id)+"&content="+hc(campo.value)+"&"+formVars,"");elem.innerHTML=nt;changing=ha;return ha}}function cambia(actual){if(!changing){width=widthEl(actual.id)+20;height=heightEl(actual.id)+2;if(width<100)width=150;height="90";actual.innerHTML="<textarea name=\"textarea\" id=\""+actual.id+"_field\" style=\"width: "+width+"px; height: "+height+"px;\" onfocus=\"highLight(this);\" onblur=\"noLight(this);\">"+actual.innerHTML+"</textarea>";changing=hb}actual.firstChild.focus();}function editbox_init(){if(!m.getElementsByTagName){return}var spans=m.getElementsByTagName("span");for(var i=0;i<spans.length;i++){var spn=spans[i];if(((' '+spn.className+' ').indexOf("editText")!=-1)&&(spn.id)){spn.onclick=function(){cambia(this);};spn.style.cursor="pointer";spn.title="Click para editar el titulo"}}}function addEvent(elm,evType,fn,hai){if(elm.addEventListener){elm.addEventListener(evType,fn,hai);return hb}else if(elm.attachEvent){var r=elm.attachEvent("on"+evType,fn);return r}else{alert("Tu browser esta un poquito viejo y no te permite editar esta pagina. Porfa, actualizate cauro.");}}function widthEl(span){if(z){w=z[span].clip.width}else if(y&&!m.getElementById){w=y[span].offsetWidth}else if(m.getElementById){w=m.getElementById(span).offsetWidth}return w}function heightEl(span){if(z){h=z[span].clip.height}else if(y&&!m.getElementById){h=y[span].offsetHeight}else if(m.getElementById){h=m.getElementById(span).offsetHeight}return h}function highLight(span){span.parentNode.style.padding="0";}function noLight(span){span.parentNode.style.border="0px";span.parentNode.style.padding="2px";span.style.border="0px"}function setVarsForm(vars){formVars=vars}
