$(document).ready(function(){
	
	// This is to slow down spam on all the forms.
	$('form').append('<input type="hidden" name="secretsquirrel" value="ihatebots" />');
	
	// Homepage screenshot functionality
	$('#screenshots').karmicFlow({auto:true});
	
    // Work screenshot functionality
   $('#screenshots-cumberland, #screenshots-artisan, #screenshots-wegrowhair, #screenshots-mazda, #screenshots-rede, #screenshots-elliott, #screenshots-sanford, #screenshots-time, #screenshots-intimacy, #screenshots-freelance, #screenshots-embrace, #screenshots-kijaro, #screenshots-paiindy, #screenshots-storyville, #screenshots-oasis, #screenshots-trailiner').karmicFlow();
	
	// Services tabs
	$('#service-tabs').tabs();
	
	// Contact address hover
	$('#world-map span').hover(function(){
		var state = $(this).attr('class');
		$('#address-ar,#address-tn,#address-nz').hide();
		$('#address-'+state).fadeIn("fast",function(){
			var timer = null;
			timer = setTimeout(function(){$('#address-'+state).fadeOut("slow");},10000);
		});
	});
	
	$('#contact-form').FormValidate();
	
	// gTalk pop-up window
	$('#gtalk-icon,#gtalk-icon-lg').popupwindow({
		gTalk:{
			height:800,
			width:400
		}
	});
	
	$("#work .screenshots-work img").lazyload({
		effect : "fadeIn",
		failurelimit: 10,
		placeholder: "/img/transparent.gif"
	});
	
	$('a.email').nospam();
});

Cufon.replace('h1.home,h2,p.services,.screenshot-controllers p,.screenshot-controllers a,#btnSubmit',{fontFamily:'DIN Medium',hover:true});
Cufon.replace('h3 strong,h1 strong,a.blue-arrow strong,form label:not(".checkbox")',{fontFamily:'DIN'});
Cufon.replace('h3 span,h1 span,a.blue-arrow span,#blog h3',{fontFamily:'DIN Alternate Light'});
