function textoLeer(texto)
{
	var aux;
	aux=texto;
	var re = new RegExp ("Chr39", "gi") ;
	aux = aux.replace(re, "'") ;
	var re2 = new RegExp ("vbCr", "gi") ;
	aux = aux.replace(re2, "\r") ;
	var re3 = new RegExp ("Chr37", "gi") ;
	aux = aux.replace(re3, "<%=Chr(37)%>") ;
	var re4 = new RegExp ("Chr34", "gi") ;
	aux = aux.replace(re4, '<%=Chr(34)%>') ;
	return aux;
}
function textoLeerHTML(texto)
{
	var aux;
	aux=texto;
	var re = new RegExp ("Chr39", "gi") ;
	aux = aux.replace(re, "'") ;
	var re2 = new RegExp ("\n", "gi") ;
	aux = aux.replace(re2, "<br>") ;
	var re3 = new RegExp ("Chr37", "gi") ;
	aux = aux.replace(re3, "<%=Chr(37)%>") ;
	var re4 = new RegExp ("Chr34", "gi") ;
	aux = aux.replace(re4, '<%=Chr(34)%>') ;
	return aux;
}
var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all

function insertOn(e){
	if (ie||ns6){
		ins=document.getElementById? document.getElementById('insert') : document.all.insert
		ins.style.position = 'absolute';
		ins.style.top=ns6? pageYOffset + e.clientY : document.body.scrollTop + e.clientY
		ins.style.left='50px';
		ins.style.display='block';
		ins.style.visibility='visible';
	}
}

function insertOff(){
	if (ie||ns6){
		ins=document.getElementById? document.getElementById('insert') : document.all.insert
		ins.style.display='none';
		ins.style.visibility='hidden';
	}
}
function redirect(url){
	if (window.location.href)
		window.location.href = url;
	else if (window.location)
		window.location = url;
	else
		document.location.href = url;
	//window.navigate(url)
}


function muestraAnyadir(e,sec,orden){
//Render image code for IE 4+ and NS6
	if (ie||ns6){
		crossobj=document.getElementById? document.getElementById('anyadir') : document.all.anyadir
		if (crossobj.style.visibility != 'hidden'){
			crossobj.style.display='none';

			crossobj.style.visibility = 'hidden'
		}
		o=document.getElementById? document.getElementById('orden') : document.all.orden
		o.value=orden
		s=document.getElementById? document.getElementById('seccion') : document.all.seccion
		s.value=sec
		crossobj.style.position = 'absolute';
		crossobj.style.left=ns6? pageXOffset + 20 : document.body.scrollLeft+20
		crossobj.style.top=ns6? pageYOffset + 20 : document.body.scrollTop+20
		crossobj.style.display='block';
		crossobj.style.visibility="visible"
	}
	//Render image code for NS 4
	/*else if (document.layers){
		if (document.showimage.visibility=="hide"){
			document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
			document.showimage.document.close()
			document.showimage.left=e.x
			document.showimage.top=e.y
			document.showimage.visibility="show"
		}
		else
			document.showimage.visibility="hide"
		return false	
	}
	//if NOT IE 4+ or NS 4, simply display image in full browser window
	else
		return true*/
}

function ocultar(){
	crossobj.style.display='none';
	crossobj.style.visibility="hidden"
}




function borrar(sec,ord){
	if (confirm('Esta a punto de eliminar una entrada.  Esta acción es irreversible. ¿Está seguro?')){
		s=document.getElementById('seccion')
		s.value=sec
		o=document.getElementById('orden')
		o.value=ord
		f=document.forms[0].submit()
	}
}


function muestraCambiar(e,sec,orden,plat,prec){
//Render image code for IE 4+ and NS6
	if (ie||ns6){
		crossobj=document.getElementById? document.getElementById('cambiar') : document.all.cambiar
		if (crossobj.style.visibility != 'hidden'){
			crossobj.style.display='none';
			crossobj.style.visibility = 'hidden'
		}
		o=document.getElementById? document.getElementById('orden') : document.all.orden
		o.value=orden
		s=document.getElementById? document.getElementById('seccion') : document.all.seccion
		s.value=sec
		pl=document.getElementById? document.getElementById('plato') : document.all.plato
		pl.value=textoLeer(plat)
		pr=document.getElementById? document.getElementById('precio') : document.all.precio
		pr.value=textoLeer(prec)
		crossobj.style.position = 'absolute';
		crossobj.style.left=ns6? pageXOffset + 20 : document.body.scrollLeft+20
		crossobj.style.top=ns6? pageYOffset + 20 : document.body.scrollTop+20
		crossobj.style.display='block';
		crossobj.style.visibility="visible"
	}
	//Render image code for NS 4
	/*else if (document.layers){
		if (document.showimage.visibility=="hide"){
			document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
			document.showimage.document.close()
			document.showimage.left=e.x
			document.showimage.top=e.y
			document.showimage.visibility="show"
		}
		else
			document.showimage.visibility="hide"
		return false	
	}
	//if NOT IE 4+ or NS 4, simply display image in full browser window
	else
		return true*/
}

function muestraCambiarTexto(e,idTexto,texto){
//Render image code for IE 4+ and NS6
	if (ie||ns6){
		crossobj2=document.getElementById? document.getElementById('cambiarTexto') : document.all.cambiarTexto
		if (crossobj2.style.visibility != 'hidden'){
			crossobj2.style.display='none';
			crossobj2.style.visibility = 'hidden'
		}
		t=document.getElementById? document.getElementById('texto') : document.all.texto
		t.value=textoLeer(texto)
		i=document.getElementById? document.getElementById('idTexto') : document.all.idTexto
		i.value=idTexto
		crossobj2.style.position = 'absolute';
		crossobj2.style.left=ns6? pageXOffset+20 : document.body.scrollLeft+20
		crossobj2.style.top=ns6? pageYOffset+20 : document.body.scrollTop+20
		crossobj2.style.display='block';
		crossobj2.style.visibility="visible"
	}
}

function ocultar(){
	crossobj.style.display='none';
	crossobj.style.visibility="hidden"
}

function ocultarTexto(){
	crossobj2.style.display='none';
	crossobj2.style.visibility="hidden"
}




