$(document).ready(function(){		



		

	/* Home

	================================================================================== */	

	/*

	$('#doorLink').hover(function() {

	  $('#intro').slideToggle(200, function() {

	  });

	});

	*/

	

	$("a.link").hover(

	  function () {

		$('#index #title h3').html($(this).attr("title"));

		$(".over", this).fadeIn(200);

		Cufon.refresh("#index #title h3");

	  }, 

	  function () {

		$(".over", this).fadeOut(100);

		$('#index #title h3').html("Click a window for more");

		Cufon.refresh("#index #title h3");

	  }

	);		

				

	/* About

	================================================================================== */	

	$('#about #text').jScrollPane({showArrows:true});





	/* Global

	================================================================================== */	

	

	$("#global #globe").scrollable({circular: true, 

	

		onBeforeSeek: 

		function(){		

			// Compensate for circular's addition of 2 new Div's			

			if( this.getIndex() ==  ($(".items div").length-2) ) { $trueIndex = 0; } else { $trueIndex = this.getIndex(); };	

			$(".continent").eq($trueIndex).fadeOut(200);

	   },	

	

		onSeek: 

		function(){	

			// Compensate for circular's addition of 2 new Div's			

			if( this.getIndex() ==  ($(".items div").length-2) ) { $trueIndex = 0; } else { $trueIndex = this.getIndex(); };

			$(".continent").eq($trueIndex).fadeIn(400);			

	   } 

        

     }); 

	

	// Compensate for the onBeforeSeek ini bug

	setTimeout(function(){$("#europe").fadeIn(200);}, 100);				

				

	$("a.country").hover(

	  function () {

		$(".over", this).fadeIn(200);

		//$nation = $(this).attr('rel');

		//$($nation).fadeIn(200);

	  }, 

	  function () {

		$(".over", this).fadeOut(100);

		//$nation = $(this).attr('rel');

		//$($nation).fadeOut(100);			

	  }

	);	

	

	$("a.country").click( 

		function(){

			$(".nation").fadeOut(100);

			$nation = $(this).attr('rel');

			$($nation).fadeIn(200);

			return false;			

		}

	);							

	

	/* Clients

	================================================================================== */	

	$('#readMore').click(function() {

	  $('#more').slideToggle(300, function() {

	  });

	});

	

	$('#view').click(function() {

		$('#clientsMain').fadeOut(300, function() {

			$('#clientsView').fadeIn(300, function() {

			});

		});

		

		$('#header').fadeOut(200, function() {

			$('#header').css("background-position", "0 -91px");	

			$('#header').fadeIn(200, function() {

			});

		});		

	});	

	

	$('#readMain').click(function() {

		$('#clientsView').fadeOut(300, function() {

			$('#clientsMain').fadeIn(300, function() {

			});

		});

		

		$('#header').fadeOut(200, function() {

			$('#header').css("background-position", "0 0");	

			$('#header').fadeIn(200, function() {

			});

		});			

	});	

	

	$('#testi').click(function() {

		$('#clientsView').fadeOut(300, function() {

			$('#clientsTestimonials').fadeIn(300, function() {

			});

		});

		

		$('#header').fadeOut(200, function() {

			$('#header').css("background-position", "0 -182px");	

			$('#header').fadeIn(200, function() {

			});

		});			

	});	

	

	$('#returnClients').click(function() {

		$('#clientsTestimonials').fadeOut(300, function() {

			$('#clientsView').fadeIn(300, function() {

			});

		});

		

		$('#header').fadeOut(200, function() {

			$('#header').css("background-position", "0 -91px");	

			$('#header').fadeIn(200, function() {

			});

		});			

	});				

	

	$("a.frame").hover(

	  function () {

		$(".over", this).fadeIn("slow");

	  }, 

	  function () {

		$(".over", this).fadeOut("slow");

	  }

	);	

	

	

	/* People

	================================================================================== */	



	$("#content #people #headshots ul li a").hover(

	  function () {

		$(".over", this).fadeIn("slow");

	  }, 

	  function () {

		$(".over", this).fadeOut("slow");

	  }

	);	

	

	$("img[rel]").overlay({top:100});		

		

		


	

	/* Values

	================================================================================== */			



	$("a.value").hover(

	  function () {

		$(".over", this).fadeIn("slow");

	  }, 

	  function () {

		$(".over", this).fadeOut("slow");

	  }

	);	

	

	$("a[rel]").overlay({top:200});					


	/* Contact

	================================================================================== */			



	$("#gmap").fuGMAP({zoom: 15, markers: [{ address:'27 Newton Street, London , WC2B 5EL', url:'http://www.made2010.com/made.html'}], icon: { image: "http://www.made2010.com/images/sections/contact/icon.png", iconsize: [70, 40], iconanchor: [63, 38] }

});	

	

	$("#mapHolder").hover(

	  function () {

		$("#imap", this).fadeOut(400);

	  }, 

	  function () {

		$("#imap", this).fadeIn(350);

	  }

	);


});


