  	   function colapsar(){
    	   if ($("#infoTops").is(":hidden")) {
            $("#infoTops").slideDown("slow");
            $("#botonColapsar").attr({src : "/img/icn_abajo.gif"});
            $("#contraerTexto").hide();
            $("#contraerTexto").html('ocultar');
            $("#contraerTexto").fadeIn();
            $.cookie('topsFooter', 'mostrar', { expires: 90 });
         } else {
  	        $("#infoTops").slideUp("slow");
            $("#botonColapsar").attr({src : "/img/icn_arriba.gif"});
            $("#contraerTexto").hide();
            $("#contraerTexto").html('mostrar');
            $("#contraerTexto").fadeIn();
            $.cookie('topsFooter', 'ocultar', { expires: 90 });
         }
       }
       
       function busqueda(){
        if($("#txtbuscar").val()==textoBuscador) valor=$("#txttag").val();
        else valor=encode($("#txtbuscar").val());
          window.location.href="/guia/"+valor;
       }

       attachRollOverEvent = function(imageId){	
        $(imageId).mouseover( function(){ $(this).attr("src", $(this).attr("src").split('_off').join('_on')) } );	
        $(imageId).mouseout( function(){ $(this).attr("src", $(this).attr("src").split('_on').join('_off')) } 
        );}
        
       function getAbsoluteElementPosition(element) {
		   if (typeof element == "string")
 		      element = document.getElementById(element)
		    
 		  if (!element) return { top:0,left:0 };
		  
		  var y = 0;
		  var x = 0;
		  while (element.offsetParent) {
		    x += element.offsetLeft;
		    y += element.offsetTop;
		    element = element.offsetParent;
		  }
		  return {top:y,left:x};
		}
	
	   function muestraEspeciales() {
      $('#especiales').fadeIn();
     } 
	    
     function cargarPosicionCapa() {
    	 var elemento = document.getElementById('barra_registro');
    	 var pos = getAbsoluteElementPosition(elemento);
    		
    	document.getElementById('panel_login').style.top = pos.top + 25;
    	document.getElementById('panel_login').style.left = pos.left + 3;
		  }
       
    
       $(document).ready(function() {
         attachRollOverEvent("#logo a img.roll");
          $('#txtbuscar').blur(function() {
            if($('#txtbuscar').val()==""||$('#txtbuscar').val()==" ") {
              $('#txtbuscar').val(textoBuscador);
              $('#txttag').val(valorBuscador);
            }
          });

          $('#txtbuscar').focus(function() {

            if($('#txtbuscar').val()==textoBuscador) { 
              $('#txtbuscar').val('')
              $('#txttag').val('')
            }
          });
                 
          cargarPosicionCapa();
            
           $(".close").click(function() {
            $("#panel_login").fadeOut();
           });

           $(".inicio").click(function () {
	         $("#panel_login").fadeIn();
            });
      
            $("#btnIniciarSesion").click(function() {
	           $("#panel_login").fadeOut();        
            });
            
            
       }); 


      function encode(str) {
       var result = "";
        for (i= 0; i < str.length; i++) {
		     if (str.charAt(i) == " ") result += "+";
		     else result += str.charAt(i);
        }
      	return escape(result);
      }