

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

Schedule.prototype.sColumnActiveFlag=0;//0.Non,1.ADD,2.Modify,3.ModifyTime
Schedule.prototype.sColumnEditFlag=0;
Schedule.prototype.sColumnsIndex=0;
Schedule.prototype.sColumnsCount=0;
Schedule.prototype.sMaintipLock=0;

//-- #COLUMN --
Schedule.prototype.sColumn_ID=0;
Schedule.prototype.sColumn_StartIndex=0;
Schedule.prototype.sColumn_EndIndex=0;
Schedule.prototype.sColumn_Name="";
//-- #CONST --
Schedule.prototype.sContentbox="mainColumns";
Schedule.prototype.sColumnsbox="mainColumnBox";
Schedule.prototype.sProgressNew="mainProgress_New";
Schedule.prototype.sMouseTip="mainMouseTip";
Schedule.prototype.sColumnsTip="mainTip";
Schedule.prototype.sColumnTemplate="";
Schedule.prototype.sProgressTemplate="";
Schedule.prototype.sColumnboxHead=155;
Schedule.prototype.sColumnboxLeft=120;
Schedule.prototype.sColumnboxLeftBlank=12;
Schedule.prototype.sColumnWidth=60;
Schedule.prototype.sColumnHeight=17;
Schedule.prototype.sColumnStyles=new Array(
	"Schedule_Column_Orange",
	"Schedule_Column_Red",
	"Schedule_Column_Blue",
	"Schedule_Column_Yellow",
	"Schedule_Column_Green");
Schedule.prototype.sColumnStylesIndex=0;
Schedule.prototype.sMouseTipMessages=new Array(
	"请在时间轴上点击设置任务起始时间...",
	"请在时间轴上点击选择任务结束时间...");

//-- ------ #Methods ------ --
//-- #Search --
Schedule.prototype.OnSearch=function(pPage){
	var tmpURL=pPage+"?DSearch="+
		tmpCommon.encodeURL(document.getElementById("mainTimeTypeTxtSearch").value,0)+tmpCommon.sysSPLIT1+
		tmpCommon.encodeURL(document.getElementById("mainTimeStartTxtSearch").value,0)+tmpCommon.sysSPLIT1+
		tmpCommon.encodeURL(document.getElementById("mainTimeEndTxtSearch").value,0)+tmpCommon.sysSPLIT1+
		tmpCommon.encodeURL(document.getElementById("mainUseridTxtSearch").value,0);

	window.location=tmpURL;
	return 0;
}

//-- #Methods --
Schedule.prototype.OnAdd=function(pIndex,pID,pEvent){
	
	document.getElementById(this.sMouseTip+"_Label").innerHTML=this.sMouseTipMessages[0];
	this.ShowMouseTile(pEvent);
	this.sColumn_ID=pID;
	this.sColumnActiveFlag=1;
	return 0;
}
Schedule.prototype.OnModify=function(pIndex,pID,pEvent){
	var tmpAR0=document.getElementById(this.sContentbox).value.split(tmpCommon.sysSPLIT6);
	var tmpIndex=-1;
	var Coun0=0;
	while(tmpAR0.length>Coun0){
		tmpAR1=tmpAR0[Coun0].split(tmpCommon.sysSPLIT5);
		if(tmpAR1.length==5){
			if(tmpAR1[0]==pIndex){
				tmpIndex=Coun0;
			}
		}
		Coun0++;
	}
	Coun0=0;
	while(tmpAR0.length>Coun0){
		tmpAR1=tmpAR0[Coun0].split(tmpCommon.sysSPLIT5);
		if(tmpAR1.length==5){
			if(tmpAR1[1]==pID){
				tmpIndex=Coun0;
			}
		}
		Coun0++;
	}
	this.sMaintipLock=0;
	//-- ### --
	if(tmpIndex<0){
		//-- #ADD --
		if(pID!=0){
			document.getElementById("mainProgress_"+pID+"_Button0").innerHTML="安排";
			document.getElementById("mainProgress_"+pID+"_Button0").className="Link1 tile_Yellow";
		}
		document.getElementById(this.sMouseTip+"_Label").innerHTML=this.sMouseTipMessages[0];
		this.ShowMouseTile(pEvent);
		this.sColumn_ID=pID;
		this.sColumnActiveFlag=1;
	}else{
		//-- #Modify --
		//#Reset content
		tmpCONTENT="";
		Coun0=0;
		CounA=1;
		while(tmpAR0.length>Coun0){
			tmpAR1=tmpAR0[Coun0].split(tmpCommon.sysSPLIT5);
			if(tmpAR1.length==5 && Coun0!=tmpIndex){
				tmpCONTENT+=
					CounA+tmpCommon.sysSPLIT5+
					tmpAR1[1]+tmpCommon.sysSPLIT5+
					tmpAR1[2]+tmpCommon.sysSPLIT5+
					tmpAR1[3]+tmpCommon.sysSPLIT5+
					tmpAR1[4]+tmpCommon.sysSPLIT6;
					
				CounA++;
			}
			if(pID!=0){
				//#Send modify
				var tmpURL=tmpCommon.sysPage+"?ActionType=DModifyState&DModifyState="+pID;
				this.sAjax_0.sFlag="Data";
				this.sAjax_0.sPanel="Data";
				this.sAjax_0.sendRequestSp(tmpURL,"schedule_SendModify_callback()");
				//window.open(tmpURL,"_blank");
			}
			if(tmpAR1.length==5 && pID==0 && tmpAR1[0]==pIndex){
				document.getElementById("mainProgress_Index_"+pIndex).removeNode(true);
			}
			Coun0++;
		}
		document.getElementById(this.sColumnsbox).innerHTML="";
		document.getElementById(this.sContentbox).value=tmpCONTENT;
		this.HiddenTile();
		this.OnInitialColumns();
		
		if(pID!=0){
			document.getElementById("mainProgress_"+pID+"_Button0").innerHTML="安排";
			document.getElementById("mainProgress_"+pID+"_Button0").className="Link1 tile_Yellow";
			
			document.getElementById(this.sMouseTip+"_Label").innerHTML=this.sMouseTipMessages[0];
			this.ShowMouseTile(pEvent);
			this.sColumn_ID=pID;
			this.sColumnActiveFlag=2;
		}
		
	}
	
	return 0;
}
function schedule_SendModify_callback(){}

Schedule.prototype.OnModifyTime=function(pIndex,pID,pEvent){

	this.ShowMouseTile(pEvent);
	this.sColumn_ID=pID;
	this.sColumnActiveFlag=3;
	return 0;
}
Schedule.prototype.OnCancel=function(){
	if(this.sColumnEditFlag==1){
		return 1;
	}
	this.HiddenMouseTile();
	this.sColumn_ID=0;
	this.sColumnActiveFlag=0;
	return 0;
}
Schedule.prototype.OnDelete=function(pIndex,pID,pEvent){

	return 0;
}
//-- #Column event --
Schedule.prototype.OnColumn_Click=function(pEvent){
	if(this.sColumnEditFlag==0){
		this.OnColumn_Start(pEvent);
	}else{
		this.OnColumn_End(pEvent);
	}
	
	return 0;
}
Schedule.prototype.OnColumn_Start=function(pEvent){
	if(this.sColumnActiveFlag==0){
		return 1;
	}
	//-- #Set content --
	var tmpAR0=document.getElementById(this.sContentbox).value.split(tmpCommon.sysSPLIT6);
	this.sColumnsCount=tmpAR0.length;
	this.sColumnsIndex=tmpAR0.length;
	
	tmpCONTENT=this.sColumnTemplate.replace(/\{Nets.Index}/g,this.sColumnsIndex);
	tmpCONTENT=tmpCONTENT.replace(/\{Nets.ID}/g,this.sColumn_ID);
	if(this.sColumnStylesIndex>=this.sColumnStyles.length){
		this.sColumnStylesIndex=0;
	}
	tmpCONTENT=tmpCONTENT.replace(/\{Nets.BGClass}/g,this.sColumnStyles[this.sColumnStylesIndex]);
	document.getElementById(this.sColumnsbox).innerHTML+=tmpCONTENT;
	
	this.sColumnStylesIndex++;
	//-- #Start --
	//-- #Get index --
	tmpEvent=tmpFrames.getMouse(pEvent);
	tmpScrollTop=document.documentElement.scrollTop;
	tmpScrollLeft=document.documentElement.scrollLeft;
	if(tmpNavigator.appName=="N"){
		tmpScrollTop=document.body.scrollTop;
		tmpScrollLeft=document.body.scrollLeft;
	}
	tmpY=tmpEvent.clientY+tmpScrollTop-this.sColumnboxHead;
	tmpINT=tmpY%this.sColumnHeight;
	tmpY-=tmpINT;
	tmpIndex=tmpY/this.sColumnHeight;
	//-- #Set column --
	//#Top
	tmpTOP=tmpIndex*this.sColumnHeight-1;
	document.getElementById("mainColumn_"+this.sColumnsIndex).style.marginTop=tmpTOP+tmpCommon.sysPx;
	//#Left
	tmpLeftCELLCOUNT=0;
	tmpAR0=document.getElementById(this.sContentbox).value.split(tmpCommon.sysSPLIT6);
	Coun0=0;
	while(tmpAR0.length>Coun0){
		tmpAR1=tmpAR0[Coun0].split(tmpCommon.sysSPLIT5);
		if(tmpAR1.length==5 && document.getElementById("mainColumn_"+tmpAR1[0]+"_IndexTxt").innerHTML!=this.sColumnsIndex){
			if(
				(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)>=tmpIndex &&
				parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)<=(tmpIndex+1)) ||
				(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)<=tmpIndex &&
				parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)>=(tmpIndex+1)) ||
				(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)>tmpIndex &&
				parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)<=(tmpIndex+1))
			){ tmpLeftCELLCOUNT=parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_ColumnindexTxt").innerHTML)+1; }
			//){ tmpLeftCELLCOUNT++; }
		}
		Coun0++;
	}
	tmpLEFT=this.sColumnboxLeft+tmpLeftCELLCOUNT*(this.sColumnWidth+this.sColumnboxLeftBlank);
	document.getElementById("mainColumn_"+this.sColumnsIndex).style.marginLeft=tmpLEFT+tmpCommon.sysPx;
	//#Height
	document.getElementById("mainColumn_"+this.sColumnsIndex).style.height=this.sColumnHeight+tmpCommon.sysPx;
	//#Width
	//#Value
	document.getElementById("mainColumn_"+this.sColumnsIndex+"_IndexTxt").innerHTML=this.sColumnsIndex;
	document.getElementById("mainColumn_"+this.sColumnsIndex+"_IDTxt").innerHTML=this.sColumn_ID;
	this.sColumn_StartIndex=tmpIndex;
	document.getElementById("mainColumn_"+this.sColumnsIndex+"_StartindexTxt").innerHTML=this.sColumn_StartIndex;
	document.getElementById("mainColumn_"+this.sColumnsIndex+"_ColumnindexTxt").innerHTML=tmpLeftCELLCOUNT;
	
	document.getElementById(this.sMouseTip+"_Label").innerHTML=this.sMouseTipMessages[1];
	this.sColumnEditFlag=1;
	return 0;
}
Schedule.prototype.OnColumn_Move=function(pEvent){
	if(this.sColumnEditFlag==0){
		return 1;
	}
	//-- #Get index --
	tmpEvent=tmpFrames.getMouse(pEvent);
	tmpScrollTop=document.documentElement.scrollTop;
	tmpScrollLeft=document.documentElement.scrollLeft;
	if(tmpNavigator.appName=="N"){
		tmpScrollTop=document.body.scrollTop;
		tmpScrollLeft=document.body.scrollLeft;
	}
	tmpY=tmpEvent.clientY+tmpScrollTop-this.sColumnboxHead;
	tmpINT=tmpY%this.sColumnHeight;
	tmpY-=tmpINT;
	tmpIndex=tmpY/this.sColumnHeight;
	if(this.sColumn_StartIndex>=tmpIndex){
		tmpIndex=this.sColumn_StartIndex+1;
	}
	//-- #Set column --
	document.getElementById("mainReport").innerHTML="";
	//#Left
	tmpLeftCELLCOUNT=0;
	tmpAR0=document.getElementById(this.sContentbox).value.split(tmpCommon.sysSPLIT6);
	Coun0=0;
	while(tmpAR0.length>Coun0){
		tmpAR1=tmpAR0[Coun0].split(tmpCommon.sysSPLIT5);
		if(tmpAR1.length==5 && document.getElementById("mainColumn_"+tmpAR1[0]+"_IndexTxt").innerHTML!=this.sColumnsIndex){
			if(
				(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)>=parseInt(document.getElementById("mainColumn_"+this.sColumnsIndex+"_StartindexTxt").innerHTML) &&
				parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)<=tmpIndex) ||
				(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)<=parseInt(document.getElementById("mainColumn_"+this.sColumnsIndex+"_StartindexTxt").innerHTML) &&
				parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)>=tmpIndex) ||
				(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)>parseInt(document.getElementById("mainColumn_"+this.sColumnsIndex+"_StartindexTxt").innerHTML) &&
				parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)<=tmpIndex)
			){ tmpLeftCELLCOUNT=parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_ColumnindexTxt").innerHTML)+1; }
			//){ tmpLeftCELLCOUNT++; }
		}
		Coun0++;
	}
	tmpLEFT=this.sColumnboxLeft+tmpLeftCELLCOUNT*(this.sColumnWidth+this.sColumnboxLeftBlank);
	document.getElementById("mainColumn_"+this.sColumnsIndex).style.marginLeft=tmpLEFT+tmpCommon.sysPx;
	//#Height
	tmpHEIGHT=(tmpIndex-this.sColumn_StartIndex+1)*this.sColumnHeight-1;
	document.getElementById("mainColumn_"+this.sColumnsIndex).style.height=tmpHEIGHT+tmpCommon.sysPx;
	//#Width
	//#Value
	document.getElementById("mainColumn_"+this.sColumnsIndex+"_EndindexTxt").innerHTML=tmpIndex;
	document.getElementById("mainColumn_"+this.sColumnsIndex+"_ColumnindexTxt").innerHTML=tmpLeftCELLCOUNT;
	
	return 0;
}
Schedule.prototype.OnColumn_End=function(pEvent){
	if(this.sColumnEditFlag==0){
		return 1;
	}
	//-- #Get index --
	tmpEvent=tmpFrames.getMouse(pEvent);
	tmpScrollTop=document.documentElement.scrollTop;
	tmpScrollLeft=document.documentElement.scrollLeft;
	if(tmpNavigator.appName=="N"){
		tmpScrollTop=document.body.scrollTop;
		tmpScrollLeft=document.body.scrollLeft;
	}
	tmpY=tmpEvent.clientY+tmpScrollTop-this.sColumnboxHead;
	tmpINT=tmpY%this.sColumnHeight;
	tmpY-=tmpINT;
	tmpIndex=tmpY/this.sColumnHeight;
	if(this.sColumn_StartIndex>=tmpIndex){
		tmpIndex=this.sColumn_StartIndex+1;
	}
	//-- #Set column --
	//#Left
	tmpLeftCELLCOUNT=0;
	tmpAR0=document.getElementById(this.sContentbox).value.split(tmpCommon.sysSPLIT6);
	Coun0=0;
	while(tmpAR0.length>Coun0){
		tmpAR1=tmpAR0[Coun0].split(tmpCommon.sysSPLIT5);
		if(tmpAR1.length==5 && document.getElementById("mainColumn_"+tmpAR1[0]+"_IndexTxt").innerHTML!=this.sColumnsIndex){
			if(
				(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)>=parseInt(document.getElementById("mainColumn_"+this.sColumnsIndex+"_StartindexTxt").innerHTML) &&
				parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)<=tmpIndex) ||
				(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)<=parseInt(document.getElementById("mainColumn_"+this.sColumnsIndex+"_StartindexTxt").innerHTML) &&
				parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)>=tmpIndex) ||
				(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)>parseInt(document.getElementById("mainColumn_"+this.sColumnsIndex+"_StartindexTxt").innerHTML) &&
				parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)<=tmpIndex)
			){ tmpLeftCELLCOUNT=parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_ColumnindexTxt").innerHTML)+1; }
			//){ tmpLeftCELLCOUNT++; }
		}
		Coun0++;
	}
	tmpLEFT=this.sColumnboxLeft+tmpLeftCELLCOUNT*(this.sColumnWidth+this.sColumnboxLeftBlank);
	document.getElementById("mainColumn_"+this.sColumnsIndex).style.marginLeft=tmpLEFT+tmpCommon.sysPx;
	//#Height
	tmpHEIGHT=(tmpIndex-this.sColumn_StartIndex+1)*this.sColumnHeight-1;
	document.getElementById("mainColumn_"+this.sColumnsIndex).style.height=tmpHEIGHT+tmpCommon.sysPx;
	//#Width
	//#Value
	this.sColumn_EndIndex=tmpIndex;
	document.getElementById("mainColumn_"+this.sColumnsIndex+"_EndindexTxt").innerHTML=tmpIndex;
	document.getElementById("mainColumn_"+this.sColumnsIndex+"_ColumnindexTxt").innerHTML=tmpLeftCELLCOUNT;
	
	//-- ### --
	if(this.sColumn_ID==0){
		tmpCONTENT=this.sProgressTemplate.replace(/\{Nets.Index}/g,this.sColumnsIndex);
		document.getElementById(this.sProgressNew).innerHTML+=tmpCONTENT;
	}else{
		document.getElementById("mainProgress_"+this.sColumn_ID+"_Button0").innerHTML="取消安排";
		document.getElementById("mainProgress_"+this.sColumn_ID+"_Button0").className="Link1 SBlue2";
	}
	
	//-- #Save to textarea --
	tmpCONTENT=
		document.getElementById("mainColumn_"+this.sColumnsIndex+"_IndexTxt").innerHTML+tmpCommon.sysSPLIT5+
		document.getElementById("mainColumn_"+this.sColumnsIndex+"_IDTxt").innerHTML+tmpCommon.sysSPLIT5+
		document.getElementById("mainColumn_"+this.sColumnsIndex+"_StartindexTxt").innerHTML+tmpCommon.sysSPLIT5+
		document.getElementById("mainColumn_"+this.sColumnsIndex+"_EndindexTxt").innerHTML+tmpCommon.sysSPLIT5+
		document.getElementById("mainColumn_"+this.sColumnsIndex+"_ColumnindexTxt").innerHTML+tmpCommon.sysSPLIT6;
	document.getElementById(this.sContentbox).value+=tmpCONTENT;
	
	this.HiddenMouseTile();
	this.sColumnEditFlag=0;
	this.sColumnActiveFlag=0;
	return 0;
}
//-- #InitialColumns --
Schedule.prototype.OnInitialColumns=function(){
	var tmpAR0=document.getElementById(this.sContentbox).value.split(tmpCommon.sysSPLIT6);
	var Coun0=0;
	while(tmpAR0.length>Coun0){
		tmpVALUE=tmpAR0[Coun0].split(tmpCommon.sysSPLIT5);
		if(tmpVALUE.length==5){
			//-- #Make --
			tmpIndex=Coun0+1;
			tmpCONTENT=this.sColumnTemplate.replace(/\{Nets.Index}/g,tmpIndex);
			tmpCONTENT=tmpCONTENT.replace(/\{Nets.ID}/g,tmpVALUE[1]);
			if(this.sColumnStylesIndex>=this.sColumnStyles.length){
				this.sColumnStylesIndex=0;
			}
			tmpCONTENT=tmpCONTENT.replace(/\{Nets.BGClass}/g,this.sColumnStyles[this.sColumnStylesIndex]);
			document.getElementById(this.sColumnsbox).innerHTML+=tmpCONTENT;
			this.sColumnStylesIndex++;
			//-- #Set --
			//#Top
			tmpTOP=tmpVALUE[2]*this.sColumnHeight-1;
			document.getElementById("mainColumn_"+tmpIndex).style.marginTop=tmpTOP+tmpCommon.sysPx;
			//#Heigth
			tmpHEIGHT=(tmpVALUE[3]-tmpVALUE[2])*this.sColumnHeight-1;
			if(tmpHEIGHT<0){ tmpHEIGHT=0; }
			document.getElementById("mainColumn_"+tmpIndex).style.height=tmpHEIGHT+tmpCommon.sysPx;
			//#Left
			tmpLeftCELLCOUNT=0;
			Coun1=0;
			while(tmpAR0.length>Coun1){
				tmpAR1=tmpAR0[Coun1].split(tmpCommon.sysSPLIT5);
				if(tmpAR1.length==5 && document.getElementById("mainColumn_"+tmpAR1[0]+"_IndexTxt")!=undefined && document.getElementById("mainColumn_"+tmpAR1[0]+"_IndexTxt").innerHTML!=tmpVALUE[0]){
					if(
						(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)>=parseInt(tmpVALUE[2]) &&
						parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)<=parseInt(tmpVALUE[3])) ||
						(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_StartindexTxt").innerHTML)<=parseInt(tmpVALUE[2]) &&
						parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)>=parseInt(tmpVALUE[3])) ||
						(parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)>parseInt(tmpVALUE[2]) &&
						parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_EndindexTxt").innerHTML)<=parseInt(tmpVALUE[3]))
					){ tmpLeftCELLCOUNT=parseInt(document.getElementById("mainColumn_"+tmpAR1[0]+"_ColumnindexTxt").innerHTML)+1; }
					//){ tmpLeftCELLCOUNT++; }
				}
				Coun1++;
			}
			tmpLEFT=this.sColumnboxLeft+tmpLeftCELLCOUNT*(this.sColumnWidth+this.sColumnboxLeftBlank);
			document.getElementById("mainColumn_"+tmpIndex).style.marginLeft=tmpLEFT+tmpCommon.sysPx;
			//#Width
			//#Value
			document.getElementById("mainColumn_"+tmpIndex+"_StartindexTxt").innerHTML=tmpVALUE[2];
			document.getElementById("mainColumn_"+tmpIndex+"_EndindexTxt").innerHTML=tmpVALUE[3];
			document.getElementById("mainColumn_"+tmpIndex+"_ColumnindexTxt").innerHTML=tmpLeftCELLCOUNT;

		}
		Coun0++;
	}

	return 0;
}


//-- #Tip --
Schedule.prototype.ShowTile=function(pIndex,pID){
	if(this.sMaintipLock!=0){
		return 1;
	}
	if(this.sColumnEditFlag==1){
		this.HiddenTile(pIndex);
		return 1;
	}
	var tmpCELLCONTENT=0;
	tmpCELLCONTENT=document.getElementById("mainColumn_"+pIndex+"_StartindexTxt").innerHTML;
	tmpTOP=tmpCELLCONTENT*this.sColumnHeight;
	document.getElementById(this.sColumnsTip).className="Schedule_Tile_1";
	document.getElementById(this.sColumnsTip).style.marginTop=tmpTOP+tmpCommon.sysPx;
	tmpLEFT=parseInt(document.getElementById("mainColumn_"+pIndex).style.marginLeft)+this.sColumnWidth;
	document.getElementById(this.sColumnsTip).style.marginLeft=tmpLEFT+tmpCommon.sysPx;
	
	this.sMainTip_Index=pIndex;
	this.sMainTip_ID=pID;
	document.getElementById("mainTip_Button1").href="#Here";
	document.getElementById("mainTip_Button2").href="#Here";
	document.getElementById("mainTip_Button3").href="../../../Plus/Common/Project/projprogress.php?ActionType=Report&Report="+pID+",0";
	document.getElementById("mainTip_Button4").href="../../../Plus/Common/Project/projprogress.php?ActionType=Normal&Normal="+pID+",0";
	document.getElementById("mainTip_Button5").href="#Here";
	document.getElementById("mainTip_Content").innerHTML="";
	if(pID==0){
		document.getElementById("mainTip_Content").innerHTML="未保存未命名任务";
		return 0;
	}
	//#Send modify
	var tmpURL=tmpCommon.sysPage+"?ActionType=DMainTip&DMainTip="+pID;
	this.sAjax_0.sFlag="Data";
	this.sAjax_0.sPanel="mainTip_Content";
	this.sAjax_0.sendRequestSp(tmpURL,"schedule_GetMaintipContent_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
function schedule_GetMaintipContent_callback(){
	var tmpFlag=tmpSchedule.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpSchedule.sAjax_0.sPanel);
	var tmpURL=tmpSchedule.sAjax_0.sURL;
	var tmpHttpRequests=tmpSchedule.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;
			tmpSchedule.sMaintipLock=1;
	    	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;
	}
}

Schedule.prototype.HiddenTile=function(pIndex){
	if(this.sMaintipLock==2){
		return 1;
	}
	document.getElementById(this.sColumnsTip).className=tmpCommon.sysHidden;
	this.sMaintipLock=0;
	
	return 0;
}
Schedule.prototype.TileEidt=function(pIndex,pID){
	if(this.sMainTip_ID==0){
		return 1;
	}
	//#Send modify
	var tmpURL=tmpCommon.sysPage+"?ActionType=DMainTipEdit&DMainTipEdit="+this.sMainTip_ID;
	this.sAjax_0.sFlag="Data";
	this.sAjax_0.sPanel="mainTip_Content";
	this.sAjax_0.sendRequestSp(tmpURL,"schedule_GetMaintipEdit_callback()");
	//window.open(tmpURL,"_blank");

	this.sMaintipLock=2;
	return 0;
}
function schedule_GetMaintipEdit_callback(){
	var tmpFlag=tmpSchedule.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpSchedule.sAjax_0.sPanel);
	var tmpURL=tmpSchedule.sAjax_0.sURL;
	var tmpHttpRequests=tmpSchedule.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;
			
			tmpSpancolor="#445680";
			tmpSpanwidth="100px";
			tmpControlwidth="240px";
			
			document.getElementById("prprotNameTxt_Label").style.color=tmpSpancolor;
			document.getElementById("prprotNameTxt_Label").style.width=tmpSpanwidth;
			document.getElementById("prprotStateTxt_Label").style.color=tmpSpancolor;
			document.getElementById("prprotStateTxt_Label").style.width=tmpSpanwidth;
			document.getElementById("prproctProgress_TotalTxt_Label").style.color=tmpSpancolor;
			document.getElementById("prproctProgress_TotalTxt_Label").style.width=tmpSpanwidth;
			document.getElementById("prproctProgress_NowTxt_Label").style.color=tmpSpancolor;
			document.getElementById("prproctProgress_NowTxt_Label").style.width=tmpSpanwidth;

			document.getElementById("prprotNameTxt").style.width=tmpControlwidth;
			document.getElementById("prproctProgress_TotalTxt").style.width=tmpControlwidth;
			document.getElementById("prproctProgress_NowTxt").style.width=tmpControlwidth;

	    	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;
	}
}
Schedule.prototype.TileEditSave=function(){

	//#Send modify
	var tmpURL=tmpCommon.sysPage+"?ActionType=DQuickModify"+
		"&prprotIDTxt="+tmpCommon.encodeURL(document.getElementById("prprotIDTxt").value,1)+
		"&prprotNameTxt="+tmpCommon.encodeURL(document.getElementById("prprotNameTxt").value,1)+
		"&prprotStateTxt="+tmpCommon.encodeURL(document.getElementById("prprotStateTxt").value,1)+
		"&prproctProgress_TotalTxt="+tmpCommon.encodeURL(document.getElementById("prproctProgress_TotalTxt").value,1)+
		"&prproctProgress_NowTxt="+tmpCommon.encodeURL(document.getElementById("prproctProgress_NowTxt").value,1);
	this.sAjax_0.sFlag="Data";
	this.sAjax_0.sPanel="mainTip_Content";
	this.sAjax_0.sendRequestSp(tmpURL,"schedule_GetMaintipContent_callback()");
	//window.open(tmpURL,"_blank");

	return 0;
}



//-- #MouseTip --
Schedule.prototype.ShowMouseTile=function(pEvent){
	document.getElementById(this.sMouseTip).className="Schedule_Tile_20";
	this.OnMouseTile_Move(pEvent);
	
	
	return 0;
}

Schedule.prototype.HiddenMouseTile=function(){
	document.getElementById(this.sMouseTip).className=tmpCommon.sysHidden;
	
	return 0;
}
Schedule.prototype.OnMouseTile_Move=function(pEvent){
	if(document.getElementById(this.sMouseTip).className==tmpCommon.sysHidden){
		return 1;
	}
	tmpEvent=tmpFrames.getMouse(pEvent);
	tmpScrollTop=document.documentElement.scrollTop;
	tmpScrollLeft=document.documentElement.scrollLeft;
	if(tmpNavigator.appName=="N"){
		tmpScrollTop=document.body.scrollTop;
		tmpScrollLeft=document.body.scrollLeft;
	}
	tmpY=tmpEvent.clientY+tmpScrollTop-46;
	tmpX=tmpEvent.clientX+tmpScrollLeft;
	document.getElementById(this.sMouseTip).style.top=tmpY+tmpCommon.sysPx;
	document.getElementById(this.sMouseTip).style.left=tmpX+tmpCommon.sysPx;
	
	return 0;
}



//-- ------ #Instanct ------ --
var tmpSchedule=new Schedule();




