function ValidarFormulario(Formulario)
	{var ListaDeErrores='';
	for (i=0;i<Formulario.elements.length;i++)
		{switch (Formulario.elements[i].type)
			{case 'select-one':
				if ((Formulario.elements[i].title!='')&&(Formulario.elements[i].value==0))
					ListaDeErrores+=' - '+Formulario.elements[i].title+'\n';
				break;
			case 'text':
				if (Formulario.elements[i].alt.toLowerCase()=='email')
					{if ((Formulario.elements[i].accept!='')&&(Formulario.elements[i].value==''))
						ListaDeErrores+=' - '+Formulario.elements[i].accept+'\n';
					var Mensaje=CheckEmailFormat(Formulario.elements[i],true);
					if (Mensaje!='')
						ListaDeErrores+=' - '+Formulario.elements[i].title+'\n';}
				else
					{var LongitudMinima=(Formulario.elements[i].alt==''?0:parseInt(Formulario.elements[i].alt));
					if ((Formulario.elements[i].title!='')&&((Formulario.elements[i].value=='')||(Formulario.elements[i].value.length<=LongitudMinima)))
						ListaDeErrores+=' - '+Formulario.elements[i].title+'\n';};
				break;
			case 'radio':
				
				break;
				};}
	if (ListaDeErrores!='')
		{var MainMessage='';
		switch (GetCookie('SITELANGUAGE'))
			{case '10':
				var MainMessage='The following error(s) have occurred:';
				break;
			case '11':
				var MainMessage='El formulario no se pudo enviar debido a:';
				break;
			case '12':
				var MainMessage='Folgende(r) Fehler ist (sind) aufgetreten:';
				break;}
			alert(MainMessage+'\n'+ListaDeErrores);
		return false;}
	return true;}
function FOE_NumberCheck(TurboEvento)
	{var CodigoDeTecla=(window.event)?event.keyCode:TurboEvento.which;
	if ((CodigoDeTecla<48||CodigoDeTecla>57)&&(CodigoDeTecla!=8)&&(CodigoDeTecla!=0)) return false;
	return true;}
function FOE_DecimalNumberCheck(TurboEvento)
	{var CodigoDeTecla=(window.event)?event.keyCode:TurboEvento.which;
	if (CodigoDeTecla<48||CodigoDeTecla>57)
		if (CodigoDeTecla!=46)
			return false;
	return true;}
function CheckEmailFormat(TextControl,CouldBeEmpty)
	{var Message='';
	if ((TextControl.value=='')&&(CouldBeEmpty==true))
		return '';
	else
		{if ((TextControl.value!='')||(CouldBeEmpty==true))
			{var AtPosition=TextControl.value.indexOf('@');
			if (AtPosition>0)
				{var DotPosition=TextControl.value.indexOf('.',AtPosition);
				if (DotPosition>AtPosition+1)
					{if (DotPosition==TextControl.value.length-1) Message='You are missing the part after the . symbol';}
				else Message=(DotPosition==AtPosition+1?'You are missing the part between the @ symbol and the . symbol':'You are missing the . symbol after the @ symbol');}
			else Message=(AtPosition==0?'You are missing the part before the @ symbol':'You are missing the @ symbol');}
		else Message='You have to specify the email';
		if (Message=='')
			{var i;
			var EmailPattern=/^(.+)@(.+)$/;
			var EmailStructure=TextControl.value.match(EmailPattern);
			var EmailUser=EmailStructure[1];
			var EmailDomain=EmailStructure[2];
			var InvalidCharactersFound='';
			var ActualChar;
//43	+
//45	-
//46	.
//95	_
//65	A		90	Z
//97	a		122	z
//48	0		57	9
			for (i=0;i<EmailUser.length;i++)
				{ActualChar=EmailUser.charCodeAt(i);
				if ((ActualChar!=43)&&(ActualChar!=45)&&(ActualChar!=46)&&(ActualChar!=95)&&((ActualChar<65)||(ActualChar>90))&&((ActualChar<97)||(ActualChar>122))&&((ActualChar<48)||(ActualChar>57)))
					InvalidCharactersFound+=EmailUser.charAt(i)+', ';}
			if (InvalidCharactersFound=='')
				{for (i=0;i<EmailDomain.length;i++)
					{ActualChar=EmailDomain.charCodeAt(i);
					if ((ActualChar!=43)&&(ActualChar!=45)&&(ActualChar!=46)&&(ActualChar!=95)&&((ActualChar<65)||(ActualChar>90))&&((ActualChar<97)||(ActualChar>122))&&((ActualChar<48)||(ActualChar>57)))
						InvalidCharactersFound+=EmailDomain.charAt(i)+', ';}
					if (InvalidCharactersFound!='')
						Message='The wrong characters '+InvalidCharactersFound+'have been found in the email domain';}
			else Message='The wrong characters '+InvalidCharactersFound+'have been found in the email user';};}
	return Message;}
function CheckNumberFormat(TextControl,SkipWhites)
	{if (isNaN(TextControl.value))
		{TextControl.focus();}
	if (SkipWhites==true) return;
	if (TextControl.value=='')
		TextControl.value='0';}