
/*
-- ------ Main ------ --
*/
function Ask(){}
//-- ------ #Parameters ------ --

Ask.prototype.sAjax_0=new netsSingleAjax();

//-- ------ #Methods ------ --
//#Home
Ask.prototype.sHomeSlideCount=3;
Ask.prototype.OnHomeSlide=function(pIndex){
	var Coun0=0;
	while(this.sHomeSlideCount>Coun0){
		document.getElementById("mainSlide_Box_"+Coun0).className=tmpCommon.sysHidden;
		document.getElementById("mainSlide_Button_"+Coun0).className="AskH_0_8_B";
		Coun0++;
	}
	
	document.getElementById("mainSlide_Box_"+pIndex).className="AskH_0_1";
	document.getElementById("mainSlide_Button_"+pIndex).className="AskH_0_8_A";
	return 0;
}
//#Code
Ask.prototype.OnPositive=function(pID){
	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="askDetail_"+pID+"_Positive";
	var tmpURL=tmpCommon.sysRoot+"Plus/m_default/Cms/askDetail.php?ActionType=DPositive&ID="+pID;
	this.sAjax_0.sendRequestSp(tmpURL,"askDetail_OnCode_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
Ask.prototype.OnNegative=function(pID){
	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="askDetail_"+pID+"_Negative";
	var tmpURL=tmpCommon.sysRoot+"Plus/m_default/Cms/askDetail.php?ActionType=DNegative&ID="+pID;
	this.sAjax_0.sendRequestSp(tmpURL,"askDetail_OnCode_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
function askDetail_OnCode_callback(){
	var tmpSPLIT="_";
	var tmpCoun0=0;
	var tmpURL=tmpAsk.sAjax_0.sURL;
	var tmpPanel=document.getElementById(tmpAsk.sAjax_0.sPanel);
	var tmpHttpRequest=tmpAsk.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequest.responseText);
	if(tmpHttpRequest.readyState==4){
		//alert(tmpHttpRequest.responseText);
		var tmpData=getDataByFlag(tmpHttpRequest.responseText,tmpAsk.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);
	}
}

//#Code_Discuss
Ask.prototype.OnPositive_Discuss=function(pID,pDID){
	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="askDiscuss_"+pID+"_"+pDID+"_Positive";
	var tmpURL=tmpCommon.sysRoot+"Plus/m_default/Cms/askDetail.php?ActionType=DPositive_Discuss&DPositive_Discuss="+pDID+"&ID="+pID;
	this.sAjax_0.sendRequestSp(tmpURL,"askDiscuss_OnCode_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
Ask.prototype.OnNegative_Discuss=function(pID,pDID){
	this.sAjax_0.sFlag="Message";
	this.sAjax_0.sPanel="askDiscuss_"+pID+"_"+pDID+"_Negative";
	var tmpURL=tmpCommon.sysRoot+"Plus/m_default/Cms/askDetail.php?ActionType=DNegative_Discuss&DNegative_Discuss="+pDID+"&ID="+pID;
	this.sAjax_0.sendRequestSp(tmpURL,"askDiscuss_OnCode_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
function askDiscuss_OnCode_callback(){
	var tmpSPLIT="_";
	var tmpCoun0=0;
	var tmpURL=tmpAsk.sAjax_0.sURL;
	var tmpPanel=document.getElementById(tmpAsk.sAjax_0.sPanel);
	var tmpHttpRequest=tmpAsk.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequest.responseText);
	if(tmpHttpRequest.readyState==4){
		//alert(tmpHttpRequest.responseText);
		var tmpData=getDataByFlag(tmpHttpRequest.responseText,tmpAsk.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);
	}
}





