// PNG fix
$(function(){$(document).pngFix();});
// Homepage slider
$(document).ready(function(){
	$("#myController").jFlow({
		slides: "#mySlides",
		width: "472px",
		height: "280px"
	});
	$('#casestudies').innerfade({ 
		speed: 'slow', 
		timeout: 4000, 
		type: 'random_start',
		containerheight: '253px' 
	});
});

// Homepage tabs
$(document).ready(function(){
	//$('#tabsHere').tabs({fxFade: true, fxSpeed: 'slow'});
	$('#tabsHere').tabs({fxSlide: true, fxSpeed: 'slow'});
});
// Back to top link
$('.topOfPage').click(function () {
$.scrollTo('#header', 600);
return false;
});

$(document).ready(function(){
	$("#logoWrapper").css({'height' : '90px'});	
	$(".clientLogo").each(function(i) {
		var panelLeft = (i) * 110 + 'px';
		$(this).css({'float' : 'none', 'margin-right' : '0', 'position' : 'absolute', 'left' : panelLeft, 'top' : '0px'});
	});
	animatePanels(0);
	
	function animatePanels(firstPanel) {
	$(".clientLogo").each(function(i) {
		$(this).animate(
			{
				left: "-=110px"
			},
			500,
			"linear",
			function(){
				if ($(".clientLogo").size() - 1 == i) {
					var panelLeft = (($(".clientLogo").size() - 1) * 110) + 'px';
					$(".clientLogo").eq(firstPanel).css({'left' : panelLeft});
					firstPanel++;
					if ($(".clientLogo").size() == firstPanel) firstPanel = 0;
					setTimeout(function(){animatePanels(firstPanel);}, 5000);
				}
			}
		);
	});
}
});
$(document).ready(function(){
	$('span.mailme').mailme();
});


