
window.addEventListener ('load', function () {
	var web = new Vn.Login ();
});

Vn.Login = new Class
({
	Extends: Vn.Object

	,initialize: function ()
	{
		Vn.Hash.initialize ();
	
		switch (Vn.Hash.get ('error'))
		{
			case 'badLogin':
				alert (_('InvalidLogin'));
				break;
			case 'sessionExpired':
				alert (_('SessionExpired'));
				break;
		}

		var userEntry = document.getElementById ('user');

		if (Vn.Cookie.check ('vn_user'))
			userEntry.value = Vn.Cookie.get ('vn_user');

		userEntry.focus ();
		userEntry.select ();
	}
});

