// JavaScript Document

function verOnover(ide,visible)
{
	obj = document.getElementById(ide);
	obj.style.display = (visible)?'block':'none';
}
	
function borraritem(cual)
{
	if(confirm('¿seguro que quiere borrarlo?'))
	{
		document.forms[0].acc.value = "borrar";
		document.forms[0].submit();
	}
}


function popUp(url,name,ancho,alto)
{
	var propiedades = "toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=1,top=50,left=50,resizable=0,width="+ancho+",height="+alto;
	window.open(url,name,propiedades);	
}

function onlyNumberDot()
{	
	var tecla = window.event.keyCode;
	var punto = window.event.srcElement.value.indexOf('.');
	if ((tecla == 44) || (tecla == 46))
	{
		if (punto != -1)
			window.event.keyCode = 0;
		else
			window.event.keyCode = 46;
	}
	if (!((tecla == 44) || (tecla == 46) || (tecla == 8) || (tecla == 9) || (((tecla - 48) >= 0) && ((tecla - 48) <= 9))))
		window.event.keyCode = 0;
}

function ampliar(foto)
{
	var propiedades = "toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=1,top=50,left=50,resizable=0,width=250,height=180";
	window.open("ampliarfoto.php?foto="+foto,"zoom",propiedades);	
}

function mostrar(seleccion, div)
{
	var div = document.getElementById(div);
	if(seleccion == 2)
		div.style.display = 'block';
	else
		div.style.display = 'none';
}

function limpiar(id, txtOriginal)
{
	var caja = document.getElementById(id);
	
	if(caja.value == txtOriginal)
	{
		caja.value = "";
	}
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;
