/**
 * @author xtan
 */
	function favorito() { 
		var titulo, texto, url; 
		titulo = document.title;
		texto = titulo.replace(/[^a-zA-Z0-9\-_\s]/g,'-');
		texto = texto.replace(/\s/g,'-');
		texto = texto.replace(/_/g, '-');
		url = window.location;
		if(window.sidebar){
			window.sidebar.addPanel(titulo,url,'');
		}
		else if(window.navigator.vendor==='' && !window.opera)
			{
				window.external.AddFavorite(url,titulo);
			}
			else 
			{
				alert('Pulsa Ctrl+D para agregar a marcadores');
			}		
	}						
	function buscar() {
		if(document.getElementById('txt_buscar').value.length>0){			
			window.location='http://bumpho.com/search/'+ escape(quitaacentos(document.getElementById('txt_buscar').value.replace(/\s/g,'+')).toUpperCase().replace(/[^A-Z0-9\+\-Ñ\#\*\|\_\.]/g, ''))+'/0.html';
		}		
	}
	function quitaacentos(t){
		var acentos=/[\xC1|\xC9|\xCD|\xD3|\xDA|\xE1|\xE9|\xED|\xF3|\xFA]/g;
		return t.replace(acentos,function($1){
			var t = $1.replace(/\xC1/g,'A');
			t = t.replace(/\xC9/g,'E');
			t = t.replace(/\xCD/g,'I');
			t = t.replace(/\xD3/g,'O');
			t = t.replace(/\xDA/g,'U');
			t = t.replace(/\xE1/g,'a');
			t = t.replace(/\xE9/g,'e');
			t = t.replace(/\xED/g,'i');
			t = t.replace(/\xF3/g,'o');
			t = t.replace(/\xF9/g,'u');
			return t;
			}
		)
	}
	function enter(evento){
		if (evento.keyCode === 13) {
			buscar();
		}
	}
	function U02_logoutUser(){
		var $b;
		$b = null;
		try {
			$b = new XMLHttpRequest();
		} 
		catch (trymicrosoft) {
			try {
				$b = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (othermicrosoft) {
				try {
					$b = new ActiveXObject("Microsoft.XMLHTTP");
				} 
				catch (error) {
					$b = null;
				}
			}
		};
		if ($b === null) {
			alert("Parece que en este navegador no podemos usar Ajax!");
		};
		$b.open('POST', 'http://bumpho.com/logout', false);
		$b.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		$b.setRequestHeader("Connection", "close");
		$b.send();
		if ($b.readyState === 4 && $b.status === 200) {
			window.location = 'http://bumpho.com';
		}
	}

	function classic()
	{
		document.cookie = 'version=1; path=/'; 
		window.location.reload(true);
	}

