// Removes leading whitespaces
function LTrim( value ) {	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");	
}

// Removes ending whitespaces
function RTrim( value ) {	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");	
}

// Removes leading and ending whitespaces
function trim( value ) {	
	return LTrim(RTrim(value));	
}


function detectar_elemento(ele){
	if(ele.tagName == "INPUT"){		
		var td = ele.parentNode;
		tr = td.parentNode;			
	}
	else if(ele.tagName == "TD"){
		tr = ele.parentNode;			
	}
	else{
		tr = null;
	}
	return tr;
}


function validatePass(campo) {
    var RegExPattern = /(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$/;
    if ((campo.value.match(RegExPattern)) && (campo.value!='')) {
        return true;
    } else {
        campo.focus();
		return false;
    } 
}

/*
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
	function test() {
		var str = "             a             ";
		alert("Original string: '" + str + "'");
		str = str.trim();
		alert("Incompletely stripped string: '" + str + "'");
	}
	test(); 
*/
//String.prototype.trim = function() { return this.replace(/^s+|s+$/g, ""); };

