<!--
	function validate(f)
	{
		if (CheckForm(f))
		{
			f.submit();
		}
	}

	function isValidEmail(str) {
			  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
			  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
			  if (!reg1.test(str) && reg2.test(str)) { // if syntax is valid
				return true;
			  }
			  return false;
	}

	function esBisiesto(Any)
	{
		//Un año es bisiesto si es divisible por 4 y no por 100, excepto los años divisibles por 400. 
		return (((Any % 4 == 0) && (Any % 100 != 0)) || (Any % 400 == 0))
	}

	function isDate(Data)
	{
		var esFecha = false;
		var aux = Data.split("/");

		if (aux.length == 3)
		{
			if ( (!isNaN(aux[0])) && (!isNaN(aux[1])) && (!isNaN(aux[2])) )
			{
				if ( (aux[1] >= 1) && (aux[1] <= 12) && ((aux[2].length == 2) || (aux[2].length == 4)))
				{
					if ( (aux[1] == 1) || (aux[1] == 3) || (aux[1] == 5) || (aux[1] == 7) || (aux[1] == 8) || (aux[1] == 10) || (aux[1] == 12) )
					{
							if ( (aux[0] >= 1) && (aux[0] <= 31) )
							{
								esFecha = true;
							}
					}
					else
					{
						if ( (aux[1] == 4) || (aux[1] == 6) || (aux[1] == 9) || (aux[1] == 11) )
						{
							if ( (aux[0] >= 1) && (aux[0] <= 30) )
							{
								esFecha = true;
							}
						}
						else
						{
							if ( aux[1] == 2)
							{
								if ( esBisiesto(aux[2]) )
								{
									if ( (aux[0] >= 1) && (aux[0] <= 29) )
									{
										esFecha = true;
									}
								}
								else
								{
									if ( (aux[0] >= 1) && (aux[0] <= 28) )
									{
										esFecha = true;
									}
								}
							}
						}
					}
				}
			}
		}
		if (Data=="")
		{
			esFecha = true;
		}
		return esFecha;
	}

	function isTime(Hora)
	{
		var esHora = false;
		var aux = Hora.split(":");
		if (aux.length == 2)
		{
			if ( (!isNaN(aux[0])) && (!isNaN(aux[1])) )
			{
				if ( (aux[0] >= 0) && (aux[0] < 24) && (aux[1] >= 0) && (aux[1] < 60) )
				{
					esHora = true;
				}
			}
		}
		return esHora;
	}

	function formateDate (Element,Data)
	{
		var isFecha=Data;
		if (Data!="")
		{
			if (isDate(Data))
			{
				var aux = Data.split("/");
				if (aux[0].length<2) aux[0]="0"+aux[0]; // Formateamos el dia DD
				if (aux[1].length<2) aux[1]="0"+aux[1]; // Formateamos el mes MM
				if (aux[2].length<4) aux[2]="20"+aux[2]; // Formateamos el año YYYY

				isFecha=aux[0]+"/"+aux[1]+"/"+aux[2];
			}
			else
			{
				//isFecha="";
				Element.focus();
				alert("'"+Data+"' no es una fecha correcta.");
			}
		}
		return isFecha;
	}

	function Month(Data)
	{
			var isFecha=new String(gNow.getMonth());
			if (isDate(Data) && Data !="")
			{
				var aux = Data.split("/");
				if (aux[1].length<2) aux[1]="0"+aux[1]; // Formateamos el mes MM
				isFecha=aux[1];
			}
		return isFecha;
	}

	function Year(Data)
	{
		var isFecha=new String(gNow.getFullYear().toString());
			if (isDate(Data) && Data !="")
			{
				var aux = Data.split("/");
				if (aux[2].length<4) aux[2]="20"+aux[2]; // Formateamos el año YYYY
				isFecha=aux[2];
			}
		return isFecha;
	}

	function DaysDelta(_v1,_v2) { 
	  var _delta = 0; 
	  _delta = _v1.getTime() - _v2.getTime(); // in msecs 
	  _delta /= (1000 * 60 * 60 * 24); // days 
	  return _delta; 
	} 

	function isLessDate(str_d1, str_d2)
	{
		var isLess = false;
		var aux_d1 = str_d1.split("/");
		var aux_d2 = str_d2.split("/");

	// Si solo se recibe la fecha se agrega la hora (00:00)
		if (aux_d1.length==3)
		{
			str_d1+='/00:00';
			aux_d1 = str_d1.split("/");
		}
		if (aux_d2.length==3)
		{
			str_d2+='/00:00';
			aux_d2 = str_d2.split("/");
		}

		if ((aux_d1.length==4) && (aux_d2.length==4))
		{
			if ((!isNaN(aux_d1[0])) && (!isNaN(aux_d1[1])) && (!isNaN(aux_d1[2])))
			{
				var aux_h1 = aux_d1[3].split(":");
				if ((!isNaN(aux_h1[0])) && (!isNaN(aux_h1[1])))
				{
					var d1 = new Date();
					d1.setMonth(aux_d1[1]-1);
					d1.setDate(aux_d1[0]);
					d1.setYear(aux_d1[2]);
					d1.setHours(aux_h1[0]);
					d1.setMinutes(aux_h1[1]);
					if ((!isNaN(aux_d2[0])) && (!isNaN(aux_d2[1])) && (!isNaN(aux_d2[2])))
					{
						var aux_h2 = aux_d2[3].split(":");
						if ((!isNaN(aux_h2[0])) && (!isNaN(aux_h2[1])))
						{
							var d2 = new Date() ;
							d2.setMonth(aux_d2[1]-1);
							d2.setDate(aux_d2[0]); 
							d2.setYear(aux_d2[2]);
							d2.setHours(aux_h2[0]);
							d2.setMinutes(aux_h2[1]);
							delta = DaysDelta(d1, d2);
							if (delta<0)
								isLess = true;
						}
					}
				}
			}
		}
		return isLess;
	}
	
	function CheckPollForm(f,option) { 
		for(i=0; i<option.length; i++){ 	
			if (option[i].checked){
				return true; 	
			}	
		}
		return false;
	}

	function ValidatePoll(f, option, txt_enq_NoOption)
	{
		if (CheckPollForm(f, option))
		{
			f.submit();
		}
		else
		{
			alert(txt_enq_NoOption);
		}
	}

	function ValidatePollAndClose(f, option, txt_enq_NoOption)
	{
		if (CheckPollForm(f, option))
		{
			f.submit();
			self.close();
		}
		else
		{
			alert(txt_enq_NoOption);
		}
	}

	function CheckPorraForm(f) { 
		var el;
		for(i=0; i<f.length; i++){
			el = f.elements[i];
			if (el.type == 'text')
				if (el.value == '' || isNaN(el.value)) return false;
				if (el.value<=0 || el.value>=100) return false;
		}
		return true;
	}
	
	function ValidatePorra(f, txt_enq_NoOption)
	{
		if (CheckPorraForm(f))	f.submit();
		else	alert(txt_enq_NoOption);
	}

	function isValidSimpleText(str)
	{
		  var reg1 = /^[0-9A-Za-z]+$/;
		  if (!reg1.test(str)) {
		    return true;
		  }
		  return false;
	}

	
	function isNumber(str)
	{
		  var reg1 = /^[0-9]+$/;
		  if (!reg1.test(str)) {
		    return false;
		  }
		  return true;
	}

function ab(letter) {
	f = document.forms['searcher2'];
	f.txt_ab.value = letter;
	f.txt_SearchText.value = '';
	f.submit();
}

function checkTermForm(f) {
	var el;
	var numChecked = 0;
	for(i=0; i<f.length; i++){
		el = f.elements[i];
		if (el.type == 'checkbox')
			if (el.checked) numChecked++;
	}
	
	if (numChecked>3) {
		alert("Debe elejir un máximo de 3");
		return false;
	} else if (numChecked == 0) {
		alert("Debe elejir al menos 1");
		return false;
	}
	return true;
}

function checkAudForm(f) {
	
	if (f.int_tipo.selectedIndex==0) {
		alert("Debe seleccionar el int_tipo de búsqueda");
		f.int_tipo.focus();
		return false;
	}
	if (f.int_dia.selectedIndex==0) {
		alert("Debe seleccionar el dia");
		f.int_dia.focus();
		return false;
	}
	if (f.int_mes.selectedIndex==0) {
		alert("Debe seleccionar el mes");
		f.int_mes.focus();
		return false;
	}
	if (f.int_anyo.selectedIndex==0) {
		alert("Debe seleccionar el año");
		f.int_anyo.focus();
		return false;
	}
	if (f.int_tipo.selectedIndex==1 && f.int_periodo.selectedIndex==0) {
		alert("Debe seleccionar el periodo");
		f.int_periodo.focus();
		return false;
	}
	return true;
}

//-->