// JavaScript Document
function PUserLogon()
{
	var objUserID = document.getElementById("LoginUserID");
	var objUserPassword = document.getElementById("LoginUserPassword");

//	var strResult = Pet67.Blog.PCenter.PUserServices.Logon(
	var strResult = Pet67.Web.AppServices.InterFaceServices.Logon(
				objUserID.value, 
				objUserPassword.value,
				""
				).value

	if (strResult !="")
	{
		if (strResult=="Reload")
		{
			location.reload();
		}
		else
		{
			if (strResult.substring(0,4)=="[成功]")
			{
				// location.href = "/RUC/desktop.aspx";
				// location.href = "/RUC/desktop.aspx";
				bindLoginBar();
			}
			else
			{
				alert(strResult);
			}
		}
	}
}

function PUserLogout()
{
		Pet67.Web.AppServices.InterFaceServices.Logout();
		bindLoginBar();
}



// 用户帐号是否存在检查
function IsExist(strUserID)
{
	var strUid = document.getElementById(strUserID).value;
	if (strUid.length<4 || strUid.length>20)
	{
		alert("用户名长度为4～20个字符！！");
		return;
	}
	
	var strValue = Pet67.Blog.PCenter.PUserServices.IsExist(strUid).value;
	if (strValue=="0")
	{
		alert("有创意！这个名字居然还没被占用！！");
	}
	else
	{
		alert("抱歉，这个名字已经被占用！！");
	}
}

function AddFav(p_strNumKey, p_strTitle, p_strClassName)
{
		var strSiteUrl = this.location.href;
		var strResult = Pet67.Blog.PCenter.PUserServices.AddFav(p_strNumKey, p_strTitle, p_strClassName, strSiteUrl).value
		if (strResult !="")
		{
			alert(strResult);
		}
}