jQuery(document).ready(function () {

    Cufon.replace('h1', {
        hover: true
    });
    Cufon.replace('h2', {
        hover: true
    });
    Cufon.replace('h3', {
        hover: true
    });

    //LazyLoad Images
    jQuery("img").lazyload({
        effect: "fadeIn"
    });


    // Rollover effects

    jQuery('.image a:has(img)').hover(function () {
        jQuery('img', this).animate({ opacity: .5 }, 250);
    },
				function () {
				    jQuery('img', this).animate({ opacity: 1 }, 250);
				}
			);

    jQuery('.video a:has(img)').hover(function () {
        jQuery('img', this).animate({ opacity: .5 }, 250);
    },
				function () {
				    jQuery('img', this).animate({ opacity: 1 }, 250);
				}
			);

    jQuery('.misc a:has(img)').hover(function () {
        jQuery('img', this).animate({ opacity: .5 }, 250);
    },
				function () {
				    jQuery('img', this).animate({ opacity: 1 }, 250);
				}
			);


    /////////////////////////////////

    jQuery('.post-preview').animate({ height: 'hide' });
    var timerId;
    jQuery(".post").hover(function () {
        clearTimeout(timerId);
        var id = jQuery(this).attr("id");
        timerId = setTimeout("jQuery('.post-preview', jQuery('#" + id + "')).animate({ height: 'show' });", 200);
    },
				function () {
				    //				    clearTimeout(timerId);
				    //				    var id = jQuery(this).attr("id");
				    jQuery('.post-preview', jQuery(this)).animate({ height: 'hide' });
				}
			);

    jQuery(".page").hover(function () {
        jQuery('.post-preview', this).animate({ height: 'show' });
    },
				function () {
				    jQuery('.post-preview', this).animate({ height: 'hide' });
				}
			);

    jQuery("#show-nav").click(function () {
        jQuery('#sidebar-left').slideDown('normal');

        jQuery('#sidebar-right').animate({ width: 'show' });
    });

    jQuery("#hide-nav").click(function () {
        jQuery('#sidebar-left').slideUp('slow');

        jQuery('#sidebar-right').animate({ width: 'hide' });
    });

});
