function convertirEnlaces(){
    alert("convertir");
}
function recargarPeriodicamente(){
    new Ajax.PeriodicalUpdater(
    	'historico_mensajes', 
    	'cuadro_historico_mensajes.php', 
    	{method: 'get', frequency: 10, decay: 2}
    );    
    //horaSistema();
}
function horaSistema(){
    var myAjax = new Ajax.Request(
    	'hora_sistema', 
    	'timeserver.php', 
    	{method: 'get', onFailure: reportError}
    );
}
function actualizar_mensaje( mensaje, personaje ){
    var url = "actualizar_mensaje.php";
    var pars = "mensaje=" + mensaje + "&personaje=" + personaje;

    var myAjax = new Ajax.Updater( 
    	"historico_mensajes", 
    	url, 
    	{ method: "get", parameters: pars, onFailure: reportError } 
    );
    limpiarCuadroMensaje();
}
function reportError(request){
        alert('Sorry. There was an error.');
}
function updateStatusTextCharCounter(value) {
    if (140 - value.length >= 0) {
    	$('status-field-char-counter').innerHTML = 140 - value.length;
    } else {
        $('status-field-char-counter').innerHTML = 0;
	}
};
function limpiarCuadroMensaje(){
    $('mensaje').value = "";
    $('mensaje').show();
    $('status-field-char-counter').innerHTML = 140;
}
function inicio(){
    limpiarCuadroMensaje();
    actualizar_mensaje("");
}
Event.observe( window, "load", inicio );

// Ejemplo: ventana con google
//Event.observe(
//				window,
//				'load',
//				function(){
//					new Control.Modal($('modal_link_four'),{ iframe: true, width: 510, height: 417 });
//				}
//			);

// Ejemplo: Varias formas de buscar un elemento en el documento
//var un_link = document.all["beta-link"];
//var un_link = document.getElementById("beta-link")
var un_link = $("beta-link");
//alert( un_link );

// Ejemplo: buscar todos los elementos a trav�s de informaci�n de css
//var todos_los_links = $$( "body a" );//un array con todos los links del documento
//alert( todos_los_links );

// Ejemplo: formas de remover un elemento
//var un_link = document.getElementById("beta-link");
//un_link.parentNode.removeChild(un_link);
//Element.remove("beta-link");

// Ejemplo: asignar una clase css a un elemento
//var un_link = document.getElementById( "beta-link" );

// Ejemplo: agregarle un clase (css) a un elemento
// (En Firefox no anda)
//if( un_link.className.indexOf( "seleccionado" ) > -1 ){//clase todav�a no existe, agr�gala
//	un_link.className += "seleccionado";
//	alert("encontrado");
//}
//alert( un_link );
//$("beta-link").addClassName("seleccionado");
//alert( un_link );
//$("beta-link").removeClassName("seleccionado");
//$("beta-link").remove();
//$("beta-link").hide();
//alert("show");
//$("beta-link").show();
//alert("toggle");
//$("beta-link").toggle();

