$( function() {
    $('.search-form input[type="text"]')
        .val('')
        .focus( function() {
            $(this).parent().parent().find('label').fadeOut('fast');
        })
        .blur( function() {
            if ( $(this).val() == '' )
                $(this).parent().parent().find('label').fadeIn('fast');
        });
    
    $('.lnk-open')
        .click( function(e) {
            e.preventDefault();
            block = $(this).parent();
            if ( $(this).hasClass('act') ) {
                $(this).removeClass('act');
                $('.opened-content', block).stop(false,true).slideUp();
            } else {
                $(this).addClass('act');
                $('.opened-content', block).stop(false,true).slideDown();
            }
        });
        
    $('.subscribe').click( function(e) {
        e.preventDefault();
        $.blockUI({ 
            message: $('#subscribe'), 
            css:{
                left: '50%',
                top:'15%',
                padding:'0', 
                textAlign:'left', 
                border:0,
                background:'none'
            },
            overlayCSS: {
                background: ' #082925'
            }
        });
    });
    $('.lnk-close').click(function(e) {
        e.preventDefault();
        $.unblockUI()
    });

});
