
/***************************************************
		  ZOOM PORTFOLIO HOVER - COLUMN
***************************************************/
jQuery(document).ready(function(){

	jQuery(".column a").contents("img").hover(function(){
		jQuery(this).stop().animate({opacity:0.4}, 400);
	}, function() {
		jQuery(this).stop().animate({opacity:1}, 400);
	});

});



/***************************************************
	     ZOOM PORTFOLIO HOVER - COLUMN-LIST
***************************************************/
jQuery(document).ready(function(){

	jQuery(".column-list a").contents("img").hover(function(){
		jQuery(this).stop().animate({opacity:0.4}, 400);
	}, function() {
		jQuery(this).stop().animate({opacity:1}, 400);
	});

});





/***************************************************
				  PORTFOLIO COLUMN
***************************************************/
$(document).ready(function(){	
	$('a[href^="http://"]')	.attr({ target: "_blank" });
	function smartColumns() {		
		$(".column").css({ 'width' : "100%"});		
		var colWrap = $(".column").width();
		var colNum = Math.floor(colWrap / 200);
		var colFixed = Math.floor(colWrap / colNum);	
		
		$(".column").css({ 'width' : colWrap});
		$(".column li").css({ 'width' : colFixed});		
	}		
	smartColumns();	
	$(window).resize(function () {
		smartColumns();		
	}); 		
});	





/***************************************************
				  PORTFOLIO COLUMN-LIST
***************************************************/
$(document).ready(function(){	
	$('a[href^="http://"]')	.attr({ target: "_blank" });
	function smartColumns() {		
		$(".column-list").css({ 'width' : "100%"});		
		var colWrap = $(".column-list").width();
		var colNum = Math.floor(colWrap / 900);
		var colFixed = Math.floor(colWrap / colNum);	
		
		$(".column-list").css({ 'width' : colWrap});
		$(".column-list li").css({ 'width' : colFixed});		
	}		
	smartColumns();	
	$(window).resize(function () {
		smartColumns();		
	}); 		
});	




/***************************************************
				  PORTFOLIO FILTERABLE
***************************************************/
/*
* Copyright (C) 2009 Joel Sutherland.
* Liscenced under the MIT liscense
*/
(function($) {
	$.fn.filterable = function(settings) {
		settings = $.extend({
			useHash: true,
			animationSpeed: 800,
			show: { width: 'show', opacity: 'show' },
			hide: { width: 'hide', opacity: 'hide' },
			useTags: true,
			tagSelector: '#portfolio-filter a',
			selectedTagClass: 'current',
			allTag: 'all'
		}, settings);
		
		return $(this).each(function(){
		
			/* FILTER: select a tag and filter */
			$(this).bind("filter", function( e, tagToShow ){
				if(settings.useTags){
					$(settings.tagSelector).removeClass(settings.selectedTagClass);
					$(settings.tagSelector + '[href=' + tagToShow + ']').addClass(settings.selectedTagClass);
				}
				$(this).trigger("filterportfolio", [ tagToShow.substr(1) ]);
			});
		
			/* FILTERPORTFOLIO: pass in a class to show, all others will be hidden */
			$(this).bind("filterportfolio", function( e, classToShow ){
				if(classToShow == settings.allTag){
					$(this).trigger("show");
				}else{
					$(this).trigger("show", [ '.' + classToShow ] );
					$(this).trigger("hide", [ ':not(.' + classToShow + ')' ] );
				}
				if(settings.useHash){
					location.hash = '#' + classToShow;
				}
			});
			
			/* SHOW: show a single class*/
			$(this).bind("show", function( e, selectorToShow ){
				$(this).children(selectorToShow).animate(settings.show, settings.animationSpeed);
			});
			
			/* SHOW: hide a single class*/
			$(this).bind("hide", function( e, selectorToHide ){
				$(this).children(selectorToHide).animate(settings.hide, settings.animationSpeed);	
			});
			
			/* ============ Check URL Hash ====================*/
			if(settings.useHash){
				if(location.hash != '')
					$(this).trigger("filter", [ location.hash ]);
				else
					$(this).trigger("filter", [ '#' + settings.allTag ]);
			}
			
			/* ============ Setup Tags ====================*/
			if(settings.useTags){
				$(settings.tagSelector).click(function(){
					$('.column ul').trigger("filter", [ $(this).attr('href') ]);
					$('.column-list ul').trigger("filter", [ $(this).attr('href') ]);					
					$(settings.tagSelector).removeClass('current');
					$(this).addClass('current');
				});
			}
		});
	}
})(jQuery);

$(document).ready(function(){	
	$('.column ul').filterable();
	$('.column-list ul').filterable();
});





/***************************************************
				SLIDING TABS
***************************************************/
$(document).ready(function() {	
  $('#tabMenu > li').click(function(){
    $('#tabMenu > li').removeClass('selected');
    $(this).addClass('selected');
    $('.boxBody div').slideUp('1500');
        $('.boxBody div:eq(' + $('#tabMenu > li').index(this) + ')').slideDown('1500');    
  });	
});





