	$(document).ready(function(){
		$('HTML').addClass('JS');
		
		$(".iphone-slide").cycle({
			fx: 		'scrollLeft',
			timeout: 	'5000'
		});
		 
	    //setInterval("getLatest()",3000);
	    //getLatest();
	});
	var _lastid;
    function getLatest(){
        var loadall=false;
        if(!_lastid){
            loadall=true;
        }
		$.ajax({
			   type: "GET",
			   url: "http://search.twitter.com/search.json",
			   data: "q=brain",
			   dataType: "jsonp",
		       jsonp: "callback",
		       timeout: 700,
			   success: function(data){
	           $.each(data.results, function(i,item){
		           if(_lastid && _lastid==item.id){
			           return false;
		           }
		           _lastid=item.id;
		           var extrastyle="";
		           if(!loadall){
		        	   extrastyle="display:none";
		           }
		           var HTML = "<li style='"+extrastyle+"'><img height=48 width=48 src='"+item.profile_image_url+"'/>"+
                	"<h4>"+item.from_user+"</h4>"+
                	"<p>"+item.text+"<br/>";
                	if(item.source){
	                  HTML = HTML + "<a href='"+item.source+"'>source</a>";
                	}
	                HTML = HTML + "</p></li>";
	        	   if( HTML !== '' ){
	                   $("#tabs-1 ul").prepend( HTML );
	                   $("#tabs-1 ul").find('li:hidden').show("slide");//, { direction: "down" }, 1000);
	        	   }
                   $("#tabs-1 li:gt(14)").remove(); // Removes everything past the 15th tweet
                   if(!loadall){
    				   return false;
                   }
	            });
			   },
		       error: function(XHR, textStatus, errorThrown){
		       }
			 });
	}

