	
	function allowOnlyNumbers(objEvent) 
	{
		if (navigator.appVersion.indexOf("MSIE")>-1)
		{
			var iKeyCode;  	
			iKeyCode = objEvent.keyCode;			
			if(iKeyCode>=48 && iKeyCode<=57) return true;
			return false;
		}
	}
	
	function allowOnlyFloatNumbers(objEvent) 
	{
		if (navigator.appVersion.indexOf("MSIE")>-1)
		{
			var iKeyCode;  	
			iKeyCode = objEvent.keyCode;			
			if((iKeyCode>=48 && iKeyCode<=57) || iKeyCode==46) return true;
			return false;
		}
	}
	
	//-------------------------------------------------------------------
	// isInteger(value)
	//   Returns true if value contains all digits
	//-------------------------------------------------------------------
	function isInteger(val)
	{
		if (isBlank(val))
		{
			return false;
		}
		
		for(var i=0;i<val.length;i++)
		{
			if(!isDigit(val.charAt(i)))
			{
				return false;
			}
		}
		
		return true;
	}

	//-------------------------------------------------------------------
	// isNumeric(value)
	//   Returns true if value contains a positive float value
	//-------------------------------------------------------------------
	function isNumeric(val)
	{
		return(parseFloat(val,10)==(val*1));
	}
	
	//-------------------------------------------------------------------
	// isDigit(value)
	//   Returns true if value is a 1-character digit
	//-------------------------------------------------------------------
	function isDigit(num)
	{
		if (num.length>1)
			return false;
		var string="1234567890";
		if (string.indexOf(num)!=-1)
			return true;
		return false;
	}

	//-------------------------------------------------------------------
	// isBlank(value)
	//   Returns true if value only contains spaces
	//-------------------------------------------------------------------
	function isBlank(val)
	{
		if(val==null)
			return true;
		for(var i=0;i<val.length;i++)
		{
			if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r"))
				return false;
		}
		return true;
	}

	//-------------------------------------------------------------------
	// fixFloat(field)
	//   Returns true if value contains a positive float value
	//-------------------------------------------------------------------
	function fixFloat(fld)
	{
	  if (!fld.value.length||fld.disabled) 
	  	return true; // blank fields are the domain of requireValue
		
	  val = parseFloat(fld.value);
	  if(isNaN(val))
	  { 
	  	fld.value= '0';
		return false;
	  }
	  
	  return true;
	}
	
	//-------------------------------------------------------------------
	// isEmail(field)
	//   Returns true if value contains a correct email address
	//-------------------------------------------------------------------
	function isEmail(fld)
	{
		if(!fld.value.length || fld.disabled)
			return true; // blank fields are the domain of requireValue 
		
		var phony= /@(\w+\.)*example\.(com|net|org)$/i;
		if(phony.test(fld.value))
			return false;
		
		var emailfmt = /^\w+([.-]\w+)*@\w+([.-]\w+)*\.\w{2,8}$/;
		if(!emailfmt.test(fld.value))
			return false;
		
		return true;
	}
	
	//-------------------------------------------------------------------
	// hasOnlyLetters(field)
	//   Returns true if value contains only lower or uppercase letters
	//-------------------------------------------------------------------
	function hasOnlyLetters(fld)
	{
		var rx = /^[a-zA-Z]+$/;
		if(!rx.test(fld.value))
			return false;
		
		return true;
	}
	
	//-------------------------------------------------------------------
	// replaceStr(stringToBeProcessed,tokenToBeFound,tokenToBeInserted)
	//   Returns the stringToBeProcessed with replaced string
	//-------------------------------------------------------------------
	function replaceStr(s,t,u)
	{
		i = s.indexOf(t);
		r = "";
		if (i == -1)
			return s;
		r += s.substring(0,i) + u;
		if ( i + t.length < s.length)
			r += replace(s.substring(i + t.length, s.length), t, u);
		return r;
	}

	//-------------------------------------------------------------------
	// optExists(fbox,optValue,optText)
	//   Returns true if there is an option in the given select object that matches given values
	//-------------------------------------------------------------------
	function optExists(fbox,optValue,optText)
	{
		for(var i = 0; i < fbox.options.length; i++) 
		{
			if (fbox.options[i].value == optValue && fbox.options[i].text == optText)
				return true;
		}
		return false;
	}

	//-------------------------------------------------------------------
	// move4(fbox,tbox)
	//   Moves the selected option from fbox to tbox
	//-------------------------------------------------------------------
	function move4(fbox,tbox)
	{
		var i = 0;
		for(var i = 0; i < fbox.options.length; i++) 
		{
			if (fbox.options[i].selected)
			{
				var no = new Option();
				no.value = fbox.options[i].value;
				no.text = fbox.options[i].text;
				tbox.options[tbox.options.length] = no;
				fbox.value = "";
				fbox.options[i].selected = true;
		   }
		}
	}

	//-------------------------------------------------------------------
	// remove(tbox)
	//   Removes the selected option from tbox
	//-------------------------------------------------------------------
	function remove(box) 
	{
		for(var i=0; i<box.options.length; i++) 
		{
			if(box.options[i].selected && box.options[i] != "") 
			{
				box.options[i].value = "";
				box.options[i].text = "";
		   }
		}
		BumpUp(box);
	}

	//-------------------------------------------------------------------
	// BumpUp(abox)
	//   ?
	//-------------------------------------------------------------------
	function BumpUp(abox) 
	{
		for(var i = 0; i < abox.options.length; i++) 
		{
			if(abox.options[i].value == "")  
			{
				for(var j = i; j < abox.options.length - 1; j++)  
				{
					abox.options[j].value = abox.options[j + 1].value;
					abox.options[j].text = abox.options[j + 1].text;
				}
				var ln = i;
				break;
		   }
		}
		if(ln < abox.options.length)  
		{
			abox.options.length -= 1;
			BumpUp(abox);
		}
	}

	//-------------------------------------------------------------------
	// selectAllOptions(abox)
	//   Selects all options in a select object
	//-------------------------------------------------------------------
	function selectAllOptions(aBox)
	{
		for(var i=0;i<aBox.options.length;i++)
		{
			aBox.options[i].selected = true;
		}
	}
	
	/*	Funciones que ocultan los selectores de una forma para mostrar
		un menu flotante por ejemplo */
	
	function hideSelects(doc)
	{
		for(var i = 0; i < doc.forms.length; i++)
		{
			var nElems = doc.forms[i].elements.length;
			for (var j = 0; j < nElems; j++)
			{
				if (doc.forms[i].elements[j].type == "select-one")
					doc.forms[i].elements[j].style.visibility = "hidden";
			}
		}
		
		if (navigator.appVersion.indexOf("MSIE")>-1)
		{
			for (var i = 0; i < doc.frames.length; i++)
			{
				hideSelects(doc.frames[i].document);
			}
		}
	}
	
	function showSelects(doc)
	{
		for(var i = 0; i < doc.forms.length; i++)
		{
			var nElems = doc.forms[i].elements.length;
			for (var j = 0; j < nElems; j++)
			{
				if (doc.forms[i].elements[j].type == "select-one")
					doc.forms[i].elements[j].style.visibility = "visible";
			}
		}
		
		if (navigator.appVersion.indexOf("MSIE")>-1)
		{
			for (var i = 0; i < doc.frames.length; i++)
			{
				showSelects(doc.frames[i].document);
			}
		}
	}
	

	//-------------------------------------------------------------------
	// formatNumber(num,decimalNum,bolLeadingZero,bolParens,bolCommas)
	//   Formats the given number (num)
	//   decimalNum - the number of decimal places to format the number to
	//   bolLeadingZero - true / false - display a leading zero for numbers between -1 and 1
	//   bolParens - true / false - use parenthesis around negative numbers
	//   bolCommas - put commas as number separators.
	//-------------------------------------------------------------------
	function formatNumber(num,decimalNum,bolLeadingZero,bolParens,bolCommas)
	{ 
		if (isNaN(parseInt(num))) return "NaN";
		
		var tmpNum = num;
		var iSign = num < 0 ? -1 : 1;		// Get sign of number
		
		// Adjust number so only the specified number of numbers after
		// the decimal point are shown.
		tmpNum *= Math.pow(10,decimalNum);
		tmpNum = Math.round(Math.abs(tmpNum))
		tmpNum /= Math.pow(10,decimalNum);
		tmpNum *= iSign;					// Readjust for sign
		
		// Create a string object to do our formatting on
		var tmpNumStr = new String(tmpNum);
		
		// See if we need to strip out the leading zero or not.
		if (!bolLeadingZero && num < 1 && num > -1 && num != 0)
			if (num > 0)
				tmpNumStr = tmpNumStr.substring(1,tmpNumStr.length);
			else
				tmpNumStr = "-" + tmpNumStr.substring(2,tmpNumStr.length);
		
		// See if we need to put in the commas
		if (bolCommas && (num >= 1000 || num <= -1000))
		{
			var iStart = tmpNumStr.indexOf(".");
			if (iStart < 0)
				iStart = tmpNumStr.length;
			iStart -= 3;
			while (iStart >= 1)
			{
				tmpNumStr = tmpNumStr.substring(0,iStart) + "," + tmpNumStr.substring(iStart,tmpNumStr.length)
				iStart -= 3;
			}
		}
		
		// See if we need to use parenthesis
		if (bolParens && num < 0)
			tmpNumStr = "(" + tmpNumStr.substring(1,tmpNumStr.length) + ")";
		
		return tmpNumStr;
	}
	
	// Script Source: CodeLifter.com
	// Copyright 2003
	// Do not remove this notice.
	
	// SETUPS:
	// ===============================
	
	// Set the horizontal and vertical position for the popup
	
	PositionX = 10;
	PositionY = 60;
	
	// Set these value approximately 20 pixels greater than the
	// size of the largest image to be used (needed for Netscape)
	
	defaultWidth  = 600;
	defaultHeight = 600;
	
	// Set autoclose true to have the window close automatically
	// Set autoclose false to allow multiple popup windows
	
	var AutoClose = false;
	
	// Do not edit below this line...
	// ================================
	if (parseInt(navigator.appVersion.charAt(0))>=4)
	{
		var isNN=(navigator.appName=="Netscape")?1:0;
		var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
	}
	
	var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
	var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
	
	function popImage(imageURL,imageTitle)
	{
		if (isNN){imgWin=window.open('about:blank','',optNN);}
		if (isIE){imgWin=window.open('about:blank','',optIE);}
		with (imgWin.document)
		{
			writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
			writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
			writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
			writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
			writeln('width=document.images[0].width+10;');
			writeln('height=document.images[0].height+60;');
			writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
			writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
			writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
			if (!AutoClose)
				writeln('</head><body bgcolor=FFFFFF scroll="auto" onload="reSizeToImage();doTitle();self.focus()">')
			else
				writeln('</head><body bgcolor=FFFFFF scroll="auto" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
			writeln('<img name="George" src="'+imageURL+'" style="display:block"></body></html>');
			close();		
		}
	}