//document.write("<link id=\"flow_def\" href=\"http://www.myliving.cn/js/dialog/themes/default.css\" rel=\"stylesheet\" type=\"text/css\" ></link>");
//document.write("<link id=\"flow_alp\" href=\"http://www.myliving.cn/js/dialog/themes/alphacube.css\" rel=\"stylesheet\" type=\"text/css\" ></link>");
var myUser=new Object();
myUser.callbackFunName="";
myUser.nick="";
myUser.favcolopwin=false;
myUser.funparams=new Array();

myUser.initial=function()
{
var JsFilePath,JsFileCon;
var funval=typeof(ConGroupDateValidate);
	if (funval.toUpperCase()!="FUNCTION")
	{
	JsFilePath="http://www.myliving.cn/js/DataValidateCon.js";
	document.write("<SCRIPT language=\"JavaScript\" src=\""+JsFilePath.toString()+"\" type=\"text/JavaScript\"><\/SCRIPT>"+"\n")
	}
var funval=typeof(flowDialog);
	if (funval.toUpperCase()!="OBJECT")
	{
	JsFilePath="http://www.myliving.cn/js/FlowDialogCon.js";
	document.write("<SCRIPT language=\"JavaScript\" src=\""+JsFilePath.toString()+"\" type=\"text/JavaScript\"><\/SCRIPT>"+"\n")
	}
var funval=typeof(DoXmlHttpSend);
	if (funval.toUpperCase()!="FUNCTION")
	{
	JsFilePath="http://www.myliving.cn/js/DateHttpSendCon.js";
	document.write("<SCRIPT language=\"JavaScript\" src=\""+JsFilePath.toString()+"\" type=\"text/JavaScript\"><\/SCRIPT>"+"\n")
	}
var funval=typeof(Cookie);
	if (funval.toUpperCase()!="OBJECT")
	{
	JsFilePath="http://www.myliving.cn/js/CookieSetCon.js";
	document.write("<SCRIPT language=\"JavaScript\" src=\""+JsFilePath.toString()+"\" type=\"text/JavaScript\"><\/SCRIPT>"+"\n")
	}
var funval=typeof(UserInfoDataBinder);
	if (funval.toUpperCase()!="FUNCTION")
	{
	JsFilePath="http://www.myliving.cn/js/UserInfoDataBinder.php";
	//document.write("<SCRIPT language=\"JavaScript\" src=\""+JsFilePath.toString()+"\" type=\"text/JavaScript\" DEFER><\/SCRIPT>"+"\n")
	}
}

myUser.initial();

myUser.isReg=function()
{
var result=false;
Cookie.name="member_personal";
Cookie.type='FREE';
result=Cookie.hasCookie();
	if (result)
	{
		if (Cookie.getItemValue("ID")!="")
		{
		result=true;
		}
		else
		{
		result=false;
		}
	}
return result;
}

myUser.isLogin=function()
{
var result=false;
result=this.isReg();
	if (result)
	{
	Cookie.name="member_personallog";
	Cookie.type='FREE';
	result=Cookie.hasCookie();
		if (result)
		{
			if (Cookie.getItemValue("log")=="true")
			{
			result=true;
			}
			else
			{
			result=false;
			}
		}
	}
return result;
}

myUser.getInfo=function()
{
	if (this.isReg())
	{
	this.nick=Cookie.getItemValue("nick");
	}
}

myUser.logout=function()
{
	//if (this.isReg())
	//{
	var SendUrl;
	SendUrl="http://www.myliving.cn/members/memlogout.php";
	result=DoXmlHttpSend(SendUrl,"post","SetLogoutState");
		if (result<1)
		{
		//alert("注销中遇到问题！请稍后试！");
		}
	//}
}

function SetLogoutStateComplete(Ele)
{
var SendResult=0;
	if (Ele.status==200)
	{
		if (Ele.responseText)
		{
		SendResult=Ele.responseText;
		}
	}
	if (SendResult==1)
	{
	window.location.reload();
	}
return SendResult;
}

myUser.messageOpe=function()
{
var _isReg=this.isReg();
var _commandName="LogAndReg";
this.callbackFunName="callBackFun_message";
	if (!_isReg)
	{
	flowDialog.Open(_commandName);
	}
	else
	{
	this.callbackOpe();
	}
}

myUser.activityOpe=function()
{
var _isReg=this.isReg();
var _commandName="LogAndReg";
this.callbackFunName="callBackFun_activity";
	if (!_isReg)
	{
	flowDialog.Open(_commandName);
	}
	else
	{
	this.callbackOpe();
	}
}

myUser.communicationOpe=function()
{
var _isReg=this.isReg();
var _commandName="LogAndReg";
this.callbackFunName="callBackFun_communication";
	if (!_isReg)
	{
	flowDialog.Open(_commandName);
	}
	else
	{
	this.callbackOpe();
	}
}

function callBackFun_communication()
{
var _isReg=myUser.isReg();
	if (_isReg)
	{
	openwin(myUser.funparams[0],"sendmsg","700","400","yes");
	}
}

myUser.housegradingInitial=function()
{
	var ReSendFlag=0;
	var SendUrl;
	SendUrl="http://www.myliving.cn/members/lpgrading.php?&lpid="+myUser.funparams[0]+"&lplx="+myUser.funparams[1];
	ReSendFlag=DoXmlHttpSend(SendUrl,"post","SetHouseGradingInitState");
}

function SetHouseGradingInitStateComplete(Ele)
{
var SendResult=0;
	if (Ele.status==200)
	{
		if (Ele.responseText)
		{
		//SendResult=Ele.responseText;
		var containerobj=document.getElementById("grading_output");
		containerobj.innerHTML=Ele.responseText;
		//alert(grading_output.innerHTML);
		}
	}
return SendResult;
}

myUser.housegradingOpe=function()
{
var _isReg=this.isReg();
var _commandName="LogAndReg";
this.callbackFunName="callBackFun_housegrading";
	if (!_isReg)
	{
	flowDialog.Open(_commandName);
	}
	else
	{
	this.callbackOpe();
	}
}

function callBackFun_housegrading()
{
var _isReg=myUser.isReg();
	if (_isReg)
	{
		sendscore(myUser.funparams[0],myUser.funparams[1]);
		var funval=typeof(userState);
		if (funval.toUpperCase()=="OBJECT")
		{
			userState.Set();
		}
		//window.location.reload();
	}
}

myUser.favCollectOpe=function()
{
//favcolopwin=window.open('about:blank','favcol', 'height=570,width=480,toolbar=no,location=no,status=yes,menubar=no');
//window.focus();
var _isReg=this.isReg();
var _commandName="LogAndReg";
this.callbackFunName="callBackFun_favCollect";
	if (!_isReg)
	{
	flowDialog.Open(_commandName);
	}
	else
	{
	this.callbackOpe();
	}
}

function callBackFun_favCollect()
{
var linkID,link,hidID,hid;
linkID='favlink';
link=linkID.IsElement();
	if (link)
	{
	hidID='favhid';
	hid=hidID.IsElement();
		if (hid)
		{
		link.href=hid.value;
		//this.favcolopwin=showModalDialog('about:blank', 'favcol', "dialogWidth:480px; dialogHeight:570px; status:1; help:0");
		this.favcolopwin=window.open('about:blank','favcol', 'height=570,width=480,toolbar=no,location=no,status=yes,menubar=no');
		link.click();
		}
	}
//this.favcolopwin.location.reload();
//this.favcolopwin.focus();
}

myUser.chattingOpe=function()
{
var _isReg=this.isReg();
var _commandName="LogAndReg";
this.callbackFunName="callBackFun_chatting";
	if (!_isReg)
	{
	flowDialog.Open(_commandName);
	}
	else
	{
	this.callbackOpe();
	}
}

myUser.callbackOpe=function()
{
//alert(this.callbackFunName.toString());
flowDialog.Close();
eval("if (typeof("+this.callbackFunName.toString()+")==\"function\"){"+this.callbackFunName.toString()+"();}");
}
