$(document).ready(function() {
	var oLogin = new JunaioLogin();
});

function JunaioLogin() {

	this.init = function() {
		var that = this;
		$('#loginform input').keypress(function(e) {
			return that.submitenter(this, e);
		});
		$('#signup .popup').click(function() {
			oTools.popup(this.href, 'License');
			return false;
		});
	};

	this.submitenter = function(oElement, oEvent) {
		var keycode;
		if (window.event) {
			keycode = window.event.keyCode;
		} else if (oEvent) {
			keycode = oEvent.which;
		} else {
			return true;
		}

		if (keycode == 13) {
			oElement.form.submit();
			return false;
		} else {
			return true;
		}
	};

	this.init();

}