﻿// Archivo JScript
	function trim(s){while (s.substring(0,1) == ' ') 
						{s = s.substring(1,s.length);}
						while (s.substring(s.length-1,s.length) == ' ')
						 {s = s.substring(0,s.length-1);}
						return s;}
	function vali_fecha(v_fec)
		{
			if (trim(v_fec)=="")
				return true;
			var wdia=v_fec.substring(0,2);
			var wmes=v_fec.substring(3,5);
			var wano=v_fec.substring(6,10);
			var wbis=(parseInt(wano))%4;
			if (isNaN(wdia) || isNaN(wmes) || isNaN(wano) || isNaN(wbis))
				return false;
			if (wmes<'01' || wmes>'12')
				return false;
			if (wmes=='01' || wmes=='03' || wmes=='05' || wmes=='07' || wmes=='08' || wmes=='10' || wmes=='12')
				if (wdia<'01' || wdia>'31')
					return false;
			if (wmes=='04' || wmes=='06' || wmes=='09' || wmes=='11')
				if (wdia<1 || wdia>30)
					return false;
			if (wmes=='02' && wbis==0)
				if (wdia<'01' || wdia>'29')
					return false;
			if (wmes=='02' && wbis!=0)
				if (wdia<'01' || wdia>'28')
					return false;
			if (wano<'1900' || wano > '2100')
				return false;
			return true;		}	function validarmail(valor) 
	{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor))
		{ return (true)} else {return (false)}
	}
    
    function degra()
    {
    document.body.style.backgroundImage="url(images/gradient.gif)";
    document.body.style.backgroundRepeat="repeat-x";
    }

function selec(wobj)
{
    wobj.style.cursor='pointer';
    wobj.style.backgroundColor="red";
}
function deselec(wobj)
{
    wobj.style.cursor='';
    wobj.style.backgroundColor="";
}