/*	debug v0.1

*/

function toggleDebug(event)
{
	if (event.keyCode == 113) // F2
	{
		// And scroll to the correct position
		if ($("#debug").css("display") == 'none')
		{
			$("#debug").toggle();
			$.scrollTo("#debug", {duration: 200});
		}
		else
		{
			// Display widget debug
			$.scrollTo(0, {duration: 200, onAfter: function() { $("#debug").toggle(); } });
		}
	}
}

$(document).ready(function()
{
	$(document).keyup( toggleDebug );
});