

/*
-- ------ Microblogging ------ --
*/
function Microblogging(){}
//-- ------ #Parameters ------ --

Microblogging.prototype.sAjax_0=new netsSingleAjax();
Microblogging.prototype.sDiscussURL="Plus/m_default/Comm/microbloggingDetail.php";
Microblogging.prototype.sContactURL="Plus/Common/Oa/contact.php";
Microblogging.prototype.sListURL="Plus/m_default/Comm/microbloggingList.php";



//-- ------ #Methods ------ --
//#Navigation
Microblogging.prototype.sNavigationCount=6;
Microblogging.prototype.OnNavigation=function(pIndex){
	var Coun0=0;
	while(Coun0<this.sNavigationCount){
		document.getElementById("MainNavigation_"+Coun0).className="MBlog_Head_6";
		Coun0++;
	}
	
	document.getElementById("MainNavigation_"+pIndex).className="MBlog_Head_5";
	return 0;
}
//#Search

Microblogging.prototype.OnSearch=function(pContent,pType,pSpeakWord,pFriend,pCreateTime){
	var tmpURL=tmpCommon.sysRoot+this.sListURL+"?DSearch="+
		tmpCommon.encodeURL(pContent,0)+tmpCommon.sysSPLIT1+
		pType+tmpCommon.sysSPLIT1+
		tmpCommon.encodeURL(pSpeakWord,0)+tmpCommon.sysSPLIT1+
		pFriend+tmpCommon.sysSPLIT1+
		pCreateTime;
	//window.location=tmpURL;
	
	return 0;
}
//#List Discuss
Microblogging.prototype.sDiscussTabCount=3;
Microblogging.prototype.ListDiscussShow=function(pID){
	document.getElementById("mainRow_"+pID).className="MBlog_List_0_24";
	this.ListDiscussTab(pID,0);
	
	return 0;
}

Microblogging.prototype.ListDiscussTab=function(pID,pIndex){
	var Coun0=0;
	while(this.sDiscussTabCount>Coun0){
		document.getElementById("mainRow_"+pID+"_Button_"+Coun0).className="MBlog_List_0_31";
		
		Coun0++;
	}
	document.getElementById("mainRow_"+pID+"_Button_"+pIndex).className="MBlog_List_0_30";
	document.getElementById("discussBox_"+pID).className="MBlog_List_0_32";
	document.getElementById("discussBox_"+pID).innerHTML="";
	
	tmpURL=tmpCommon.sysRoot+this.sDiscussURL+"?ID="+pID+"&DType="+pIndex;
	this.sAjax_0.sFlag="discussBox";
	this.sAjax_0.sPanel="discussBox_"+pID;
	this.sAjax_0.sURL=tmpURL;
	this.sAjax_0.sendRequestSp(tmpURL,"microblogging_ListDiscussTab_Callback();");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
Microblogging.prototype.DetailDiscussTab=function(pID,pIndex){
	var Coun0=0;
	while(this.sDiscussTabCount>Coun0){
		document.getElementById("mainRow_"+pID+"_Button_"+Coun0).className="MBlog_List_0_4";
		
		Coun0++;
	}
	document.getElementById("mainRow_"+pID+"_Button_"+pIndex).className="MBlog_List_0_3";
	document.getElementById("discussBox_"+pID).innerHTML="";
	
	tmpURL=tmpCommon.sysRoot+this.sDiscussURL+"?ID="+pID+"&DType="+pIndex;
	this.sAjax_0.sFlag="discussBox";
	this.sAjax_0.sPanel="discussBox_"+pID;
	this.sAjax_0.sURL=tmpURL;
	this.sAjax_0.sendRequestSp(tmpURL,"microblogging_ListDiscussTab_Callback();");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
function microblogging_ListDiscussTab_Callback(){
	var tmpFlag=tmpMicroblogging.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpMicroblogging.sAjax_0.sPanel);
	var tmpURL=tmpMicroblogging.sAjax_0.sURL;
	var tmpHttpRequests=tmpMicroblogging.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequests.responseText);
	if(tmpHttpRequests.readyState==4){
		//alert(tmpHttpRequests.responseText);
		var tmpData=getDataByFlag(tmpHttpRequests.responseText,tmpFlag);
		//alert(tmpData);
		if(tmpData.indexOf("sendRequest")>=0 && tmpData!="<!--sendRequest-->"){
			tmpPanel.innerHTML=tmpData;
	    	tmpFrames.showLoading(1);
	    }else{
	    	tmpPanel.innerHTML=tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL);
	    	tmpFrames.showLoading(1);
	    }
	}else{
		tmpFrames.showLoading(0);
		tmpPanel.innerHTML=tmpCommon.sysLoading_Ajax;
	}
}

//#Add contact
Microblogging.prototype.AddContact_Single=function(pUserid){

	tmpURL=tmpCommon.sysRoot+this.sContactURL+"?ActionType=DAdd_Get&DAdd_Get="+pUserid;
	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="";
	this.sAjax_0.sURL=tmpURL;
	this.sAjax_0.sendRequestSp(tmpURL,"microblogging_AddContact_Callback();");
	//window.open(tmpURL,"_blank");
	tmpFrames.showMessage("系统消息","正在为您保存数据，请稍等...","",0);
	
	return 0;
}
Microblogging.prototype.CancelContact_Single=function(pUserid){

	tmpURL=tmpCommon.sysRoot+this.sContactURL+"?ActionType=DCancel_Get&DCancel_Get="+pUserid;
	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="";
	this.sAjax_0.sURL=tmpURL;
	this.sAjax_0.sendRequestSp(tmpURL,"microblogging_AddContact_Callback();");
	//window.open(tmpURL,"_blank");
	tmpFrames.showMessage("系统消息","正在为您保存数据，请稍等...","",0);
	
	return 0;
}
function microblogging_AddContact_Callback(){
	var tmpFlag=tmpMicroblogging.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpMicroblogging.sAjax_0.sPanel);
	var tmpURL=tmpMicroblogging.sAjax_0.sURL;
	var tmpHttpRequests=tmpMicroblogging.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequests.responseText);
	if(tmpHttpRequests.readyState==4){
		//alert(tmpHttpRequests.responseText);
		var tmpData=getDataByFlag(tmpHttpRequests.responseText,tmpFlag);
		//alert(tmpData);
		if(tmpData.indexOf("sendRequest")>=0 && tmpData!="<!--sendRequest-->"){
			var tmpAR0=tmpData.replace(/\<!--sendRequest-->/g,"").split(tmpCommon.sysSPLIT1);
			if(tmpAR0.length==2){
				tmpFrames.showMessage("系统消息",tmpAR0[0],"",0);
				
			}
	    	tmpFrames.showLoading(1);
	    }else{
	    	tmpFrames.showLoading(1);
	    }
	}else{
		tmpFrames.showLoading(0);
	}
}



