function initTwitterApi(){
	var url = 'http://search.twitter.com/search.json?callback=?';	
	
	// Request the results
	$.getJSON(url, {'rpp':'100',"lang":"en",'q': TWITTER_TERM}, function(data) {
		// Processing those results, if any
		if (data.results.length) 
		{
		    var anchors = true;
			var str ='<div class="twitterSearchContainter">';
				jQuery.each(data.results, function(i, val) {
				 	var t = val.text;
					if (anchors) {
						t = val.text.replace(/(http:\/\/\S+)/g, '<a target="_blank" href="$1">$1</a>');
						t = t.replace(/\@(\w+)/g, '<a target="_blank" href="http://twitter.com/$1">@$1</a>');
					}					
					str +='<div id="tweet" style="width:100%;">';															
						str +='<img class="fltlftweet" src="'+val.profile_image_url+'">';								
						str +='<div class="twitter_copy">'+t+'</div>';
					 str +='</div>';	
					
				});	
			  str +='</div>';			  
			  
			  $('#twitter-widget').html(str);
			  
			  $('.twitterSearchContainter').cycle({ 
					fx		: 'scrollUp', 					
					pause	: 1 ,
					cleartype:  1										
			  });
			 

		}
		
	});
}

function initTwitterApiUser(){
		var url = 'http://api.twitter.com/1/statuses/user_timeline.json?callback=?';
				// Request the results
		$.getJSON(url, {'count':'1','screen_name':TWITTER_USER}, function(data){		
			
		var anchors = true;
		var str ='';
		
		if(data)
		{
			var t = data[0].text;
			if (anchors) {
				t = t.replace(/(http:\/\/\S+)/g, '<a target="_blank" href="$1">$1</a>');
				t = t.replace(/\@(\w+)/g, '<a target="_blank" href="http://twitter.com/$1">@$1</a>');
			}
			
			str +='<div id="tweet" style="width:100%;">';									
				str +='<img class="fltlftweet" src="'+data[0].user.profile_image_url+'">';						
				str +='<div class="twitter_copy">'+t+'</div>';
			 str +='</div>';
					 
			 
			 $('#twitter-user').html(str);			 
		}
	});
}

