function headerLogin(){
	this.loginModule = 'div#header div.login';
	this.init();
}

headerLogin.prototype = {
	init: function(){
		var instance = this;
		$('div#header a.memberLogin').click(function(){
			//if turning the module off
			if ($(this).hasClass('on')){
				$(this).removeClass('on');
				$(instance.loginModule).hide();
			}
			//turning on the module
			else{
				$(this).addClass('on');
				var currentHeight = $(this).outerHeight();
				$(instance.loginModule).css('top', currentHeight + 'px').show();
				
				$('div.login input[type=password]').unbind().keypress(function(e){
			 		if (e.which == 13){
						$('div.login form#frmLogin').submit();
			    }
				});

				$('div.login a#btnLogin').unbind().click(function(){
					$('div.login form#frmLogin').submit();
				});
			}
		});
	}
}

$(function(){
	var headerLoginObj = new headerLogin();
});
