jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};
   
animateContent = function(){  
   var config = {
	   css: { box: '#block-content'}
   };   
   var shelf = {};   
   function run(){
	   shelf.box = $(config.css.box);
	   movement();
   };   
   function movement(){
		shelf.box.animate({left: '40px'},'slow')
	};	
	return { config: config, run: run }
}();

animateSlideshow = function(){   
   var config = {
	   css: { box: '#block-content'}
   };   
   var shelf = {};   
   function run(){
	   shelf.box = $(config.css.box);
	   movement();
   };
   function movement(){
		shelf.box.animate({left: '16px'},'slow')
   };	
	return { config: config, run: run }
}();

function menu(){
	$('.left-buttons li a.button-what-we-do').click(function() { 
		$('.left-buttons ul.headlink').toggle(100)
	});
};

function horizontalScroll(){	
	$('#slideshow').serialScroll({
		items:'li',
		prev:'a.button-slideshow-prev',
		next:'a.button-slideshow-next',
		offset:-100, //when scrolling to photo, stop 230 before reaching it (from the left)
		start:1, //as we are centering it, start at the 2nd
		duration:1200,
		force:true,
		stop:true,
		lock:false,
		cycle:true, //don't pull back once you reach the end
		easing:'easeOutQuart', //use this easing equation for a funny effect
		jump: true //click on the images to scroll to them
	});	
};

function slideshowImageHover(){
	$('#slideshow img').fadeTo('slow', 0.8);
	$('#slideshow li').hover(function(){
		$(this).fadeTo('slow', 1.0);
	}, function(){
		$(this).fadeTo('slow', 0.8);
	});			
}

function imageOpacityHover(){
	$('.image-opacity').fadeTo('slow', 0.8);
	$('.image-opacity').hover(function(){
		$(this).fadeTo('slow', 1.0);
	}, function(){
		$(this).fadeTo('slow', 0.8);
	});			
}

function detectScreenSize(){
	var width = screen.width;
	var height = screen.height;
	alert('w: ' + width + ' h: ' + height);
}

function goLink (h){ 
	window.location.href = h; 
}

function renderLoading(){
	var html = '<div style="margin:30px 0;" align="center"><img src="../images/loading.gif" alt="Loading" /></div>';
	return html;
}
