<!--
function strtr2 (str, from, to) {
    var fr = '',
        i = 0,
        j = 0,
        lenStr = 0,
        lenFrom = 0,
        tmpStrictForIn = false,
        fromTypeStr = '',
        toTypeStr = '',
        istr = '';
    var tmpFrom = [];
    var tmpTo = [];
    var ret = '';
    var match = false;

    // Received replace_pairs?
    // Convert to normal from->to chars
    if (typeof from === 'object') {
        tmpStrictForIn = this.ini_set('phpjs.strictForIn', false); // Not thread-safe; temporarily set to true
        from = this.krsort(from);
        this.ini_set('phpjs.strictForIn', tmpStrictForIn);

        for (fr in from) {
            if (from.hasOwnProperty(fr)) {
                tmpFrom.push(fr);
                tmpTo.push(from[fr]);
            }
        }

        from = tmpFrom;
        to = tmpTo;
    }

    // Walk through subject and replace chars when needed
    lenStr = str.length;
    lenFrom = from.length;
    fromTypeStr = typeof from === 'string';
    toTypeStr = typeof to === 'string';

    for (i = 0; i < lenStr; i++) {
        match = false;
        if (fromTypeStr) {
            istr = str.charAt(i);
            for (j = 0; j < lenFrom; j++) {
                if (istr == from.charAt(j)) {
                    match = true;
                    break;
                }
            }
        } else {
            for (j = 0; j < lenFrom; j++) {
                if (str.substr(i, from[j].length) == from[j]) {
                    match = true;
                    // Fast forward
                    i = (i + from[j].length) - 1;
                    break;
                }
            }
        }
        if (match) {
            ret += toTypeStr ? to.charAt(j) : to[j];
        } else {
            ret += str.charAt(i);
        }
    }

    return ret;
}

function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}

String.prototype.replaceAll = function(de, para){
    var str = this;
    var pos = str.indexOf(de);
    while (pos > -1){
		str = str.replace(de, para);
		pos = str.indexOf(de);
	}
    return (str);
}

function envia()
	{
	var msg=document.forms[0].q.value;
	if (msg != "" && msg != "Digite aqui sua busca")
		{
		//Elimina acentuação
		msg=strtr2(msg,"ÁÀÄÃÂÉÈËÊÍÌÏÎÓÒÖÔÕÚÙÜÛÝŸÇáàäãâéèëêíìïîóòöôõúùüûýÿç©","aaaaaeeeeiiiiooooouuuuuycaaaaaeeeeiiiiooooouuuuuycc");
		var saida=msg.toLowerCase();
		//Elimina espaços
		saida = saida.replaceAll(" ","");
		//document.forms[0].q.value=msg.toLowerCase();
		location.href="http://www.frases.mensagens.nom.br/pensamentos/" + Left(saida,1) + "/" + saida + ".htm";
		}
	else
		{
		document.forms[0].q.value="Digite aqui sua busca";	
		}
	return false;
}
//-->
