    
    function initSelect() {
      var opts = $$('#customSelect li');
      $('dropdown').addEvent( 'mouseenter', function(){ 
          $('customSelect').style.display = 'block';
      });
      $('dropdown').addEvent( 'mouseleave', function(){
          $('customSelect').style.display = 'none';
      });
      opts.each( function( li ){ 
          li.addEvent( 'click', function(){ 
              $$('#dropdown span')[0].innerHTML = this.getElement( 'a' ).innerHTML;
              $('search_type').value = this.getElement( 'a' ).get('rel');
              $('customSelect').style.display = 'none';
          }); 
      });
    }

    function initTabs()
    {
        if( $('tabs') )
        {
            $$('.tabsContent').each(function(tc,i){
                if( i>0 )
                {
                    tc.style.display = 'none'
                }
            });
            var tabs = $$('#tabs a');
            tabs.each(function(el,y){
                el.addEvent('click',function(e){
                    tabs.each(function(en){ en.parentNode.id = '' });
                    el.parentNode.id = 'current';
                });
            });
        }
    }

    function startSearch()
    {   
        document.location = '/kereses/egyszeru/' + $('search_type').value + '|' + $('keyword').value;
        return false;
    }

    function switchTabs( id )
    {
        var tabs = $$('.tabsContent');
        tabs.each(function( tc ){ tc.style.display = 'none' });
        $( 't'+id ).style.display = 'block';
    }


    /**
     *  Public login password hasher function
     */         
    function secureLogin()
    {
        var passwd = hex_md5( $('pass').value );
        var brick = $('brick').value;
        $('pass').value = hex_md5( passwd + brick );
    }

    window.addEvent( 'load', function(){
        initSelect();
        initTabs();
    });



