$(document).ready(function(){
	//Fitxak
    $('.tab').click(function(event) { 
	    // Aukeratutako fitxaren klasea
		var klasea = $(this).attr('id').split('_')[0]+$(this).attr('id').split('_')[1];
		// Fitxari dagokion edukiaren kutxa
		var tab = document.getElementById(klasea)
		var fitxak = $('#fitxak .fitxaKutxa');
		for (var i = 0; i<fitxak.length; i++){
			fitxak[i].style.display = 'none';
		}
		$('.aukerak .aukeratua').removeClass('aukeratua');
		$(this).parent('li').addClass('aukeratua');
		tab.style.display = 'block';
		return false; 
    });
	//Twitter
	$.Juitter.start({
		searchType:"fromUser", // needed, you can use "searchWord", "fromUser", "toUser"
		searchObject:"bugattif1", // needed, you can insert a username here or a word to be searched for, if you wish multiple search, separate the words by comma.
		live:"live-10", // the number after "live-" indicates the time in seconds to wait before request the Twitter API for updates.
		placeHolder:"juitterContainer", // Set a place holder DIV which will receive the list of tweets example <div id="juitterContainer"></div>
		loadMSG: "Kargatzen...", // Loading message, if you want to show an image, fill it with "image/gif" and go to the next variable to set which image you want to use on 
		imgName: "loader.gif", // Loading image, to enable it, go to the loadMSG var above and change it to "image/gif"
		total: 3, // number of tweets to be show - max 100
		nameUser:"text", // insert "image" to show avatar of "text" to show the name of the user that sent the tweet 
		openExternalLinks:"newWindow", // here you can choose how to open link to external websites, "newWindow" or "sameWindow"
	});
});
