var presentations = {};

presentations.successLoad = function() {

    Cufon.set('fontFamily', 'ColaborateLight');
    Cufon.replace('h2, #main h3, h4, h5, h6, #slogan, .label', {
        hover: true
    });

    Cufon.set('fontFamily', 'Colaborate-Medium');
    Cufon.replace('#main_home h3', {
        hover: true
    });

    jQuery('#pager').pager("div", {navAttach:'prepend',prevText : 'Prev' , nextText: 'Next'});
    Shadowbox.clearCache();
    var sOptions = {
        title : 'Course Files',
        width : 500,
        height : 250
    };
    try{
        Shadowbox.init();
        Shadowbox.setup(jQuery('.dialog'), sOptions);
    }catch(e){}

}

jQuery(document).ready(function() {
    var $form = jQuery('.presentationForm');
    var loader = '<img src="' + rootPath + '/js/jquery/loadingAnimationBar.gif"/>';

    var options = {
        target:'#ajaxTarget',
        type:'post',
        cache:false,
        beforeSubmit : function(formData, jqForm, options) {
            jQuery(options.target).html(loader);
        },
        success : presentations.successLoad
    };

    $form.submit(function() {
        jQuery(this).ajaxSubmit(options);
        return false;
    });

})

