//ログインパネル用イベント（リファクタリング対象）

function initLogin() {
	
	//IE対策
//    $('#login_panel .panel_content').css('height', 'auto');
	
	$('form').submit(function(){
		
		$('p.login_error').hide();
		
		var address = $.trim( $('#login_addr').val() );
		var password = $('#login_pass').val();
		var error_flag = false;
		
		if (!address) {
			$('#no_id').show('fast');
			error_flag = true;
		}
		
		if (!password) {
            $('#no_pass').show('fast');
			error_flag = true;
        }
		
		if (error_flag) return false;
		
		$.post('/login/login',
		      {
			  	'address'  : address,
				'password' : password
			  },
			  function(data){
			  	pageRedirect(data);
				if (data == 'ban') {
					window.location.href = '/ban';
				}else if (data == 'no_id') {
					$('#no_id').show('fast');
				}else if (data == 'no_pass') {
					$('#no_pass').show('fast');
				}else if (data == 'no_user') {
					$('#id_pass_invalid').show('fast');
				}
			  });
		return false;
	});
	
//	$('#about_mancha').click(function(){
////		window.open('/lp/chat');
//		$.post('/help/index',{'subject' : 'intro'},
//               function(data) {
//                    $('#pop_page').html(data);
//                    showPopPage();
//               });
//		return false;
//	});
}

