function IsDigit()
	{
	return ((event.keyCode >= 48) && (event.keyCode <= 57))
	}
	
function IsFloat()
	{
	return (((event.keyCode >= 48) && (event.keyCode <= 57))||(event.keyCode==44)||(event.keyCode==45	))
	}

function jsAbrirCalendario(ID,sForm)
	{
	
	var sHref="/norPortal/Base/Calendario.htm";
	var mCalendario=window.showModalDialog(sHref,"","dialogWidth:200px;dialogHeight:210px;help:no;scroll=no;status:no")
	if(mCalendario&&mCalendario.FechaSeleccionada)
		{
		document.forms[sForm][ID+":Dia"].value=mCalendario.DiaSeleccionado;
		document.forms[sForm][ID+":Mes"].value=mCalendario.MesSeleccionado;
		document.forms[sForm][ID+":Anio"].value=mCalendario.AnioSeleccionado;
		}
		
	}

function jsValidaFecha(lDia,lMes,lAnio)
	{
	if(isNaN(lDia) || lDia.length == 0 || isNaN(lMes) || lMes.length == 0 || isNaN(lAnio) || lAnio.length == 0)return false;
	lDia=Number(lDia)
	lMes=Number(lMes)
	lAnio=Number(lAnio)
	if ((lAnio<1920) || (lAnio>2100)) return false;
	if(!(lMes>0&&lMes<=12))return false;
	switch(lMes)
	{
	case 9:
	case 4:
	case 6:
	case 11:if(!(lDia>0&&lDia<=30))return false;break;
	case 2:
	if(lAnio%4!=0)
				if(!(lDia>0&&lDia<=29))return false;
				else
				if(!(lDia>0&&lDia<=28))return false;
	;break;
	default:if(!(lDia>0&&lDia<=31))return false;break;
	}
	if(isNaN(new Date(lAnio,lMes-1,lDia)))return false;
	return true;
	}

function jsLogin(form)
{
	form.pack.value="Login";
	form.submit();
}
function jsLogout(form)
{
	form.pack.value="Logout";
	form.submit();
}

function jsConfirmarAccion(psMensaje)
	{
	return confirm(psMensaje);
	}
	
function jsAsociarVendedorEmpresa(IDEmpresa)
	{
	var sHref="/norPortal/Base/Portal/Empresa_Vendedores.aspx?IDE="+IDEmpresa;
	wve=window.open(sHref,"wve","height=450,width=730,scrollbars=yes");
	wve.focus();
	}

