
function PopUp(url, anc, alt)
{
	var emer;
	if(url.length>0)
	{
		if(!emer)
		{
			emer=window.open(url, 'pop', 'height=' + alt +', width=' + anc);
		}
	}
}



function Change()
{
	if(document.getElementById('resultado'))
	{
		document.getElementById('resultado').innerHTML='';
	}
}

function Focus(id_obj)
{
	if(document.getElementById(id_obj))
	{
		setTimeout("document.getElementById('"+id_obj+"').focus();",75);
	}
}

var cont=0;
function CerrarVentana(seg)
{
	cont++;
	if(cont==seg)
	{
		window.opener = null;
		window.close();
	}
    FunctionID=setTimeout("CerrarVentana(" + seg + ")", 1000);
    return true
}

function Numero(ev)
{
    tecla = (document.all) ? ev.keyCode : ev.which;
    if (tecla==8 || tecla==13 || tecla==0)
	{
		return true;
	}
    regEx=/\d/;
    teAsc = String.fromCharCode(tecla);
    return regEx.test(teAsc);
}

function AbrirSuscribese()
{
	PopUp('suscripcion_np.php', '540', '606');
}

function AbrirContactenos()
{
	PopUp('escribanos.php', '540', '520');
}


function PopUpNew(url, anc, alt)
{
	var emer;
	if(url.length>0)
	{
		if(!emer)
		{
			emer=window.open(url, 'new_pop', 'height=' + alt +', width=' + anc);
		}
	}
}

function validarEmail(valor) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
	//alert("La dirección de email " + valor + " es correcta.") 
		return true;
	} else {
	//alert("La dirección de email es incorrecta.");
		return false;
	}
}



function abrirventana(url)
{
	window.open (url,"mywindow"); 
}
