var twit = {
	id : "#msg",
	doProc : true,
	byArray : [],
	exText : "asdfa1,10,45,15,10,10,5,1.5,9,7,59,10,0,360,0.2,0.4,250,144,35,1,32,31,25,0,245,0,0,0,21,21,8,0--- #parcycle",
	found:0,
	load : function(){
		this.doProc = true;
		this.print("loading recent parcycle tweets...&nbsp;<a href='#'>CANCEL</a>");
		$.getJSON("http://search.twitter.com/search.json?q=%23parcycle&callback=?", function( data ){
			if(twit.doProc){
				twit.process(data);
			}
		});
	},
	
	cancel : function(){
		this.doProc = false;
	},
	
	process : function( data ){
		var _this = this;
		_this.found = 0;
		var err = "";
		$.each( data.results, function(index){
			if(_this.found < controller.eg.length){
				var matches = this.text.match(/[0-9,\.-]{20,}/);
				if(matches && matches.length === 1){
					var arr = controller.arrayify( matches[ 0 ]);
					if(typeof arr != "string"){
						controller.eg[ _this.found ] = arr;
						_this.byArray[ _this.found++ ] = this.from_user;
					}
				}
			}
		});
		
		if(this.found === 0 ){
			this.print("No tweets found.");
			return;
		}

		this.print(" Most recent parcycles loaded into the examples.");
	},
	
	print : function(msg,blnLeave){
		$(this.id).fadeOut("slow", function(){
			$(this).html(msg).fadeIn("slow",function(){
				if(blnLeave){
					return;
				}
				twit.waitClose();
			});
		});
	},
	
	waitClose : function(){
		var _this = this;
		setTimeout( function(){
			$(_this.id).fadeOut(2000);
		}, 3000);
	}
};