$(function()
{
    if(!$('li.leads').closest('#menu').length)
    {
        $('#menu > .container > ul:first > li#bysearchTab').prev().before($('li.leads'));
        $('li.leads').removeClass('hidden');
    }
})

/**
 * create key for an entry.
 * 
 * @access public
 * @return void
 */
function createKey()
{
    var chars = '0123456789abcdefghiklmnopqrstuvwxyz'.split('');
    var key   = ''; 
    for(var i = 0; i < 32; i ++)
    {   
        key += chars[Math.floor(Math.random() * chars.length)];
    }   
    $('#key').val(key);
    return false;
}
