//Carregem les fonts
google.load("webfont", "1");
google.setOnLoadCallback(function() {
	WebFont.load({google:{families:[
		'Indie+Flower',
		'Cabin+Sketch:bold'
	]}});
});
$(document).ready(function(){
	$("#presentacion").fadeIn("slow");
	//Afegeix el title de la img com a comantari al footer
	$(".tweet").text("");
	$(".foto img").each(function(){
		$(this).after("<div>"+($(this).attr("title"))+"</div>");
	});
	//span necessari per a posar la cinta a la foto
	$(".foto").prepend("<span></span>");
	//twitter
	$(".tweet").tweet({
		username: "nadiesgirona",
		join_text: "auto",
		count: 5,
		auto_join_text_default: "",
		auto_join_text_reply: "Respondiendo ",
		auto_join_text_ed: "Nosotros ",
		auto_join_text_ing: "we were",
		auto_join_text_url: "we were checking out",
		loading_text: "Cargando tweets..."
	});	
	//picasa
	$("#mygallery").EmbedPicasaGallery('info.nadies',{
		matcher:    /./,  // string or regexp matching album title
		size:      '144',  // thumb size (32,48,64,72,144,160))
		msg_loading_list :  'Cargando fotos de picasa',
		msg_back :   'Atrás'
	});
	//navegació
	$("#main-nav a").click(function(){
		var visible=null;
		var change=true;
		id="#"+$(this).attr("id").substring(4);
		if(id=="#ryder")change=false;//excepció pel menú ryder
		$(".article").each(function(){
			if($(this).css("display")!="none")visible=$(this);
		});
		if(visible!=null){
			id_visible="#"+visible.attr("id");
			if(id_visible==id)change=false;
			if(change)visible.fadeOut("slow");
		}
		//$(".article").fadeOut("slow");
		if(change)$(id).fadeIn("slow");
	});
	
	
});

