function github(json)
{
	output = '';
	for (var i = json.user.repositories.length - 1; i >= 0; i--)
	{
		if ( !json.user.repositories[i].private )
		{
			output += "<li><a href=\"" + json.user.repositories[i].url + "\">" + json.user.repositories[i].name + "</a><div>" + json.user.repositories[i].description + "</div></li>";
		}
	}
	$('opensourceprojects').innerHTML = output;
}
function jsonFlickrApi(json)
{
	photo = json.photos.photo[0];
	url = "http://farm" + photo.farm + ".static.flickr.com/" + photo.server + "/" + photo.id + "_" + photo.secret + "_m.jpg";
	$('latest-photo').setStyle({ backgroundImage : "url(" + url + ")" });
}
function twitter(json)
{
	// process location
	mylocation = "";
	mylocation = json.location.match(/([\-?\.0-9]+)/g);
	lat = ( !mylocation[0] ) ? "37.780014" : mylocation[0] ;
	lon = ( !mylocation[1] ) ? "-122.396286" : mylocation[1] ;
	$('map').innerHTML = '<a href="http://maps.google.com/maps?q=' + lat + '%2C' + lon + '"><img title="Map pointing Luis\' latest location based on Twitter" src="http://maps.google.com/staticmap?center=' + lat + ',' + lon + '&zoom=13&size=150x162&maptype=terrain&markers=' + lat + ',' + lon + ',smallwhite&key=ABQIAAAAheghADB__2gx-9K4IszPVBRn_YNENE81L20t8qJxh5_n9bt55BQzSCywG28cZYVlsiPCwFmBBrexZw&sensor=false"/></a>';
	// get latest status
	// $('status').innerHTML = '<a href="">' + json.status.text + '</a>';
}
document.observe('dom:loaded', function()
{
	// $$( "form.validated" ).each( function( form )
	// {
	// 	new Validation( form.id, { stopOnFirst : true, immediate : true } );
	// });
});
// 