<!-- Begin
function testForEnter() {
	if (event.keyCode == 13) {
		event.cancelBubble = true;
		event.returnValue = false;
	}
}

function ValidateNumber(pObjeto) {
    if (!EsValorNumerico(pObjeto.value)) {
        alert("El valor tiene que ser numérico.");
        pObjeto.focus();
        pObjeto.select();
    }
}

function EsValorNumerico(pValor) {
    var valid = "0123456789-.,";
    var ok = true;
    var nPuntosDecimales = new Number(0);
    var nSignosMenos     = new Number(0);
    var temp;
    for (var i=0; i < pValor.length; i++) {
        temp = "" + pValor.substring(i, i+1);
        if (valid.indexOf(temp) == "-1") ok = false;
        if ((temp == ".") || (temp == ",")) nPuntosDecimales++;
        if (temp == "-")                    nSignosMenos++;
    }
    if (nPuntosDecimales > 1) ok = false;
    if (nSignosMenos     > 1) ok = false;
    return ok;
}

function CaracteresValidos(pObjeto) {
	var valid = "áéíúóÁÉÍÓÚabcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ0123456789-_.,;()*{}[] ";
	var ok = "yes";
	var temp;
	for (var i=0; i<pObjeto.value.length; i++) {
		temp = "" + pObjeto.value.substring(i, i+1);
		if (!((pObjeto.value.charCodeAt(i) == 10) || (pObjeto.value.charCodeAt(i) == 13)))
			if (valid.indexOf(temp) == "-1") ok = "no";
		}
	if (ok == "no") {
		alert("El texto contiene caracteres inválidos.\nVuelva a ingresarlo.");
		pObjeto.focus();
		pObjeto.select();
   }
}

// Funcion que realiza lo mismo que el LTrim de ASP.
function ltrim( cpStr ){
	while ( cpStr.charAt(0) == ' ' )
	cpStr = cpStr.replace(' ','');
	return cpStr;
}

// Funcion que da vuelta una cadena, es utilizada por el 'rtrim'
function invertStr( cpStr ){
	var cpAux = '';
	for ( i=cpStr.length;i>=0;i--)
		cpAux=cpAux+cpStr.charAt(i);
	return cpAux;
}

// Funcion que realiza lo mismo que el RTrim de ASP.
function rtrim( cpStr ){
	return invertStr( ltrim( invertStr( cpStr ) ) );
}

// Funcion que realiza lo mismo que el Trim de ASP.
function trim( cpStr ){
	return rtrim(ltrim( cpStr ) );
}

// Funcion que realiza lo mismo que el Rigth de ASP.
function Rigth(cpStr, nLength){
	return cpStr.substr(cpStr.length - nLength, cpStr.length);
}

function ReplaceQuotes(){
	ReplaceQuotesIn('input');
	ReplaceQuotesIn('textarea');
}

function ReplaceQuotesIn(pHtmlObject){
	var sValue = new String();
    var arrObjects = document.getElementsByTagName(pHtmlObject);
    var oObj;
	for (var i = 0; i < arrObjects.length; i++){
	    oObj = arrObjects[i];
		try{
			sValue = oObj.value;
			sValue = sValue.replace(/'/g,"´");
			document.getElementById(oObj.id).value = sValue;
		}
		catch(er){}
	}
}

function EsElEmailValido ( sEmail ) {
   // here's some documentation he provided:
   //
   //   \w+
   //      I am looking here for at least one 'word' - i.e. the 'fred' in
   //      fred.bloggs@somewhere.com
   //
   //   ((-\w+)|(\.\w+)|(\_\w+))*
   //      This is probably the most complex section of  the whole
   //      expression. All I am looking for here are zero or more
   //      'words' prefixed by either a minus (-), dot (.) or
   //      underscore (_) all of which are legal characters in email
   //      addresses.
   //
   //   \@
   //      The one and only @ symbol used in the address
   //
   // [A-Za-z0-9]
   //      Now, I want at least one character that matches this rule
   //      (i.e. any letter from A-Z, uppercase or lowercase or a number
   //      from 0-9)
   //
   // ((.|-)[A-Za-z0-9]+)*
   //      This is saying that I can optionally accept more ranges of
   //      characters that match the rule above, prefixed with either a
   //      dot (.) or a minus (-). For example, this would match the
   //      .xyz portion of abc@uvw.xyx.com
   //
   // \.
   //      A dot (.)
   //
   // [A-Za-z]{2,5}
   //      This final section ensures that the TLD (top level domain)
   //      portion of the email address is at least 2 characters long
   //      (as in .uk or .to) and no longer than 5 characters (to allow
   //      for .firm and .store)

   return ( sEmail.search( /\w+((-\w+)|(\.\w+)|(\_\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]{2,5}/ ) != -1);
}
//	End -->