	<!--
	// ==============================================================================
	// FUNCIONES EXPORTADAS
	// ==============================================================================
	// function resaltarItemMenu(src, color){
	// function normalItemMenu(src, blnForce, color){
	// function MarcarItemMenu(src){
	// function GotoURL(strURL, strParametros, destino){
	// function isEmailAddr(email)
	// function DoShowTooltip(layer, strCadena)
	// function QuitarValorListBox(Control)
	// function QuitarValorListBoxPorValor(Control){
	// function AgregarValorListbox(Formulario, ID, VALOR, blnPermitirRepeticion)
	// function DameControl(formulario, strNombreControl)
	// function FormatNumber(VALOR)
	// function damenumeroJScript(strNumero)
	// function round(num, dec, blnPuntosMil)
	// function puntosMil(cadena)
	// function replace(strCadena, strBuscada, strReemplazada)
	// function SeleccionPorValor(control, VALOR, ForceCheck)
	// function SeleccionarTodo(control)
	// function SeleccionarNinguno(control)
	// function InvertirSeleccion(control)
	// function CancelarSeleccion(control)
	// function RetornaSeleccionados(control)
	// function ContarSeleccionados(control)
	// function SeleccionAleatoria(control)
	// function AbrirVentana(strURL, strParametros, W, H)
	// function isEmailAddr(email)

	// Copyright Best Business Service 2004.
	// Rev: 20021028
	// Add: 20021120
	// Add: 20021121
	// Add: 20021202
	// Add: 20040514


		var OLD_ColorItemMenu="";
		var OLD_CFontItemMenu="";
		var ItemSeleccionado="";
		function resaltarItemMenu(src, color){
			if (ItemSeleccionado!=src)
			{
				if (color==null) color="#cccccc"
				OLD_ColorItemMenu=src.style.background;
				OLD_CFontItemMenu=src.style.color;
				src.style.cursor="hand";
				src.style.background=color;
				src.style.color="000080";
				src.style.border="1 solid #000000";
			}
		}

		function normalItemMenu(src, blnForce, color){
			if (blnForce==null) blnForce=false
			if (ItemSeleccionado!=src || blnForce && ItemSeleccionado!="")
			{
				if (color==null) color="#f9f9ff";
				src.style.color=OLD_CFontItemMenu;
				src.style.background=OLD_ColorItemMenu;
				src.style.border="1 solid " + color;
			}
		}

		function MarcarItemMenu(src){
			if (ItemSeleccionado!=src)
			{
				if (ItemSeleccionado!=""){
					normalItemMenu(ItemSeleccionado, true);
				}
				ItemSeleccionado=src;
			}
		}



		function GotoURL(strURL, strParametros, destino){
			if (destino==null){
				W=screen.width - 10;
				H=screen.Height - 110;
				if (strParametros == null) strParametros='width=' + W + ',height=' + H + ',scrollbars=1,resizable=1,toolbar=1,status=1,menubar=0, top=0, left=0,alwaysRaised=yes';
				ventana = window.open(strURL,'',strParametros);
			}
			else
			{
				try{
					destino.EDICION.style.display="none";
					destino.ESPERA.style.display="";
				}
				catch(err){}
				destino.location.replace(strURL);
			}
		}

	        function isEmailAddr(email)
	        {
	                var result = false;
	                var theStr = new String(email);
	                var index = theStr.indexOf("@");

	                if (index > 0)
	                {
	                    var pindex = theStr.indexOf(".",index);

	                    if ((pindex > index+1) && (theStr.length > pindex+1))
		                result = true;
	                }

	                return result;
	        }


		function DoShowTooltip(layer, strCadena){
			if (strCadena!="" && strCadena!=null)
			{
				if (layer.style.display!="")
				{
					document.all[layer.id].innerHTML=strCadena;
					layer.style.display="";
				}
				x = event.x + document.body.scrollLeft;
				y = event.y + document.body.scrollTop;

				// Si se sale fuera de la pantalla por la derecha...
				// Ojo que el ancho del layer está definido en el DIV!!!
				if ((document.body.clientWidth - x) < parseInt(layer.style.width))
				{
					layer.style.top = y;
					layer.style.left = document.body.clientWidth - parseInt(layer.style.width) - 10
				}
				else
				{
					layer.style.top = y;
					layer.style.left = x + 10;
				}
			}
		}


		function QuitarValorListBox(Control){
			intIndiceQVLB=Control.selectedIndex;
			if (intIndiceQVLB!=-1 && intIndiceQVLB!=null)
			{
				Control[intIndiceQVLB]=null;
				if (Control.length > 0)
				{
					if (intIndiceQVLB==0)
						Control[0].selected=true
					else
						Control[intIndiceQVLB-1].selected=true

				}
			}
		}

		function QuitarValorListBoxPorValor(Control, ID){
			for (intIndiceAVL=0; intIndiceAVL < Control.length; intIndiceAVL++){

				IDACTUAL=Control.options[intIndiceAVL].value;
				if (IDACTUAL==ID){
					Control[intIndiceQVLB]=null;
				}
			}
		}

		function AgregarValorListbox(Control, ID, VALOR, blnPermitirRepeticion, blnAvisoDuplicado){
			blnAgregar=true;
			if (!blnPermitirRepeticion)
			{
				blnExiste=false;
				for (intIndiceAVL=0; intIndiceAVL < Control.length; intIndiceAVL++){
					IDACTUAL=Control.options[intIndiceAVL].value;
					if (!blnExiste) blnExiste=(IDACTUAL==ID)
					if (blnExiste)
					{
						if (blnAvisoDuplicado!=null && blnAvisoDuplicado==true)
						{
							alert("El elemento '" + VALOR + "' ya existe en la lista.\nNo se permite agregar elementos duplicados.");
						}
						blnAgregar=false;
						break;
					}
				}
			}

			if (blnAgregar)
			{
				ELEMENTO = new Option(VALOR, ID, false, false);
				intTotal=Control.length;
				Control.options[intTotal] = ELEMENTO;
				return(true);
			}
			else
				return(false);
		}



		// ----------------------------------------------------------------
		// RETORNA EL CONTROL (OBJETO) A PARTIR DEL NOMBRE (STRING)
		// ----------------------------------------------------------------
		function DameControl(formulario, strNombreControl){
			return(document.getElementById(strNombreControl))
		}




		function damenumeroJScript(strNumero){
			// ----------------------------------------------------------
			// ENTRA UN NUMERO FORMATEADO 1.234,56 y sale 1234.56
			// RETORNA UN NUMERO EVALUABLE MATEMATICAMENTE POR JAVASCRIPT
			// ----------------------------------------------------------
			strNumero = strNumero.toString();
			strNumero = replace(strNumero,"\\.","");
			strNumero = replace(strNumero,",",".");
			return(Number(strNumero));
		}



		function round(strNumero, decimales, blnPuntosMil){
			if (decimales==null) valor=(Math.round(strNumero))
			if (decimales==1) valor=(Math.round(strNumero * 10)/10)
			if (decimales==2) valor=(Math.round(strNumero * 100)/100)
			if (decimales==3) valor=(Math.round(strNumero * 1000)/1000)
			if (decimales==4) valor=(Math.round(strNumero * 10000)/10000)
			if (decimales==5) valor=(Math.round(strNumero * 100000)/100000)
			if (decimales==6) valor=(Math.round(strNumero * 1000000)/1000000)
			if (decimales==7) valor=(Math.round(strNumero * 10000000)/10000000)
			if (decimales==8) valor=(Math.round(strNumero * 100000000)/100000000)

			if (blnPuntosMil)
				return(formatNumber(valor,"#.###,####"));
			else
				valor = valor.toString();
				valor = replace(valor,"\\.",",");
				return(valor);
		}



		// -----------------------------------------------------------------------------
		// FUNCIÓN QUE PONE LOS PUNTOS SOBRE UNIDADES MIL, LA ENTRADA HA DE SER UN VALOR
		// NUMERICO VALIDO DE JAVASCRIPT (12345.67) Y LA SALIDA ES (12.345,67)
		// -----------------------------------------------------------------------------
		   // CONSTANTS
		  var separator = ",";  // use comma as 000's separator
		  var decpoint = ".";  // use period as decimal point
		  var percent = "%";
		  var currency = "$";  // use dollar sign for currency

		  function formatNumber(number, format, print) {  // use: formatNumber(number, "format")
		    if (print) document.write("formatNumber(" + number + ", \"" + format + "\")<br>");

		    if (number - 0 != number) return null;  // if number is NaN return null
		    var useSeparator = format.indexOf(separator) != -1;  // use separators in number
		    var usePercent = format.indexOf(percent) != -1;  // convert output to percentage
		    var useCurrency = format.indexOf(currency) != -1;  // use currency format
		    var isNegative = (number < 0);
		    number = Math.abs (number);
		    if (usePercent) number *= 100;
		    format = strip(format, separator + percent + currency);  // remove key characters
		    number = "" + number;  // convert number input to string

		     // split input value into LHS and RHS using decpoint as divider
		    var dec = number.indexOf(decpoint) != -1;
		    var nleftEnd = (dec) ? number.substring(0, number.indexOf(".")) : number;
		    var nrightEnd = (dec) ? number.substring(number.indexOf(".") + 1) : "";

		     // split format string into LHS and RHS using decpoint as divider
		    dec = format.indexOf(decpoint) != -1;
		    var sleftEnd = (dec) ? format.substring(0, format.indexOf(".")) : format;
		    var srightEnd = (dec) ? format.substring(format.indexOf(".") + 1) : "";

		     // adjust decimal places by cropping or adding zeros to LHS of number
		    if (srightEnd.length < nrightEnd.length) {
		      var nextChar = nrightEnd.charAt(srightEnd.length) - 0;
		      nrightEnd = nrightEnd.substring(0, srightEnd.length);
		      if (nextChar >= 5) nrightEnd = "" + ((nrightEnd - 0) + 1);  // round up

		 // patch provided by Patti Marcoux 1999/08/06
		      while (srightEnd.length > nrightEnd.length) {
		        nrightEnd = "0" + nrightEnd;
		      }

		      if (srightEnd.length < nrightEnd.length) {
		        nrightEnd = nrightEnd.substring(1);
		        nleftEnd = (nleftEnd - 0) + 1;
		      }
		    } else {
		      for (var i=nrightEnd.length; srightEnd.length > nrightEnd.length; i++) {
		        if (srightEnd.charAt(i) == "0") nrightEnd += "0";  // append zero to RHS of number
		        else break;
		      }
		    }

		     // adjust leading zeros
		    sleftEnd = strip(sleftEnd, "#");  // remove hashes from LHS of format
		    while (sleftEnd.length > nleftEnd.length) {
		      nleftEnd = "0" + nleftEnd;  // prepend zero to LHS of number
		    }

		    if (useSeparator) nleftEnd = separate(nleftEnd, separator);  // add separator
		    var output = nleftEnd + ((nrightEnd != "") ? "." + nrightEnd : "");  // combine parts
		    output = ((useCurrency) ? currency : "") + output + ((usePercent) ? percent : "");
		    if (isNegative) {
		      // patch suggested by Tom Denn 25/4/2001
		      output = (useCurrency) ? "(" + output + ")" : "-" + output;
		    }
		    output=replace(output,",","|")
		    output=replace(output,"\\.",",")
		    output=replace(output,"\\|",".")
		    return output;
		  }

		  function strip(input, chars) {  // strip all characters in 'chars' from input
		    var output = "";  // initialise output string
		    for (var i=0; i < input.length; i++)
		      if (chars.indexOf(input.charAt(i)) == -1)
		        output += input.charAt(i);
		    return output;
		  }

		  function separate(input, separator) {  // format input using 'separator' to mark 000's
		    input = "" + input;
		    var output = "";  // initialise output string
		    for (var i=0; i < input.length; i++) {
		      if (i != 0 && (input.length - i) % 3 == 0) output += separator;
		      output += input.charAt(i);
		    }
		    return output;
		  }





		// ------------------------------
		// FUNCIÓN REPLACE ESTILO VSCRIPT
		// ------------------------------
		function replace(strCadena, strBuscada, strReemplazada){
			strBusca = new RegExp (strBuscada,"gi");
			strResultado=strCadena.replace(strBusca,strReemplazada);
			return(strResultado);
		}



		// -------------------------------------------
		// SELECCION POR VALOR
		// -------------------------------------------
		function SeleccionPorValor(control, VALOR, forcecheck){
			if (forcecheck==null) forcecheck=false
			if (control != null){
				intTope=control.length - 1;
				if (isNaN(intTope)){
					if (forcecheck)
					{
						if (control.value==VALOR) control.checked = true
					}
					else
					{
						if (control.value==VALOR) control.checked = !control.checked;
					}
				}
				else
				{
					for (intIndice=0; intIndice <=intTope; intIndice++){
						if (forcecheck)
						{
							if (control(intIndice).value==VALOR) control(intIndice).checked = true
						}
						else
						{
							if (control(intIndice).value==VALOR) control(intIndice).checked = !control(intIndice).checked ;
						}
					}
				}
			}
		}


		// -------------------------------------------
		// CHEQUEA TODOS LOS ELEMENTOS DE "CONTROL"
		// -------------------------------------------
		function SeleccionarTodo(control){
			if (control != null){
				intTope=control.length - 1;
				if (isNaN(intTope)){
					control.checked = true;
				}
				else
				{
					for (intIndice=0; intIndice <=intTope; intIndice++){
						control(intIndice).checked = true;
					}
				}
			}
		}


		// -------------------------------------------
		// DESCHEQUEA TODOS LOS ELEMENTOS DE "CONTROL"
		// -------------------------------------------
		function SeleccionarNinguno(control){
			if (control != null){
				intTope=control.length - 1;
				if (isNaN(intTope)){
					control.checked = false;
				}
				else
				{
					for (intIndice=0; intIndice <=intTope; intIndice++){
						control(intIndice).checked = false;
					}
				}
			}
		}


		// -------------------------------------------------
		// INVIERTE EL CHEQUEO DE LOS ELEMENTOS DE "CONTROL"
		// -------------------------------------------------
		function InvertirSeleccion(control){
			if (control != null){
				intTope=control.length - 1;
				if (isNaN(intTope)){
					control.checked = ! control.checked;
				}
				else
				{
					for (intIndice=0; intIndice <=intTope; intIndice++){
						control(intIndice).checked = ! control(intIndice).checked;
					}
				}
			}
		}


		// -------------------------------------------------
		// DESCHEQUEA TODOS LOS ELEMENTOS DE "CONTROL"
		// -------------------------------------------------
		function CancelarSeleccion(control){
			if (control != null){
				intTope=control.length - 1;
				if (isNaN(intTope)){
					control.checked = false;
				}
				else
				{
					for (intIndice=0; intIndice <=intTope; intIndice++){
						control(intIndice).checked = false;
					}
				}
			}
		}



		// -----------------------------------------------------------------------------------
		// RETORNA EN FORMA DE LISTA SEPARADA POR COMAS LOS ELEMENTOS SELECCIONADOS (EL VALUE)
		// -----------------------------------------------------------------------------------
		function RetornaSeleccionados(control, separador){
			if (separador==null) separador=",";
			LSTID="";
			if (control != null){
				intTope=control.length - 1;
				if (isNaN(intTope)){
					if (control.checked == true) LSTID=control.value;
				}
				else
				{
					for (intIndice=0; intIndice <=intTope; intIndice++){
						if (control(intIndice).checked == true){
							if (LSTID=="")
								LSTID=control(intIndice).value
							else
								LSTID=LSTID + separador + control(intIndice).value
						}
					}
				}
			}
			return(LSTID);
		}


		// -------------------------------------------------
		// RETORNA EL VALOR DE TAG DE LOS ELEMENTOS SELECCIONADOS (CHECKS O RADIOS)
		// -------------------------------------------------
		function RetornaSeleccionadosTag(control){
			LSTID="";
			if (control != null){
				intTope=control.length - 1;
				if (isNaN(intTope)){
					if (control.checked == true) LSTID=control.tag;
				}
				else
				{
					for (intIndice=0; intIndice <=intTope; intIndice++){
						if (control(intIndice).checked == true){
							if (LSTID=="")
								LSTID=control(intIndice).tag
							else
								LSTID=LSTID + "," + control(intIndice).tag
						}
					}
				}
			}
			return(LSTID);
		}


		// -------------------------------------------
		// CUENTA EL NUMERO DE ELEMENTOS SELECCIONADOS
		// -------------------------------------------
		function ContarSeleccionados(control){
			intContados=0;
			if (control != null){
				intTope=control.length - 1;
				if (isNaN(intTope)){
					if (control.checked == true) intContados=1;
				}
				else
				{
					for (intIndice=0; intIndice <=intTope; intIndice++){
						if (control(intIndice).checked == true)
						{
						intContados=intContados+1;
						}
					}
				}
			}
			return(intContados);
		}


		// RETORNA N ELEMENTOS SELECCIONADOS
		function SeleccionAleatoria(control){

			if (control!=null)
			{
				MAXPREGUNTAS = control.length;
				if (MAXPREGUNTAS==null) MAXPREGUNTAS=1;
				strCUANTOS=prompt("¿Cuantos quieres seleccionar aleatoriamente?\nRecuerda que solo hay " + MAXPREGUNTAS + " elementos disponibles en total.","");
				if (strCUANTOS!="" & strCUANTOS!=null && strCUANTOS!=0){
					if (parseInt(strCUANTOS) <= parseInt(MAXPREGUNTAS)){

						while (ContarSeleccionados(control) < strCUANTOS)
						{
							intNumero=Math.random();
							intContador=(intNumero * (MAXPREGUNTAS-1));
							intTope=control.length - 1;
							if (isNaN(intTope)){
								control.checked = true;
							}
							else
							{
								control(intContador).checked=true;
							}

						}

						alert("Se ha seleccionado: " + ContarSeleccionados(control) + " elementos.")
					}
					else
						alert("Valor incorrecto.")
				}
			}
		}

		// CHEQUEA UN ELEMENTO DEL CONTROL "control", blnforce indica si fuerza a estar chequeado
		function CheckItem(control, valor, blnForce){
			if (control!=null)
			{
				if (control.length != null)
				{
					for (intIndiceCheckItem=0; intIndiceCheckItem <= control.length-1; intIndiceCheckItem++)
					{
						if (control[intIndiceCheckItem].value == valor)
						{
							if (blnForce)
							{
								control[intIndiceCheckItem].checked=true;
							}
							else
							{
								control[intIndiceCheckItem].checked = (!control[intIndiceCheckItem].checked);
							}
							break;
						}
					}
				}
				else
				{
					if (blnForce)
					{
						control.checked = true;
					}
					else
					{
						control.checked = (!control.checked);
					}
				}
			}
		}




		// -------------------------------------------
		// Abre ls URL con ventana tipo ZOOM
		// -------------------------------------------
		function AbrirVentana(strURL, strParametros, W, H)
		{
			popup = window.open('../../Dummie.htm','',strParametros);
			zoom(strURL, popup, W, H)
		}

		var INCREMENTO=25;
		var WActual=100;
		var HActual=100;
		function zoom(strURL, popup, W, H)
		{
			if (WActual < W) popup.resizeTo(WActual, HActual);
			if (HActual < H) popup.resizeTo(WActual, HActual);

			if (WActual < W)
				WActual=WActual+INCREMENTO
			else
				WActual=W

			if (HActual < H )
				HActual=HActual+INCREMENTO;
			else
				HActual=H

			if ((WActual < W && W > WActual+INCREMENTO) || (HActual < H && H > HActual+INCREMENTO))
			{
				CX = (screen.availwidth/2) - (WActual/2);
				CY = (screen.availHeight/2) - (HActual/2);
				popup.moveTo(CX,CY);
				zoom(strURL, popup, W, H)
			}
			else
			{
				CX = (screen.availwidth/2) - (W/2);
				CY = (screen.availHeight/2) - (H/2);
				popup.moveTo(CX,CY);
				popup.resizeTo(W, H);
				popup.location.replace(strURL)
				WActual=100;
				HActual=100;
			}
		}


		// COMPRUEBA QUE SEA VALIDO UN EMAIL DADO
	        function isEmailAddr(email)
	        {
	                var result = false;
	                var theStr = new String(email);
	                var index = theStr.indexOf("@");

	                if (index > 0)
	                {
	                    var pindex = theStr.indexOf(".",index);

	                    if ((pindex > index+1) && (theStr.length > pindex+1))
		                result = true;
	                }

	                return result;
	        }



	//-->
