

(function($){











})(window.jQuery);



window.log = function(){
    log.history = log.history || [];
    log.history.push(arguments);
    if (this.console) {
        console.log(Array.prototype.slice.call(arguments));
    }
};

(function(doc){
    var write = doc.write;
    doc.write = function(q){
        log('document.write(): ', arguments);
        if (/docwriteregexwhitelist/.test(q)) 
            write.apply(doc, arguments);
    };
})(document);

$(document).ready(function(){


    /*	$('.the-header-image').hide();
     $('.header-loader').show();
     */
    $('a.fancyvideo').fancybox({
        'zoomSpeedIn': 300,
        'zoomSpeedOut': 300,
        'overlayShow': true,
        'zoomOpacity': true,
        'overlayOpacity': 0.8,
        //'autoDimensions' : false,
        'width': 495,
        'height': 320
    });
    $('a.fancyimage').fancybox({
        'zoomSpeedIn': 300,
        'zoomSpeedOut': 300,
        'overlayShow': true,
        'zoomOpacity': true,
        'overlayOpacity': 0.8
    });
    
    $('#list').accordion({
        header: '.content-title',
        active: false,
        alwaysOpen: false,
        autoheight: false
    });
    
    var aa = $('body').attr('id');
    
    
    if (aa == 'SITE') {
        // Hide all large images except the first one
        $('.the-header-image-padding div').hide();
        $('.the-header-image-padding div:first').show();
        $('.the-header-image-padding div:first div').show();
        
        $('.header div.header-title:first a').addClass('selected');
        // Select all thumb links
        $('.header-title a').hover(function(event){
        
            // Hide all large images except for the one with the same hash as our thumb link
            $('.the-header-image-padding div').hide();
            $('.header-title a').removeClass('selected');
            var toShow = $(this).attr('rel');
            $('#' + toShow).show();
            $('div#' + toShow + ' div').show();
            $(this).addClass('selected');
        }, function(){
        } // Because the hover method has a mouseout state we need to define too
);
    }
    else {
        $(function(){
            var theid = $('body').attr('class');
            $('.header-title a').removeClass('selected');
            $('.header-title a[rel=' + theid + ']').addClass('selected');
            $('.the-header-image-padding div').hide();
            $('.the-header-image-padding div#' + theid).show();
            $('div#' + theid + ' div').show();
            
            
            $('.header-title a').hover(function(event){
            
                // Hide all large images except for the one with the same hash as our thumb link
                $('.the-header-image-padding div').hide();
                
                $('.header-title a').removeClass('selected');
                $('.header-title a[rel=' + theid + ']').addClass('selected');
                var toShow = $(this).attr('rel');
                $('#' + toShow).show();
                $('#' + toShow + ' div').show();
                $(this).addClass('selected');
            }, function(){
                var theid = $('body').attr('class');
                
                $('.header-title a').removeClass('selected');
                $('.header-title a[rel=' + theid + ']').addClass('selected');
                $('.the-header-image-padding div').hide();
                $('.the-header-image-padding div#' + theid).show()
                $('div#' + theid + ' div').show();
            } // Because the hover method has a mouseout state we need to define too
);
            
            
        });
    }
});



$(window).load(function(){




});


