var Highscore	= {	$inputName		: null,	$defaultNameVal	: 'Skriv dit navn her hvis du vil på Highscoren!',	init: function()	{		Highscore.$inputName	= $('#highscoreName input');		Highscore.$inputName.focus(Highscore.onInputFocus);		Highscore.$inputName.blur(Highscore.onInputBlur);		Highscore.$inputName.val(Highscore.$defaultNameVal);		Highscore.load();	},	onInputFocus: function()	{		Highscore.$inputName.val( Highscore.$inputName.val().toLowerCase() == Highscore.$defaultNameVal.toLowerCase() ? '' : Highscore.$inputName.val() );	},	onInputBlur: function()	{		Highscore.$inputName.val( $.trim(Highscore.$inputName.val()) == '' ? Highscore.$defaultNameVal : Highscore.$inputName.val() );	},	save: function(score)	{		$.post(Config.baseURL + 'ajax/highscore/',		{			action	: 'save',			score	: score,			name	: ( Highscore.$inputName.val().toLowerCase() == Highscore.$defaultNameVal.toLowerCase() ? '' : Highscore.$inputName.val() ),			pageID	: Config.pageID		},		function(response)		{			Highscore.load();		},		'json');	},	load: function()	{		if($('#highscore-container').length > 0)		{			$.post(Config.baseURL + 'ajax/highscore/',			{				action	: 'load',				pageID	: Config.pageID			},			function(response)			{				var _str	= '';				for(var i=0; i<response.response.length; ++i)				{					if(i>19) break;					_str += '<div><div class="score">'+response.response[i].score +'</div><div class="name">'+response.response[i].name+'</div></div><div class="clear"></div>';				}				$('#highscore-container').html(_str);			},			'json');		}	}};$(document).ready(Highscore.init);
