function login(form,conf){
  jQuery(conf.name_error).hide().html("");
  jQuery(conf.pswd_error).hide().html("");
  jQuery(conf.bad_error).hide().html("");
	
	var callBack = function(data){
	  if(typeof data.isSuccess != "undefined" && data.isSuccess == true){
	      var loginbar_menu_html = '<a href="' + path + '/' + data.loginPersonPath + '">' + data.loginPerson.name + '</a><span class="vline">|</span><a href="' + path + '/z/user/set">个人设置</a><span class="vline">|</span><a href="javascript:window.external.addFavorite(\'http://www.oushe.cn/\', \'人物搜索-偶社\');">收藏本站</a><span class="vline">|</span><a href="' + path + '/z/logout">退出</a>';
	      jQuery("#loginbar_menu").html(loginbar_menu_html);
		    tb_remove();
	  }else{
	      
	      jQuery(conf.name_error).html(data.error_name).fadeIn(800);
        jQuery(conf.pswd_error).html(data.error_pswd).fadeIn(800);
        jQuery(conf.bad_error).html(data.error_bad).fadeIn(800);
	  }
	};
	new AjaxRequest(basePath+"/z/Ajaxlogin",{uemail:form.username.value,upswd:form.pswd.value},callBack).begin();
}

function checkLogin(data){
	if(typeof(data.isLogin) != 'undefined' && data.isLogin == false){
		//$("#loginLinkDom").click();
		tb_show('请您登录',path+"/loginajax.html?height=200&width=500&modal=false",false);
		
		return false;
	};
	return true;
}
