Rype= {
    tabs: function(container, startIndex) {
        var root = container || '#tabs';
        var speed = 500; //ms?
        startIndex = startIndex || 0;
        root = $(root);
        root.addClass('js-enabled');
        
        //add click events
        $.each(root.find('ul li a'),function(index) {
            var that = $(this);
            if(index == startIndex) {
                that.parent().addClass('current');
            }
            that.click(function(){
                //set current class
                $(this).parent().addClass('current');
                $.each($(this).parent().siblings(),function() {
                    $(this).removeClass('current');
                });
                //show/hide panels
                $.each($(that.attr('href')).fadeIn(speed).siblings(),function(){
                    $(this).hide();
                });
                return false;
            });
        });
        
        //hide all but start index
        $.each(root.find('#tab-panes > *'),function(index, el) {
            if(index != startIndex) {
                $(this).hide();
            } 
        });
    }
}

$(document).ready(function(){
   	//pix tabs
   	//UI tabs require too strict markup, roll own tabs function.
   	Rype.tabs('#tabs');

	//portfolio thumb fadein fadeout
	$('#content div.portfolio').hover(function(){
		$(this).find('img').fadeOut();

	}, function(){
		$(this).find('img').fadeIn();
	});


 	//$(".thumb img").fadeTo("normal", 1.0); // This sets the opacity of the thumbs to fade down to 60% when the page loads
	//$(".thumb img").hover(function(){
	//	$(this).stop().fadeTo("normal", 0.6); // This should set the opacity to 100% on hover
	//},function(){
   	//	$(this).stop().fadeTo("normal", 1.0); // This should set the opacity back to 60% on mouseout
	//});

	//load menu
	$('#nav-drop').droppy();
   	
});