// JavaScript Document
// Google APIS JavaScript 
// Febuary 2010 Simon Fraser http://symatree.co.uk

// Load jQuery
google.load("jquery", "1.4");

//run on load
google.setOnLoadCallback(function() { //on page load

	//Older work toggle
	$(".prev").click(function() {
		$("#older").animate({height: "toggle"}, 600);
                $(this).text($(this).text() == 'View Previous Work' ? 'Hide Previous Work' : 'View Previous Work');
	});	

	//contact box title text
	$('.multiple').example(function() {
	 return $(this).attr('title'); 
	});
	
	//contact box validator
	var validator = $("#contact").validate({
	  invalidHandler: function() {
	    $("#errorbox").text("Errors have been made.");
	  }
	});
	
	//twitter timeline
	$(".twit").tweet({
	           join_text: "auto",
	           avatar_size: 32,
	           count: 2,
	           loading_text:"Loading tweets..."
	 });
	 
	 //fancybox overlay
	 $("a.zoom").fancybox({
		 'titleShow':false,
		 'width':640,
		 'height':400,
		 'autoScale': false,
		 'transitionIn':'none',
		 'transitionOut':'none',
		 'type':'iframe'
	 });

});//end setOnLoad