function detenerError()
{
	return true
}
window.onerror=detenerError


function visible(identificador) {
	identificador.style.display='block';
}

function invisible(identificador) {
	identificador.style.display='none';
}

function visible2(identificador){
  var obj = document.getElementById(identificador)
  if(obj.style.display== "none")  obj.style.display= "inline";
}

function invisible2(identificador) {
	var obj = document.getElementById(identificador)
    obj.style.display= "none";
}

function visible3(identificador){
  var obj = document.getElementById(identificador)
  if(obj.style.visibility== "hidden") obj.style.visibility= "visible";
}

function invisible3(identificador) {
  var obj = document.getElementById(identificador)
  obj.style.visibility= "hidden";
}

function tancar (identificador, pagina_html, contenidor, variables_url){
	//Tanca el cuadre d'Edició
	identificador.style.display='none';
	//Recarregar el DIV 
	//Paso els segons per enganyar la Cache del IExplorer
	avui= new Date(); 
	hora=avui.getHours();
	segons=avui.getSeconds(); 
	minuts=avui.getMinutes();
	pagina_html=pagina_html+"?cache="+hora+minuts+segons+variables_url
	devolver_datos(pagina_html, contenidor)
}

function canvi_pestanya (pagina_html, contenidor, camp, taula, id)
{
	txt= document.getElementById(camp).value;
	var ajax = crearAjax();
	if(!ajax)
	{
		alert("Actualize su navegador para poder utilizar este programa de forma correcta");
		return false;
	}
	document.getElementById(contenidor).innerHTML = "<font face='verdana, arial' size='1'>Cargando... Espere por favor</font>"


	pagina_html = pagina_html+"&txt="+txt;
	ajax.open("post",pagina_html,true);
	ajax.onreadystatechange=function() 
	{
		if (ajax.readyState==4) 
		{
			document.getElementById(contenidor).innerHTML=ajax.responseText;
		}
	}
	ajax.send(null)

	devolver_datos (pagina_html,contenidor)
}

function article_visible (identificador, pagina_html, dir_pagina, contenidor, variables_url, bbdd, taula, id, visible, recarga)
{
	//Tanca el cuadre d'Edició
	identificador.style.display='none';
	//Recarregar el DIV 
	//Paso els segons per enganyar la Cache del IExplorer
	avui= new Date(); 
	hora=avui.getHours();
	segons=avui.getSeconds(); 
	minuts=avui.getMinutes();

	guardar="sysop/editor/save_editor.php?otrabd="+bbdd+"&taula="+taula+"&camp=visible&txt="+visible+"&id="+id+"&cache="+hora+segons+minuts
	
	var ajax = crearAjax();
	ajax.open("get",guardar,true);

	ajax.onreadystatechange=function() 
	{
		if (ajax.readyState==4) 
		{
			if (dir_pagina)
			{
				pagina_html=dir_pagina+"/"+pagina_html+"?dir_pag=1&cache="+hora+minuts+segons+variables_url		
			}
			else
			{
				pagina_html=pagina_html+"?cache="+hora+minuts+segons+variables_url	
			}
		
			if (recarga)
			{
				window.location.reload()
			}
			else
				devolver_datos(pagina_html, contenidor)
		}
	}
	
	ajax.send(null)
}

