$(function(){

    $('a[href*=#]').click(function(){
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') &&
        location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');
            if ($target.length) {
                $('html, body').animate({
                    scrollTop: $("body").offset().top
                }, 400, 'easeOutCubic');
                return false;
            }
        };
            });
    
    
    
    
    $('a.lightbox').lightBox();
    
    $('a.quicktime').click(function(){
    
        var poster = $(this).children('img.poster');
        
        var src = $(this).attr('href');
        
        var width = poster.width();
        var height = poster.height();
        
        var embed = '<object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="' + width + '" height="' + height + '" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">';
        embed += '<param name="src" value="' + src + '">';
        embed += '<param name="autoplay" value="true">';
        embed += '<param name="loop" value="false">';
        embed += '<param name="controller" value="true">';
        embed += '<param name="scale" value="tofit">';
        embed += '<embed src="' + src + '" scale="tofit" width="' + width + '" height="' + height + '" autoplay="true" loop="false" controller="true" pluginspage="http://www.apple.com/quicktime/"></embed>';
        embed += '</object>';
        
        $(this).replaceWith(embed);
        
        return false;
        
    });
    
    $("frame#content").load(function(){
    
        var other = $("frame#stuff");
        var s = other.scrollTop();
        other.attr('src', other.attr('src'));
        other.scrollTop(s);
    });


});

