$(function()
{
    $('#mf-overlay').hide();
    $('#mf-desc').hide();
    
    $('a.mf-url').click(
        function(){
            $('select').hide();
            
            $('#mf-overlay').show();
            $('#mf-overlay').width(document.body.offsetWidth);
            $('#mf-overlay').height(document.body.offsetHeight);
            
            $('#mf-overlay').addClass('mf-overlay');
            $('#mf-overlay').click(function(){
                 $('#mf-desc').hide();
                 $(this).hide();
                 $('select').show();
            });
            
            $('#mf-desc').show();
            $('#mf-desc').addClass('mf-desc');
            $('#mf-desc').css('top',($(document).scrollTop() + 50) +'px');
            $('#mf-desc').css('left',Math.ceil($(document).width()/2 - $('#mf-desc').width()/2) + 'px');
            $('#mf-desc').click(function(){
                 return false;
            });
            
            if($('#mf-close').attr('id') != 'mf-close'){
                $('#mf-desc').append('<img src="' + WEBROOT + '/public/themes/images/mf-close.gif" alt="" id="mf-close" />');
            }
            $('#mf-close').click(function(){
                 $('#mf-overlay').hide();
                 $('#mf-desc').hide();
                 $('select').show();
            });
            
            $('#mf-desc-frame').addClass('mf-desc-frame');
            return false;
        }
    );
});