﻿$(function() {
	$('#bigpic').hide();
	$('#bigpics').hide();
    if ($("#bigpics").length){
		$('#bigpics').cycle({
		    fx : 'fade',
		    speed : '2000',
		    timeout : '4000'
		});
    }

    if ($("#accordion").length){
	    $('#accordion').accordion({ 
	        active: '.selected', 
	        header: "dt"
	    })
    }

    $("#hbtab a").click(function(){  
        if ($("#hbcontent").is(":hidden")) {  
            $("#hbcontent").slideDown();
            $("#nav").animate({top : '0px' },500);
            $("#intro").animate({width : '359px' },500);
            setTimeout(function() { $("#hbtab a").html('HIDE X&nbsp;&nbsp;');}, 500);     
            return false;  
        } else {  
            $("#hbcontent").slideUp("slow");  
            $("#nav").animate({top : "-40px" },650);
            $("#intro").animate({width : '0px' },650);
            setTimeout(function() { $("#hbtab a").html('SHOW X&nbsp;&nbsp;');}, 650);
            return false;   
        }
    });
	
	$("a.pic").colorbox();

   	//$('a[@rel$="external"]').addClass("external").click(function(){ this.target = "_blank"; });
	
});

$(window).load(
    function() {
        $('#bigpic').fadeIn('slow');
        $('#bigpics').fadeIn('slow');
		$(document).pngFix(); 
    }
);
