function showRequest(formData, jqForm, options) {
    $('#ajax-form').fadeOut(300);
}

function showResponse(responseText, statusText, xhr, $form)  {
    $('#ajax-container').html(responseText)
    $('#ajax-form').fadeIn(300);
}

$(document).ready(function(){
    $('a.fancybox').fancybox({
        titleShow : true,
        titlePosition : 'inside',
        transitionIn : 'elastic',
        transitionOut : 'elastic',
        hideOnOverlayClick : true,
        hideOnContentClick : true
    });

    jQuery('#mycarousel').jcarousel();

    $('#ajax-form').ajaxForm({
        beforeSubmit:  showRequest,
        success:       showResponse
    });

    $('#ajax-form-feedback').ajaxForm({
        beforeSubmit : function(formData, jqForm, options){
            $('#ajax-form-feedback').fadeOut(300);
        },
        success: function(responseText){
            $('#ajax-form-feedback').html('');
            $('#ajax-form-feedback').html(responseText);
            $('#ajax-form-feedback').fadeIn(300);
        }
    });
});
