Cufon.replace('.nivo-caption h1', { fontFamily: 'Helvetica75' });
Cufon.replace('.nivo-caption h2', { fontFamily: 'Helvetica55' });	
Cufon.replace('h4', { fontFamily: 'Helvetica55' });		
Cufon.replace('.capabilitiesMenu', { fontFamily: 'Helvetica55', hover: true });			
$(window).load(function() {
	$("#height").height($(window).height()-85);

	$('#mosaicMessage').nivoSlider({
		 effect:'fade',
		 controlNav: false,
		 directionNav: false,
		 pauseTime: 8500,
		 captionOpacity:1
		});
		
	$('#home').masonry({
		itemSelector: '.workfeature',
		columnWidth: 200
		});

	$('#mid').masonry({
		itemSelector: '.mid',
		columnWidth: 250
		});
		
});

$(document).ready(function() {

	var v = $(".feature").css('visibility', 'visible'), cur = 0;
	//for(var j, x, i = v.length; i; j = parseInt(Math.random() * i), x = v[--i], v[i] = v[j], v[j] = x);
	function fadeInNext() {
	  v.eq(cur++).fadeTo( 1000, 1);
	  if(cur != v.length) setTimeout(fadeInNext, 50)
	}
	fadeInNext();
	
	var imageHeight = 0;
	$('#folioImages > img').each(function(){
		if ( imageHeight < $(this).height())
			//console.log($(this).height());
			imageHeight = $(this).height();
			$('#folioImages').height(imageHeight);
	});

});


$(window).resize(function() {
	$("#height").height($(window).height()-85);
});
	
jQuery(function( $ ){
		//borrowed from jQuery easing plugin
		//http://gsgd.co.uk/sandbox/jquery.easing.php
		$.scrollTo.defaults.axis = 'xy'; 
		$.easing.elasout = function(x, t, b, c, d) {
			var s=1.70158;var p=0;var a=c;
			if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
			if (a < Math.abs(c)) { a=c; var s=p/4; }
			else var s = p/(2*Math.PI) * Math.asin (c/a);
			return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
		};
		});
// -->
