
/*
-- ------ CommShare ------ --
*/
function CommShare(){}
//-- ------ #Parameters ------ --
CommShare.prototype.sName="";
CommShare.prototype.sAjax_0=new netsSingleAjax();

CommShare.prototype.sShareButtonURL="Plus/Common/Comm/Data_Sharebutton.php";


//-- ------ #Methods ------ --

CommShare.prototype.OnShareButtonShow=function(pControl,pName,pURL,pType){
	if(pType==0){
		document.getElementById(pControl).className="MBlog_Home_74";
		
		var tmpURL=tmpCommon.sysRoot+this.sShareButtonURL+"?ActionType=DShareButton&DShareButton="+
			pControl+tmpCommon.sysSPLIT1+
			tmpCommon.encodeURL(pName,1)+tmpCommon.sysSPLIT1+
			tmpCommon.encodeURL(pURL,1);
		
		this.sAjax_0.sFlag="Data";
		this.sAjax_0.sPanel=pControl;
		this.sAjax_0.sURL=tmpURL;
		this.sAjax_0.sendRequestSp(tmpURL,"commShare_ShareButtonShow_Callback();");
		//window.open(tmpURL,"_blank");

	}else{
		document.getElementById(pControl).className=tmpCommon.sysHidden;
		document.getElementById(pControl).innerHTML="";
	}
	
	return 0;
}
function commShare_ShareButtonShow_Callback(){
	var tmpFlag=tmpCommShare.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpCommShare.sAjax_0.sPanel);
	var tmpURL=tmpCommShare.sAjax_0.sURL;
	var tmpHttpRequests=tmpCommShare.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;
	}
}


/*
-- ------ MBPublish ------ --
*/
function MBPublish(){}
//-- ------ #Parameters ------ --
MBPublish.prototype.sName="";
MBPublish.prototype.sAjax_0=new netsSingleAjax();
var tmpMBPublish_Ajax_0=new netsSingleAjax();

MBPublish.prototype.sLinkRequestURL="Plus/Common/Comm/Data_Link.php";
MBPublish.prototype.sSpeakRequestURL="Plus/Common/Comm/Data_Speak.php";

MBPublish.prototype.sDetailContent="请在这里输入您想说的。。。";
MBPublish.prototype.sBoxcount=5;


//-- ------ #Methods ------ --

MBPublish.prototype.Focus=function(){
	document.getElementById(this.sName+"_Content").className="MBlog_Pub_0_6_B";
	if(document.getElementById(this.sName+"_Content").value==this.sDetailContent){
		document.getElementById(this.sName+"_Content").value="";
	}
	
	return 0;
}
MBPublish.prototype.Blur=function(){
	if(document.getElementById(this.sName+"_Content").value==""){
		document.getElementById(this.sName+"_Content").value=this.sDetailContent;
		document.getElementById(this.sName+"_Content").className="MBlog_Pub_0_6";
	}
	
	return 0;
}
MBPublish.prototype.SetTextcount=function(){
	tmpINT=parseInt(document.getElementById(this.sName+"_Textlimit").value)-document.getElementById(this.sName+"_Content").value.length;
	document.getElementById(this.sName+"_Textcount").innerHTML=tmpINT;
	
	return 0;
}
MBPublish.prototype.Showbox=function(pIndex){
	var Coun0=0;
	while(this.sBoxcount>Coun0){
		document.getElementById(this.sName+"_Button_"+Coun0).className="MBlog_Pub_0_8";
		document.getElementById(this.sName+"_Box_"+Coun0).className=tmpCommon.sysHidden;
		Coun0++;
	}
	
	document.getElementById(this.sName+"_Button_"+pIndex).className="MBlog_Pub_0_8_A";
	document.getElementById(this.sName+"_Box_"+pIndex).className="MBlog_Pub_0_21";
	return 0;
}
MBPublish.prototype.Hiddenbox=function(){
	var Coun0=0;
	while(this.sBoxcount>Coun0){
		document.getElementById(this.sName+"_Button_"+Coun0).className="MBlog_Pub_0_8";
		document.getElementById(this.sName+"_Box_"+Coun0).className=tmpCommon.sysHidden;
		Coun0++;
	}
	
	return 0;
}

MBPublish.prototype.OnChoose=function(pName,pPIndex,pIndex,pValue){
	document.getElementById(pName+"_Box_"+pPIndex+"_"+pIndex+"_Value").value=pValue;
	
	return 0;
}


MBPublish.prototype.ShowChildbox=function(pPIndex,pIndex){
	var Coun0=0;
	tmpElement=document.getElementById(this.sName+"_Button_"+pPIndex+"_"+Coun0);
	while(tmpElement!=undefined){
		document.getElementById(this.sName+"_Button_"+pPIndex+"_"+Coun0).className="MBlog_Pub_0_26";
		document.getElementById(this.sName+"_Box_"+pPIndex+"_"+Coun0).className=tmpCommon.sysHidden;
		
		Coun0++;
		tmpElement=document.getElementById(this.sName+"_Button_"+pPIndex+"_"+Coun0);
	}
	
	document.getElementById(this.sName+"_Button_"+pPIndex+"_"+pIndex).className="MBlog_Pub_0_27";
	document.getElementById(this.sName+"_Box_"+pPIndex+"_"+pIndex).className="MBlog_Pub_0_28";
	document.getElementById(this.sName+"_Box_"+pPIndex+"_BoxIndex").value=pIndex;
	//-- ------ #Set value ------ --
	tmpFlag=0;
	if(pPIndex==0){
		if(pIndex==0){
			document.getElementById(this.sName+"_Box_"+pPIndex+"_"+pIndex+"_Upload").src="../../../Component/Nets/netsFile/FileSimple.php?RControl="+(this.sName+"_Box_"+pPIndex+"_"+pIndex+"_Value")+"&UDirectory=m_temp/&UType=0";
		}else if(pIndex==1){
			document.getElementById(this.sName+"_Box_"+pPIndex+"_"+pIndex+"_Upload").src="../../../Component/Nets/netsFile/FileSimple.php?RControl="+(this.sName+"_Box_"+pPIndex+"_"+pIndex+"_Value")+"&UDirectory=m_temp/&UType=1";
		}else if(pIndex==2){
			tmpFlag=1;
			tmpURL=tmpCommon.sysRoot+this.sLinkRequestURL+"?ActionType=DLinkSearch&DLinkSearch="+
				this.sName+tmpCommon.sysSPLIT1+
				pPIndex+tmpCommon.sysSPLIT1+
				pIndex+tmpCommon.sysSPLIT1+
				""+tmpCommon.sysSPLIT1+
				5+tmpCommon.sysSPLIT1+
				0+tmpCommon.sysSPLIT1+1;
		}
	}else if(pPIndex==1){
		if(pIndex==2){
			tmpFlag=1;
			tmpURL=tmpCommon.sysRoot+this.sLinkRequestURL+"?ActionType=DLinkSearch&DLinkSearch="+
				this.sName+tmpCommon.sysSPLIT1+
				pPIndex+tmpCommon.sysSPLIT1+
				pIndex+tmpCommon.sysSPLIT1+
				""+tmpCommon.sysSPLIT1+
				6+tmpCommon.sysSPLIT1+
				0+tmpCommon.sysSPLIT1+0;
		}
	}else if(pPIndex==2){
		if(pIndex==2){
			tmpFlag=1;
			tmpURL=tmpCommon.sysRoot+this.sLinkRequestURL+"?ActionType=DLinkSearch&DLinkSearch="+
				this.sName+tmpCommon.sysSPLIT1+
				pPIndex+tmpCommon.sysSPLIT1+
				pIndex+tmpCommon.sysSPLIT1+
				""+tmpCommon.sysSPLIT1+
				7+tmpCommon.sysSPLIT1+
				0+tmpCommon.sysSPLIT1+0;
		}
	}else if(pPIndex==3){
		tmpFlag=1;
		if(pIndex==0){
			tmpURL=tmpCommon.sysRoot+this.sLinkRequestURL+"?ActionType=DLinkSearch&DLinkSearch="+
				this.sName+tmpCommon.sysSPLIT1+
				pPIndex+tmpCommon.sysSPLIT1+
				pIndex+tmpCommon.sysSPLIT1+
				""+tmpCommon.sysSPLIT1+
				9+tmpCommon.sysSPLIT1+
				0+tmpCommon.sysSPLIT1+2;
		}else if(pIndex==1){
			tmpURL=tmpCommon.sysRoot+this.sLinkRequestURL+"?ActionType=DLinkSearch&DLinkSearch="+
				this.sName+tmpCommon.sysSPLIT1+
				pPIndex+tmpCommon.sysSPLIT1+
				pIndex+tmpCommon.sysSPLIT1+
				""+tmpCommon.sysSPLIT1+
				10+tmpCommon.sysSPLIT1+
				0+tmpCommon.sysSPLIT1+2;
		}else if(pIndex==2){
			tmpURL=tmpCommon.sysRoot+this.sLinkRequestURL+"?ActionType=DLinkSearch&DLinkSearch="+
				this.sName+tmpCommon.sysSPLIT1+
				pPIndex+tmpCommon.sysSPLIT1+
				pIndex+tmpCommon.sysSPLIT1+
				""+tmpCommon.sysSPLIT1+
				11+tmpCommon.sysSPLIT1+
				0+tmpCommon.sysSPLIT1+2;
		}
	}else if(pPIndex==4){
		tmpFlag=1;
		if(pIndex==0){
			tmpURL=tmpCommon.sysRoot+this.sSpeakRequestURL+"?ActionType=DSpeakSearch&DSpeakSearch="+
				this.sName+tmpCommon.sysSPLIT1+
				pPIndex+tmpCommon.sysSPLIT1+
				pIndex+tmpCommon.sysSPLIT1+
				""+tmpCommon.sysSPLIT1+
				0+tmpCommon.sysSPLIT1+
				0+tmpCommon.sysSPLIT1+1;
		}else if(pIndex==1){
			tmpURL=tmpCommon.sysRoot+this.sSpeakRequestURL+"?ActionType=DSpeakSearch&DSpeakSearch="+
				this.sName+tmpCommon.sysSPLIT1+
				pPIndex+tmpCommon.sysSPLIT1+
				pIndex+tmpCommon.sysSPLIT1+
				""+tmpCommon.sysSPLIT1+
				0+tmpCommon.sysSPLIT1+
				1+tmpCommon.sysSPLIT1+1;

		}
	}
	//-- #REQUEST --
	if(tmpFlag==1){
		tmpMBPublish_Ajax_0.sFlag="Data";
		tmpMBPublish_Ajax_0.sPanel=this.sName+"_Box_"+pPIndex+"_"+pIndex;
		tmpMBPublish_Ajax_0.sURL=tmpURL;
		tmpMBPublish_Ajax_0.sendRequestSp(tmpURL,"mbpublish_panel_Callback();");
		//window.open(tmpURL,"_blank");
	}
	
	return 0;
}
function mbpublish_panel_Callback(){
	var tmpFlag=tmpMBPublish_Ajax_0.sFlag;
	var tmpPanel=document.getElementById(tmpMBPublish_Ajax_0.sPanel);
	var tmpURL=tmpMBPublish_Ajax_0.sURL;
	var tmpHttpRequests=tmpMBPublish_Ajax_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;
	}
}



/*
-- ------ MBDiscussSubmit ------ --
*/
function MBDiscussSubmit(){}
//-- ------ #Parameters ------ --
MBDiscussSubmit.prototype.sName="";
MBDiscussSubmit.prototype.sAjax_0=new netsSingleAjax();
var tmpMBDiscussSubmit_Ajax_0=new netsSingleAjax();
MBDiscussSubmit.prototype.sFaceBoxcount=2;

MBDiscussSubmit.prototype.sFaceURL="Plus/Common/Comm/Data_Microblogging_Icon_Face.php";
MBDiscussSubmit.prototype.sAddURL="Plus/m_default/Comm/microbloggingDetail.php";

//-- ------ #Methods ------ --


MBDiscussSubmit.prototype.ShowFace=function(){
	document.getElementById(this.sName+"_Facebox").className="MBlog_Pub_0_46";
	
	var tmpURL=tmpCommon.sysRoot+this.sFaceURL+"?ActionType=DFaceSearch&DFaceSearch="+this.sName;
	tmpMBDiscussSubmit_Ajax_0.sFlag="Data";
	tmpMBDiscussSubmit_Ajax_0.sPanel=this.sName+"_Facebox";
	tmpMBDiscussSubmit_Ajax_0.sURL=tmpURL;
	tmpMBDiscussSubmit_Ajax_0.sendRequestSp(tmpURL,"mbdiscussSubmit_Face_Callback();");
	//window.open(tmpURL,"_blank");

	return 0;
}
function mbdiscussSubmit_Face_Callback(){
	var tmpFlag=tmpMBDiscussSubmit_Ajax_0.sFlag;
	var tmpPanel=document.getElementById(tmpMBDiscussSubmit_Ajax_0.sPanel);
	var tmpURL=tmpMBDiscussSubmit_Ajax_0.sURL;
	var tmpHttpRequests=tmpMBDiscussSubmit_Ajax_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;
	}
}

MBDiscussSubmit.prototype.HiddenFace=function(){
	document.getElementById(this.sName+"_Facebox").className=tmpCommon.sysHidden;
	document.getElementById(this.sName+"_Facebox").innerHTML="";
	
	return 0;
}
MBDiscussSubmit.prototype.TabFace=function(pIndex){
	var Coun0=0;
	while(this.sFaceBoxcount>Coun0){
		document.getElementById(this.sName+"_FaceButton_"+Coun0).className="MBlog_Pub_0_49";
		document.getElementById(this.sName+"_FaceBox_"+Coun0).className=tmpCommon.sysHidden;
		Coun0++;
	}
	
	document.getElementById(this.sName+"_FaceButton_"+pIndex).className="MBlog_Pub_0_48";
	document.getElementById(this.sName+"_FaceBox_"+pIndex).className="MBlog_Pub_0_50";
	return 0;
}
MBDiscussSubmit.prototype.ChooseFace=function(pImage){
	document.getElementById(this.sName+"_Img").src=pImage;
	document.getElementById(this.sName+"_ImgValue").value=pImage;
	
	return 0;
}
MBDiscussSubmit.prototype.OnAdd=function(){
	var tmpControl="";
	var tmpError="";
	var tmpChecker=new netsChecker();
	var Coun0=0;
	//-- ------ #Check ------ --
	//#_Content
	tmpCheckCont=document.getElementById(this.sName+"_Content");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(!tmpChecker.CheckLen(tmpCheckCont.value,1,900)){
		Coun0++;
		tmpError+=Coun0+".回复的内容不能为空"+tmpCommon.sysSPLIT8;
	}
	//#_Parid
	tmpCheckCont=document.getElementById(this.sName+"_Parid");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value==0 || tmpCheckCont.value==""){
		Coun0++;
		tmpError+=Coun0+".本微博不能回复"+tmpCommon.sysSPLIT8;
	}
	//-- ------ #Result ------ --
	if(tmpError!=""){
		tmpSTR="<span class=\"FStrong\">对不起，您提交的内容存在以下错误:</span>"+tmpCommon.sysSPLIT8+tmpError;
		tmpFrames.showMessage("系统消息",tmpSTR,"",0);
		return 1;
	}
	//-- ------ #REQUEST ------ --
	var tmpURL=tmpCommon.sysRoot+this.sAddURL+"?ActionType=DAdd_Get&DAdd_Get="+
		tmpCommon.encodeURL(document.getElementById(this.sName+"_Content").value,0)+tmpCommon.sysSPLIT1+
		tmpCommon.encodeURL(document.getElementById(this.sName+"_Parid").value,0)+tmpCommon.sysSPLIT1+
		tmpCommon.encodeURL(document.getElementById(this.sName+"_CreateBy").value,0)+tmpCommon.sysSPLIT1+
		tmpCommon.encodeURL(document.getElementById(this.sName+"_Publisher_Name").value,0)+tmpCommon.sysSPLIT1+
		tmpCommon.encodeURL(document.getElementById(this.sName+"_ImgValue").value,0);

	tmpMBDiscussSubmit_Ajax_0.sFlag="Message";
	tmpMBDiscussSubmit_Ajax_0.sPanel="";
	tmpMBDiscussSubmit_Ajax_0.sURL=tmpURL;
	tmpMBDiscussSubmit_Ajax_0.sendRequestSp(tmpURL,"mbdiscussSubmit_Add_Callback();");
	//window.open(tmpURL,"_blank");
	tmpFrames.showMessage("系统消息","正在为您保存数据，请稍等...","",0);
	document.getElementById(this.sName+"_Content").value="";

	return 0;
}
function mbdiscussSubmit_Add_Callback(){
	var tmpFlag=tmpMBDiscussSubmit_Ajax_0.sFlag;
	var tmpPanel=document.getElementById(tmpMBDiscussSubmit_Ajax_0.sPanel);
	var tmpURL=tmpMBDiscussSubmit_Ajax_0.sURL;
	var tmpHttpRequests=tmpMBDiscussSubmit_Ajax_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);
				tmpMicroblogging.ListDiscussTab(tmpAR0[1],0);
				
			}
	    	tmpFrames.showLoading(1);
	    }else{
	    	tmpFrames.showLoading(1);
	    }
	}else{
		tmpFrames.showLoading(0);
	}
}

