$(document).ready(function() {
	$.Juitter.start({
		searchType:"fromUser", // needed, you can use "searchWord", "fromUser", "toUser"
		searchObject:"optify", // needed, you can insert a username here or a word to be searched for, if you wish multiple search, separate the words by comma.

		lang:"en", // restricts the search by the given language
		live:"live-90", // 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: "Loading messages...", // 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 
		total: 20, // number of tweets to be show - max 100
		readMore: "Read it on Twitter", // read more message to be show after the tweet content
		nameUser:"image" // insert "image" to show avatar of "text" to show the name of the user that sent the tweet 
	});
	
	$("ul.jLinks li a").click(function(e){
		
		// set the feed title
		$("h2#feed-title").text($(this).attr("title"));
		
		$("ul.jLinks li").removeClass("active"); // remove 'active' class from all li's
		$(this).parent().addClass("active"); // set 'active' class on the selected link's parent li
		
		var userNames = $(this).attr("rel") || "optify"; // tries to grab usernames from the rel attribute of the link, otherwise defaults to "optify"
		
		$.Juitter.start({
			searchType: "fromUser",
			searchObject: userNames,
			live: "live-180" // it will be updated every 180 seconds/3 minutes
		});
	});

});