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

Community.prototype.sAjax_0=new netsSingleAjax();

//-- ------ #Methods ------ --
//#Home slide
Community.prototype.sHomeslideCount=3;
Community.prototype.homeslideShow=function(pIndex){
	var Coun0=0;
	while(Coun0<this.sHomeslideCount){
		document.getElementById("homeSlideBox_"+Coun0).className=tmpCommon.sysHidden;
		document.getElementById("homeSlideBut_"+Coun0).className="MBlog_Home_0_4";
		Coun0++;
	}
	
	document.getElementById("homeSlideBox_"+pIndex).className="MBlog_Home_0_1";
	document.getElementById("homeSlideBut_"+pIndex).className="MBlog_Home_0_3";
	return 0;
}
Community.prototype.OnPositive=function(pID){

	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="microbloggingList_"+pID+"_Positive";
	var tmpURL=tmpCommon.sysRoot+"Plus/m_default/Comm/microbloggingDetail.php?ActionType=DPositive&ID="+pID;
	this.sAjax_0.sendRequestSp(tmpURL,"community_OnCode_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
Community.prototype.OnNegative=function(pID){

	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="microbloggingList_"+pID+"_Negative";
	var tmpURL=tmpCommon.sysRoot+"Plus/m_default/Comm/microbloggingDetail.php?ActionType=DNegative&ID="+pID;
	this.sAjax_0.sendRequestSp(tmpURL,"community_OnCode_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
function community_OnCode_callback(){
	var tmpSPLIT="_";
	var tmpCoun0=0;
	var tmpURL=tmpCommunity.sAjax_0.sURL;
	var tmpPanel=document.getElementById(tmpCommunity.sAjax_0.sPanel);
	var tmpHttpRequest=tmpCommunity.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequest.responseText);
	if(tmpHttpRequest.readyState==4){
		//alert(tmpHttpRequest.responseText);
		var tmpData=getDataByFlag(tmpHttpRequest.responseText,tmpCommunity.sAjax_0.sFlag);
		if(tmpData.indexOf("sendRequest")>=0 && tmpData!="<!--sendRequest-->"){
			//alert(tmpData);
			var tmpAR0=tmpData.split(tmpCommon.sysSPLIT1);
			tmpFrames.showMessage("投票",tmpAR0[0],"",0);
			if(tmpAR0.length>1){
				tmpPanel.innerHTML=tmpAR0[1];
			}
			
			tmpFrames.showLoading(1);
		}else{
			tmpPanel.innerHTML=tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL);
			tmpFrames.showLoading(1);
		}
	}else{
		tmpFrames.showLoading(0);
	}
}
Community.prototype.ShowListDiscuss=function(pID){

	this.sAjax_0.sFlag="discussBox";
	this.sAjax_0.sPanel="microbloggingList_"+pID+"_Discuss";
	var tmpURL=tmpCommon.sysRoot+"Plus/m_default/Comm/microbloggingDetail.php?ID="+pID;
	this.sAjax_0.sendRequestSp(tmpURL,"community_ShowListDiscuss_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
function community_ShowListDiscuss_callback(){
	var tmpSPLIT="_";
	var tmpCoun0=0;
	var tmpURL=tmpCommunity.sAjax_0.sURL;
	var tmpPanel=document.getElementById(tmpCommunity.sAjax_0.sPanel);
	var tmpHttpRequest=tmpCommunity.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequest.responseText);
	if(tmpHttpRequest.readyState==4){
		//alert(tmpHttpRequest.responseText);
		var tmpData=getDataByFlag(tmpHttpRequest.responseText,tmpCommunity.sAjax_0.sFlag);
		if(tmpData.indexOf("sendRequest")>=0 && tmpData!="<!--sendRequest-->"){
			//alert(tmpData);
			tmpPanel.className="MBlog_Detail_0_20";
			tmpPanel.innerHTML=tmpData;

			tmpFrames.showLoading(1);
		}else{
			tmpPanel.innerHTML=tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL);
			tmpFrames.showLoading(1);
		}
	}else{
		tmpFrames.showLoading(0);
	}
}
//-- #Posts vote --
Community.prototype.OnPositive_Posts=function(pID){

	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="postsDetail_"+pID+"_Positive";
	var tmpURL=tmpCommon.sysRoot+"Plus/m_default/Comm/postsDetail.php?ActionType=DPositive&ID="+pID;
	this.sAjax_0.sendRequestSp(tmpURL,"community_OnCode_Posts_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
Community.prototype.OnNegative_Posts=function(pID){

	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="postsDetail_"+pID+"_Negative";
	var tmpURL=tmpCommon.sysRoot+"Plus/m_default/Comm/postsDetail.php?ActionType=DNegative&ID="+pID;
	this.sAjax_0.sendRequestSp(tmpURL,"community_OnCode_Posts_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
function community_OnCode_Posts_callback(){
	var tmpSPLIT="_";
	var tmpCoun0=0;
	var tmpURL=tmpCommunity.sAjax_0.sURL;
	var tmpPanel=document.getElementById(tmpCommunity.sAjax_0.sPanel);
	var tmpHttpRequest=tmpCommunity.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequest.responseText);
	if(tmpHttpRequest.readyState==4){
		//alert(tmpHttpRequest.responseText);
		var tmpData=getDataByFlag(tmpHttpRequest.responseText,tmpCommunity.sAjax_0.sFlag);
		if(tmpData.indexOf("sendRequest")>=0 && tmpData!="<!--sendRequest-->"){
			//alert(tmpData);
			var tmpAR0=tmpData.split(tmpCommon.sysSPLIT1);
			tmpFrames.showMessage("投票",tmpAR0[0],"",0);
			if(tmpAR0.length>1){
				tmpPanel.innerHTML=tmpAR0[1];
			}
			
			tmpFrames.showLoading(1);
		}else{
			tmpPanel.innerHTML=tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL);
			tmpFrames.showLoading(1);
		}
	}else{
		tmpFrames.showLoading(0);
	}
}


