function abrir(ancho,alto,direcc){
     vent='v';//+Math.ceil(Math.random()*10000);
     ventana=window.open(direcc,vent,"width="+ancho+",height=" + alto + ",scrollbars=1\"");
	 ventana.focus();
}

function Trim(TRIM_VALUE){
	if(TRIM_VALUE.length < 1){
		return"";
	}
	TRIM_VALUE = RTrim(TRIM_VALUE);
	TRIM_VALUE = LTrim(TRIM_VALUE);
	if(TRIM_VALUE==""){
		return "";
	}else{
		return TRIM_VALUE;
	}
} //End Function

function RTrim(VALUE){
	var w_space = String.fromCharCode(32);
	var v_length = VALUE.length;
	var strTemp = "";
	if(v_length < 0){
		return"";
	}
	var iTemp = v_length -1;

	while(iTemp > -1){
		if(VALUE.charAt(iTemp) == w_space){
		}else{
			strTemp = VALUE.substring(0,iTemp +1);
			break;
		}
		iTemp = iTemp-1;

	} //End While
	return strTemp;
} //End Function

function LTrim(VALUE){
	var w_space = String.fromCharCode(32);
	if(v_length < 1){
		return"";
	}
	var v_length = VALUE.length;
	var strTemp = "";
	var iTemp = 0;

	while(iTemp < v_length){
		if(VALUE.charAt(iTemp) == w_space){
		}else{
			strTemp = VALUE.substring(iTemp,v_length);
			break;
		}
		iTemp = iTemp + 1;
	} //End While
	return strTemp;
} //End Function

function TruncaTexto(cadena, numchars){
	var auxcadena=cadena.substring(0,numchars);
	if(cadena.length>numchars){
		auxcadena+="...";
	}
	return auxcadena;
}

function QuitarHTML(cadena){
	return cadena.replace(/<[^>]+>/g,'');
}

function CheckDisponible(Texto,Plantilla){
	var retorno="";
	if(Trim(Texto)==""){
        retorno = "No disponible.";
    }else{
        if(Trim(Plantilla) == ""){
            retorno = Texto;
        }else{
            retorno = Plantilla.replace(/\|#\|/g, Texto);
		}
    }
	return retorno;
}

function Replace(valor,original,reemplazo){
	return valor.replace(original,reemplazo);
}

function Chr(numero){
	return "\n";
}