/*
<input id="cf3_field_11" class="cf-box-a" type="checkbox" name="cf3_field_11"/>
<fieldset class="cf-fs3">
*/

/*
jQuery(function( $ ){
	// code here
});
*/

// Clears all check boxes
//$(document).ready(function() {$(":checkbox").uncheck();});

jQuery.fn.cycleList = function(id) {
	 var $that = $(id+' li');
	 var j = 0;
	 var delay = 5000; //millisecond delay between cycles
	 function cycleThru() {
	         var jmax = $that.length -1;
	         $($that+":eq(" + j + ")")
	                 .animate({"opacity" : "1"} ,400)
	                 .animate({"opacity" : "1"}, delay)
	                 .animate({"opacity" : "0"}, 400, function(){
	                         (j == jmax) ? j=0 : j++;
	                         cycleThru();
	                 });
		};

};

jQuery.fn.getTwitterUpdates = function() {
	//var url = 'http://www.twitter.com/statuses/user_timeline/JustWalkEvents.json?callback=twitterCallback2&count=2';
	var url = 'http://www.twitter.com/statuses/user_timeline/JustWalkEvents.json?callback=twitterCachedCallback&count=2';

	var script = document.createElement('script');
	script.setAttribute('src', url);
	document.body.appendChild(script);
};

$(document).ready(function() {
	$("ul#events-ticker").cyclelist({ms:5000});
	// load Twitter in background
	$().getTwitterUpdates();
});
