//页面函数


/**
 * 返回首页动作
 */
function returnMainPage(){
	document.getElementById("main_content").innerHTML=""; //清空功能块
	doReturnMainPage();
}


/**
 * 不清空原有界面内容，只返回主功能树
 */
function doReturnMainPage(){
	sendReturnText(this,'/fuctiontree?treepk=px200706211132011000','treedata'); //设置栏目数据树
	//sendReturnText(this,"/getmainmenu","treedata");
}


/**
 * 登录成功后调用
 */
function logonOKDo(){

	IS_LOGON = true; //标记登录成功
	if (designMode){
		//设计模式时，不调用其它区块内容信息
		return;
	}
	if (USER_LOGON_NAME!=PREVIOUS_USER_LOGON_NAME){
		//如果不是同一个用户登录，不用恢复上一次路径
		INIT_FLAG = false;
	}
	var defaultDoTags = 
			getElementsInDocumentByAttribute(
							"id",DEFAULT_LOGON_DO);
	var notDoDefault = true;
	if (defaultDoTags!=null && !INIT_FLAG){
		var i=0;
		while(i<defaultDoTags.length){
			if (defaultDoTags[i].value!=null && defaultDoTags[i].value!=""){
				eval(defaultDoTags[i].value);
				INIT_FLAG = true;
				notDoDefault = false;
			}
			i++;
		}
	}
	if (notDoDefault){
		//获取所有区域最后一次动作路径
		var areaKeys = lastActionMap.getKeys();
		var noDoAction = true; //是否没执行动作
		if (areaKeys!=null){
			var i=0;
			while(i<areaKeys.length){
				var actionPath = lastActionMap.get(areaKeys[i]);
				if (actionPath!=null && actionPath!=""){
					sendReturnText(
						null
						,lastActionMap.get(areaKeys[i])
						,areaKeys[i]
						,lastActionMethodMap.get(areaKeys[i])
						,lastActionMethodParaMap.get(areaKeys[i]));
					lastActionMap.remove(areaKeys[i]);
					noDoAction = false;
				}
				i++;
			}
		}
		if (noDoAction){
			window.location.reload();
		}
	}
}


/**
 * 显示错误信息
 * message 错误信息
 */
function showErrorMsg(upFunc,message){
	var errorTag;
	
	if (!upFunc.noReturnValue){
		//恢复发送前的页面内容
		var reVal = upFunc.sendBeforeHTML;
		if (reVal!=null){
			//获取到错误标签位置
			var errorPoint = reVal.indexOf(ERROR_MSG_TAG_ID);
			if (errorPoint>-1){
				errorPoint+=ERROR_MSG_TAG_ID.length; 
				//获取错误位置后的字符串
				var cutPointStr = 
					reVal.substring(errorPoint,reVal.length);
				errorPoint+=cutPointStr.indexOf(">")+1;
				try{
					upFunc.returnInnerTag.innerHTML = 
						reVal.substring(0,errorPoint)+message+reVal.substring(errorPoint+cutPointStr.indexOf("</")-1,reVal.length);
				}catch(e){}
			}else{
				alert(message);
				upFunc.returnInnerTag.innerHTML = reVal;
			}
		}else{
			alert(message);
		}
	}else{
		alert(message);
	}
}


/**
 * 执行注销
 */
function doLogout(ajax){
	if (!ajax){
		if(!confirm("确认注销？")){
			return;
		}
		IS_LOGON = false; //手动点击注销，如果不先false，会提示错误信息
		INIT_FLAG = false; //重新登录后不自动转入
	}
	if (IS_LOGON){
		alert("系统将重新验证您的身份");
	}
	IS_LOGON = false;
	//获取所有区块主键
	var arepk = lastPageMap.getKeys();
	if (arepk!=null){
		var i=0;
		while(i<arepk.length){
			try{
				document.getElementById(arepk[i]).innerHTML='';
			}catch(e){}
			i++;
		}
	}
	if (document.getElementById('login')==null && ajax.returnInnerTag!=null){
		sendReturnText(ajax.returnInnerTag,'/dologout');
	}else{
		sendReturnText('login','/dologout');
	}
}



/**
 * 获得所有的输入框值
 */
function allNodevalue(){
	
	var optioncount		=	document.getElementById("answercount").value;
	var textcount		=	document.getElementById("textanswercount").value;
	var stranswer		=	"";
	var strtextanswer	=	"";
	
	//取得所有选择题的答案
	var i=1;
	while(i<=optioncount){
		var obj=document.getElementById("answer"+i);
		if(obj.checked==true){
			stranswer=stranswer+1+";"
		}
		else{
			stranswer=stranswer+0+";"
		}
		i++;
	}
	document.getElementById("answerstr").value=stranswer;
	
	//取得所有问答题的答案
	i=1;
	while(i<=textcount){
		try{
		
			var obj=document.getElementById("text"+i);
			
			if(obj==""){
				continue;
			}
			
			if(!obj.value==""){
				strtextanswer=strtextanswer+"<@title@>text"+i+"<@content@>"+obj.value;
			}
		
		}catch(e){}
		i++;
	}
	document.getElementById("textanswerstr").value=strtextanswer;
	
}


/**
 * 获得所有同名字段的值
 */
function allColumnValue(){

	var strcolumn	=	document.getElementById("strcolumn").value;
	var boxs		= 	document.getElementsByName('columnbox');
	
	var keywordpks='';
	var i=0;
	while(i<boxs.length){
		if(boxs[i].checked){
			keywordpks +=boxs[i].getAttribute('dataid')+',';
		}
		i++;
	}
	document.getElementById("strcolumn").value=keywordpks;
	
}

/**
 * 获得所有按钮字段的值
 */
function allButtonValue(){

	var strbuttom	=	document.getElementById("strbuttom").value;
	var boxs		= 	document.getElementsByName('columnbox');

	var keywordpks='';
	var i=0;
	while(i<boxs.length){
		if(!boxs[i].checked){
			keywordpks +=boxs[i].getAttribute('dataid')+',';
		}
		i++;
	}
	document.getElementById("strbuttom").value=keywordpks;
	alert(keywordpks);
	
}


/**
 * 栏目权限连带选择
 */
function doChainSelect(thisid){

	var boxs		= 	document.getElementsByName('columnbox');
	var pk			=	thisid;
	var ppk			=	"";
	var tempvar		=	"";
	var resultarray	=	[];
	var tempindex	=	0;
	
	//把页面传来的pk值放入
	resultarray[tempindex++]=thisid;
	
	//判断触发时的状态
	var i=0;
	while(i<boxs.length){
		if(pk==boxs[i].getAttribute('dataid')){
			
			tempvar=boxs[i].checked;
		}
		i++;
	}
	
	
	//循环处理
	i=0;
	while(i<boxs.length){
		ppk = boxs[i].getAttribute('datapid')
		var arraylength=resultarray.length;
		var j=0;
		while(j<arraylength){
			if(ppk==resultarray[j]){
				//此复选框被选中
				boxs[i].checked = tempvar
				//给pk赋值
				pk=boxs[i].getAttribute('dataid');
				//加入pk到数组中
				resultarray[tempindex++]=pk;
			}
			j++;
		}
		i++;
	}
	
}


/**
 * 显示隐藏的文本框
 */

function show_hiddentextbox(textflag){
	
	document.getElementById(textflag).style.display = "";
}


/**
 * 初始化页面
 */
function initMultiSelectForm(){

	initMultiSelect('selectFrom','fromvalues','fromtexts','selectTo','tovalues','totexts');
	
}

/**
 * 初始化下拉框组
 * fromSelectID 源下拉框主键
 * fromValues 源下拉框值标签主键 用逗号分割
 * fromTexts 源下拉框文本标签主键 用逗号分割
 * toSelectID 目标下拉框主键
 * toValues 目标下拉框值标签主键 用逗号分割
 * toTexts 目标下拉框文本标签主键 用逗号分割
 */
function initMultiSelect(fromSelectID,fromValuesID,fromTextsID,toSelectID,toValuesID,toTextsID){
	
	var fromSelectTag = document.getElementById(fromSelectID); 
	var fromValuesTag = document.getElementById(fromValuesID);
	var fromTextsTag = document.getElementById(fromTextsID);
	var toSelectTag = document.getElementById(toSelectID);
	var toValuesTag = document.getElementById(toValuesID);
	var toTextsTag = document.getElementById(toTextsID);
	
	//初始化源下拉框
	if (fromValuesTag!=null 
			&& fromTextsTag!=null 
			&& fromSelectTag!=null 
			&& fromValuesTag.value!=null 
			&& fromValuesTag.value!=""
			&& fromTextsTag.value!=null){
		var fValueArrl = fromValuesTag.value.split(",");
		var fTextArrl = fromTextsTag.value.split(",");
		
		if (fValueArrl!=null 
			&& fTextArrl!=null 
			&& fValueArrl.length==fTextArrl.length){
			
			
			fromSelectTag.length = 0;
			var i=0;
			while(i<fValueArrl.length){
				var fSelectCount = fromSelectTag.length;
				fromSelectTag.options[fSelectCount] = new Option("",fSelectCount);
				fromSelectTag.options[fSelectCount].value = fValueArrl[i];
				fromSelectTag.options[fSelectCount].text = fTextArrl[i];
				i++;
			}
		}
		
	}
	
	//初始化目标下拉框
	if (toValuesTag!=null 
			&& toTextsTag!=null 
			&& toSelectTag!=null 
			&& toValuesTag.value!=null 
			&& toValuesTag.value!=""
			&& toTextsTag.value!=null){
		var tValueArrl = toValuesTag.value.split(",");
		var tTextArrl = toTextsTag.value.split(",");
		
		if (tValueArrl!=null 
			&& tTextArrl!=null 
			&& tValueArrl.length==tTextArrl.length){
			
			toSelectTag.length = 0;
			var i=0;
			while(i<tValueArrl.length){
				var tSelectCount = toSelectTag.length;
				toSelectTag.options[tSelectCount] = new Option("",tSelectCount);
				toSelectTag.options[tSelectCount].value = tValueArrl[i];
				toSelectTag.options[tSelectCount].text = tTextArrl[i];
				i++;
			}
		}
	}
}



/**
 * 提交多选下拉框之前调用的方法
 * toSelectID 目标选择框主键
 * saveInputID 保存选择值标签主键
 */
function beforeSubmitMultiSelect(toSelectID,saveInputID) {
	
	var toSelectTag = document.getElementById(toSelectID); 
	var saveInputTag = document.getElementById(saveInputID);
	var i=0;
	while(i<toSelectTag.length){
        saveInputTag.value += toSelectTag.options[i].value
        if(i!=toSelectTag.length-1){
           saveInputTag.value+=","
        }
        i++;
    }
}


/**
 * 将目标下拉框中的选项上移
 * selectToID 目标下拉框主键
 */
function doMultiSelectUp(selectToID){
	
	var selectToTag = document.getElementById(selectToID);
	
	if(selectToTag.length<1){
		return false;
	}
	var swapValue = null; 
	var swapText = null;
	//循环处理选项
	var i=0;
	while(i<selectToTag.length){
		if (!selectToTag.options[i].selected || i==0){
			i++;
			continue;
		}
		swapValue = selectToTag.options[i].value;
		swapText = selectToTag.options[i].text;
		selectToTag.options[i].value = selectToTag.options[i-1].value;
		selectToTag.options[i].text = selectToTag.options[i-1].text;
		selectToTag.options[i-1].value = swapValue;
		selectToTag.options[i-1].text = swapText;
		selectToTag.options[i].selected = false;
		selectToTag.options[i-1].selected = true;
		i++;
	}
}

/**
 * 将目标下拉框中的选项下移
 * selectToID 目标下拉框主键
 */
function doMultiSelectDown(selectToID){
	
	var selectToTag = document.getElementById(selectToID);
	
	if(selectToTag.length<1){
		return false;
	}
	var swapValue = null; 
	var swapText = null;

	//循环处理选项
	var i=selectToTag.length-1;
	while(i>-1){
		if (!selectToTag.options[i].selected || i==selectToTag.length-1){
			i--;
			continue;
		}
		swapValue = selectToTag.options[i].value;
		swapText = selectToTag.options[i].text;
		selectToTag.options[i].value = selectToTag.options[i+1].value;
		selectToTag.options[i].text = selectToTag.options[i+1].text;
		selectToTag.options[i+1].value = swapValue;
		selectToTag.options[i+1].text = swapText;
		selectToTag.options[i].selected = false;
		selectToTag.options[i+1].selected = true;
		i--;
	}
}

/**
 * 将源下拉框中选中的选项添加到目标下拉框中
 * selectFromID 源下拉框主键
 * selectToID 目标下拉框选项
 */
function doMultiSelectAdd(selectFromID,selectToID){
	
	var selectFromTag = document.getElementById(selectFromID);
	var selectToTag = document.getElementById(selectToID);
	//取消选择所有
	var i=0;
	while(i<selectToTag.length){
		selectToTag.options[i].selected=false;
		i++;
	}
	//循环处理选项
	for (i=0;i<selectFromTag.length;i++){
		
		if (!selectFromTag.options[i].selected){
			continue;
		}
		var newIndex = selectToTag.length;
		selectToTag.options[newIndex] = new Option("",newIndex);
	    selectToTag.options[newIndex].text = selectFromTag.options[i].text;
	    selectToTag.options[newIndex].value = selectFromTag.options[i].value;
	    selectToTag.options[newIndex].selected = true;
	    selectFromTag.options[i] = null;
	    i=-1; //再循环时为0
	}
	if (selectFromTag.length>0){
		selectFromTag.options[0].selected = true;
	}
}

/**
 * 除去目标下拉框中选定的选项
 * selectFromID 源下拉框主键
 * selectToID 目标下拉框选项
 */
function doMultiSelectDel(selectFromID,selectToID) {
	
	var selectFromTag = document.getElementById(selectFromID);
	var selectToTag = document.getElementById(selectToID);
	//取消选择所有
	for(i=0;i<selectFromTag.length;i++){
		selectFromTag.options[i].selected=false;
	}
	//循环处理选项
	for (i=0;i<selectToTag.length;i++){
		
		if (!selectToTag.options[i].selected){
			continue;
		}
		var newIndex = selectFromTag.length;
		selectFromTag.options[newIndex] = new Option("",newIndex);
	    selectFromTag.options[newIndex].text = selectToTag.options[i].text;
	    selectFromTag.options[newIndex].value = selectToTag.options[i].value;
	    selectFromTag.options[newIndex].selected = true;
	    selectToTag.options[i] = null;
	    i=-1; //再循环时为0
	}
	if (selectToTag.length>0){
		selectToTag.options[0].selected = true;
	}
}

/**
 * 将源下拉框中所有的选项添加到目标下拉框中
 * selectFromID 源下拉框主键
 * selectToID 目标下拉框选项
 */
function doMultiSelectAddall(selectFromID,selectToID) {
	
	var selectFromTag = document.getElementById(selectFromID);
	var selectToTag = document.getElementById(selectToID);
	var fromCount = selectFromTag.length;
    for(i=0;i<fromCount;i++){
        var newIndex=selectToTag.length ;//新选项索引
        selectToTag.options[newIndex] = new Option("",newIndex);
        selectToTag.options[newIndex].text = selectFromTag.options[0].text;
        selectToTag.options[newIndex].value = selectFromTag.options[0].value;
        selectToTag.options[newIndex].selected = true;
        selectFromTag.options[0] = null;
    }
}

/**
 * 将目标下拉框中所有的选项添加到源下拉框中
 * selectFromID 源下拉框主键
 * selectToID 目标下拉框选项
 */
function doMultiSelectDelall(selectFromID,selectToID) {
	
	var selectFromTag = document.getElementById(selectFromID);
	var selectToTag = document.getElementById(selectToID);
	var fromCount = selectToTag.length;
    for(i=0;i<fromCount;i++){
        var newIndex=selectFromTag.length; //新选项索引
        selectFromTag.options[newIndex] = new Option("",newIndex)
        selectFromTag.options[newIndex].text = selectToTag.options[0].text;
        selectFromTag.options[newIndex].value = selectToTag.options[0].value;
        selectFromTag.options[newIndex].selected = true;
        selectToTag.options[0] = null;
    }
}

/**
 * 多文件上传
 * uploadFileArea 资源上传文件区域
 * resourcePKArr 资源主键序列对象
 * clientFileNameArr 资源源文件名序列对象
 */   
function doMultiUploadFile(uploadFileArea,resourcePKArr,clientFileNameArr){

	var innerInfo = '';
  	var innerTag = document.getElementById(uploadFileArea);
  	var resPKs = document.getElementById(resourcePKArr);
  	var resNames = document.getElementById(clientFileNameArr);
  	
  	innerTag.innerHTML = '';
  	if (resPKs.value!=null && resPKs.value!=''){
  		var pks = resPKs.value.split(',');
  		var names = resNames.value.split(',');
  		var i=0;
  		while(i<pks.length){
  			if (i>0){
  				innerInfo+='<br/>';
  			}
  			innerInfo+=names[i]+'&nbsp;&nbsp;';
  			innerInfo+='<input type="button" datapk='+pks[i]+' name="downloadbt" value="下载" class="buttun" onclick="javascript:sendReturnText(this,\'/downloadfile?resourceinfopk=\'+this.getAttribute(\'datapk\'),\'main_content\',function (para,res){alert(res);window.open(res);},null,null,null,\'true\');" />';
  			innerInfo+='&nbsp;&nbsp;';
  			innerInfo+='<input type="button" datapk='+pks[i]+' name="delbt" value="删除" class="buttun" onclick="javascript:doUploadFileDel(\''+resourcePKArr+'\',\''+clientFileNameArr+'\',this.getAttribute(\'datapk\'),\''+uploadFileArea+'\');" />';
  			i++;
  		}
  		innerTag.innerHTML=innerInfo;
  	}
}
  	
/**
 * 删除上传文件
 * resourcePKArr 源资源主键序列对象
 * clientFileNameArr 源资源源文件名序列对象
 * selectResourcePK 删除的删除文件主键
 * selectClientFileName 删除的上传文件名
 * uploadFileArea 上传文件区域
 */
function doUploadFileDel(resourcePKArr,clientFileNameArr,selectResourcePK,uploadFileArea){
	
	var resPKs = document.getElementById(resourcePKArr);
  	var resNames = document.getElementById(clientFileNameArr);
  	var resDelPK = selectResourcePK;
  	
  	if (resDelPK==null || resDelPK==''){
  		return;
  	}
  	var fixPK = "";
  	var fixName = "";
  	
  	if(resPKs.value!=null && resPKs.value!=''){
  		var pks = resPKs.value.split(',');
  		var names = resNames.value.split(',');
  		var i=0;
  		while(i<pks.length){
			if (pks[i]!=resDelPK){
				if (i>0 && fixPK!=''){
					fixPK += ",";
					fixName += ",";
				}
				fixPK+=pks[i];
				fixName+=names[i];
			}
			i++;
  		}
  		resPKs.value = fixPK;
  		resNames.value = fixName;
  	}
  	
  	doMultiUploadFile(uploadFileArea,resourcePKArr,clientFileNameArr);
  	
}

/**
 * 单文件上传
 * uploadFileArea 资源上传区域
 * resourcePK 资源主键对象
 * clientFileName 资源名称对象
 */
function doSingleUploadFile(uploadFileArea,resourcePK,clientFileName){

	var innerInfo = '';
  	var innerTag = document.getElementById(uploadFileArea);
  	var resPK = document.getElementById(resourcePK);
  	var resName = document.getElementById(clientFileName);
  	
  	innerTag.innerHTML = '';
  	if (resPK.value!=null && resPK.value!=''){
  			innerInfo+=resName.value+'&nbsp;&nbsp;';
  			innerInfo+='<input type="button" datapk='+resPK.value+' name="downloadbt" value=" 下载 " class="buttun" onclick="sendReturnText(this,\'/downloadfile?resourceinfopk=\'+this.getAttribute(\'datapk\'),\'main_content\',function (para,res){window.open(res,\'\',\'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,channelmode=yes,width=1050,height=600,,top=0,left=0\');},null,null,null,\'true\');" />';
  			innerInfo+='&nbsp;&nbsp;';
  			innerInfo+='<input type="button" datapk='+resPK.value+' name="downloadbt" value=" 删除 " class="buttun" onclick="doUploadFileDel(\''+resourcePK+'\',\''+clientFileName+'\',this.getAttribute(\'datapk\'),\''+uploadFileArea+'\');" />';
  		innerTag.innerHTML=innerInfo;
  	}
}


/**
 * 自动刷新
 * framesName 刷新区域
 */
function reloadfresh(framesName){
	//alert(framesName);
	//document.frames[framesname].location.reload();
	document.frames[framesName].location.reload();
}




/**
 * Txt文件数据导入
 * msgNode 点击导入的按钮标签
 * dataForm 提交数据的from主键
 * schemaConstPK 常量主键
 */
function doImportTxt(msgNode,dataForm,schemaConstPK){

	//构造返回值输入框
	var resTag = document.createElement("INPUT");
	resTag.id="uploadfileallpath";
	resTag.name="filepath";
	resTag.type="hidden";
	
	showModalDialogHTML(this,'/rlm/ftpinfomanager/upload.html',resTag,300,160);
	if (resTag.value=='' || resTag.value==null){
		return false;
	}
	if (dataForm==null){
		dataForm = resTag;
	}else{
		try{
			dataForm.appendChild(resTag);
		}catch(e){}
	}
	if (msgNode!=null){
		msgNode.value = '正在导入..';
	}
	sendDataReturnText(this,'/iotxtschemaimportaction?schemaconstpk='+schemaConstPK,dataForm,null,function(msgNode){if(msgNode!=null){msgNode.value='导入完毕';}},msgNode,null,null,true);
}


function onclickgroupcolor(obj,tableId,start, fundaccount,tradeno,fundcode,agentno,sharetype,flag){
	var tablerows = tableId.rows;  //此处table的ID属性为tableId
	var row;
	if(flag == 1){
		ruleDiv.style.display = "none";
	}else{	
	for (j = start; j < tablerows.length; j++)
	{
			if(tablerows(j).cells(11).innerText==fundaccount&&tablerows(j).cells(0).innerText==tradeno&&tablerows(j).cells(8).innerText==fundcode&&tablerows(j).cells(6).innerText==agentno&&tablerows(j).cells(7).innerText==sharetype ){
				for(q = 0;q<6;q++){
					tablerows(j).cells(q).bgColor="#f5f5f5";
				}
					tradenoa.innerText= tablerows(j).cells(0).innerText; 
					fundnamea.innerText= tablerows(j).cells(2).innerText; 
					currentshatesa.innerText=tablerows(j).cells(3).innerText; 
					practicableshatesa.innerText=tablerows(j).cells(4).innerText; 
					ungain1a.innerText=tablerows(j).cells(5).innerText; 
					
					agentnoa.innerText=tablerows(j).cells(6).innerText; 
					sharetypea.innerText=tablerows(j).cells(7).innerText; 
					fundcodea.innerText=tablerows(j).cells(8).innerText; 
					bonustypea.innerText=tablerows(j).cells(9).innerText; 											
					frozenshatesa.innerText=tablerows(j).cells(10).innerText; 
					fundaccounta.innerText=tablerows(j).cells(11).innerText; 
					tacustnoa.innerText=tablerows(j).cells(12).innerText; 
		
				ruleDiv.style.left=event.clientX+10;         
				ruleDiv.style.top=event.clientY+10;		
				ruleDiv.style.display = "block";							
		}else{
				for(q = 0;q<6;q++){
					tablerows(j).cells(q).bgColor="#ffffff";
				}			
		}

	}
	}	
}


function onclickgroupcolor2(obj,tableId,start, fundaccount,tradeno,fundcode,agentno,sharetype,flag){
	var tablerows = tableId.rows;  //此处table的ID属性为tableId
	var row;
	if(flag == 1){
		ruleDiv.style.display = "none";
	}else{	
	for (j = start; j < tablerows.length; j++)
	{
			if(tablerows(j).cells(9).innerText==fundaccount&&tablerows(j).cells(10).innerText==tradeno&&tablerows(j).cells(6).innerText==fundcode&&tablerows(j).cells(11).innerText==agentno&&tablerows(j).cells(12).innerText==sharetype ){
				for(q = 0;q<6;q++){
					tablerows(j).cells(q).bgColor="#f5f5f5";
				}
					fundnamea.innerText=  tablerows(j).cells(0).innerText;                            
					bonustypea.innerText=  tablerows(j).cells(1).innerText;                           
					currentshatesa.innerText=  tablerows(j).cells(2).innerText;                       
					practicableshatesa.innerText= tablerows(j).cells(3).innerText;                    
					ungain1a.innerText= tablerows(j).cells(4).innerText;                              
					fundvaluea.innerText=  tablerows(j).cells(5).innerText;                           
					fundcodea.innerText= tablerows(j).cells(6).innerText;                             
					sharetypea.innerText=  tablerows(j).cells(7).innerText;                           
					frozenshatesa.innerText= tablerows(j).cells(8).innerText;  
		
				ruleDiv.style.left=event.clientX+10;         
				ruleDiv.style.top=event.clientY+10;		
				ruleDiv.style.display = "block";							
		}else{
				for(q = 0;q<6;q++){
					tablerows(j).cells(q).bgColor="#ffffff";
				}			
		}

	}
	}	
}

function onclickgroupcolor3(obj,tableId,start, index,flag){
	var tablerows = tableId.rows;  //此处table的ID属性为tableId
	var row;
	//alert(index);
	if(flag == 1){
		ruleDiv.style.display = "none";
	}else{	
	for (j = start; j < tablerows.length; j++)
	{
			if(tablerows(j).cells(7).innerText==index){
				for(q = 0;q<7;q++){
					tablerows(j).cells(q).bgColor="#f5f5f5";
				}
				tradenoa.innerText=  tablerows(j).cells(0).innerText;                                                                                     
				fundaccounta.innerText= tablerows(j).cells(1).innerText;                                                                                  
				businesscodea.innerText= tablerows(j).cells(2).innerText;                                                                                 
				fundnamea.innerText= tablerows(j).cells(3).innerText;                                                                                     
				confirmbalancea.innerText=tablerows(j).cells(4).innerText;                                                                               
				confirmsharesa.innerText= tablerows(j).cells(5).innerText;                                                                                
				tracomfirmdatea.innerText=tablerows(j).cells(6).innerText;                                                                   
				                                                                                                              
				taserialnoa.innerText=tablerows(j).cells(7).innerText; 											
				agentnoa.innerText= tablerows(j).cells(8).innerText;                                                             
				sharetypea.innerText=tablerows(j).cells(9).innerText;                                                               
				fundcodea.innerText= tablerows(j).cells(10).innerText;                                                                
				netvaluea.innerText= tablerows(j).cells(11).innerText;                                                                
				appsheetserialnoa.innerText= tablerows(j).cells(12).innerText;                                                        
				bonustypea.innerText=  tablerows(j).cells(13).innerText;                                                              
				tradefarea.innerText=tablerows(j).cells(14).innerText;                                                                
				otherfundaccounta.innerText= tablerows(j).cells(15).innerText;                                                        
				otherbranchnoa.innerText=  tablerows(j).cells(16).innerText;                                                          
				otherfundcodea.innerText=tablerows(j).cells(17).innerText; 	                                                
				memoa.innerText=tablerows(j).cells(18).innerText;
		
				ruleDiv.style.left=event.clientX+10;         
				ruleDiv.style.top=event.clientY+10;		
				ruleDiv.style.display = "block";								
		}else{
				for(q = 0;q<7;q++){
					tablerows(j).cells(q).bgColor="#ffffff";
				}			
		}

	}
	}	
}


function onclickgroupcolor4(obj,tableId,start, index,flag){
	var tablerows = tableId.rows;  //此处table的ID属性为tableId
	var row;
	//alert(index);
	if(flag == 1){
		ruleDiv.style.display = "none";
	}else{	
	for (j = start; j < tablerows.length; j++)
	{
			if(tablerows(j).cells(7).innerText==index){
				for(q = 0;q<7;q++){
					tablerows(j).cells(q).bgColor="#f5f5f5";
				}
				tradenoa.innerText=  tablerows(j).cells(0).innerText;                                                                                     
				fundaccounta.innerText= tablerows(j).cells(1).innerText;                                                                                  
				businesscodea.innerText= tablerows(j).cells(2).innerText;                                                                                 
				fundnamea.innerText= tablerows(j).cells(3).innerText;                                                                                     
				confirmbalancea.innerText=tablerows(j).cells(4).innerText;                                                                               
				confirmsharesa.innerText= tablerows(j).cells(5).innerText;                                                                                
				tracomfirmdatea.innerText=tablerows(j).cells(6).innerText;                                                                   
				                                                                                                              
				taserialnoa.innerText=tablerows(j).cells(7).innerText; 											
				agentnoa.innerText= tablerows(j).cells(8).innerText;                                                             
				sharetypea.innerText=tablerows(j).cells(9).innerText;                                                               
				fundcodea.innerText= tablerows(j).cells(10).innerText;                                                                
				netvaluea.innerText= tablerows(j).cells(11).innerText;                                                                
				appsheetserialnoa.innerText= tablerows(j).cells(12).innerText;                                                        
				bonustypea.innerText=  tablerows(j).cells(13).innerText;                                                              
				tradefarea.innerText=tablerows(j).cells(14).innerText;                                                                
				otherfundaccounta.innerText= tablerows(j).cells(15).innerText;                                                        
				otherbranchnoa.innerText=  tablerows(j).cells(16).innerText;                                                          
				otherfundcodea.innerText=tablerows(j).cells(17).innerText; 	                                                
				memoa.innerText=tablerows(j).cells(18).innerText;
		
				ruleDiv.style.left=event.clientX+10;         
				ruleDiv.style.top=event.clientY+10;		
				ruleDiv.style.display = "block";					
		}else{
				for(q = 0;q<7;q++){
					tablerows(j).cells(q).bgColor="#ffffff";
				}			
		}

	}
	}	
}

function onclickgroupcolor5(obj,tableId,start, index,date,flag){
	var tablerows = tableId.rows;  //此处table的ID属性为tableId
	var row;
	//alert(index);
	if(flag == 1){
		ruleDiv.style.display = "none";
	}else{	
	for (j = start; j < tablerows.length; j++)
	{
			if(tablerows(j).cells(11).innerText == index && tablerows(j).cells(0).innerText==date ){
				for(q = 0;q<8;q++){
					tablerows(j).cells(q).bgColor="#f5f5f5";
				}
					transactiondatea.innerText=tablerows(j).cells(0).innerText; 
					tradenoa.innerText=tablerows(j).cells(1).innerText; 
					fundaccounta.innerText=tablerows(j).cells(2).innerText;      
					businesscodea.innerText=tablerows(j).cells(3).innerText;      
					fundnamea.innerText=tablerows(j).cells(4).innerText;      
					  
					applicationamounta.innerText=tablerows(j).cells(5).innerText;      
					applicationvola.innerText=tablerows(j).cells(6).innerText;      
					statusaaa.innerText=tablerows(j).cells(7).innerText;      		
					sharetypea.innerText=tablerows(j).cells(8).innerText;      		
					fundcodea.innerText=tablerows(j).cells(9).innerText;      
					bonustypea.innerText=tablerows(j).cells(10).innerText;      
					appsheetserialnoa.innerText=tablerows(j).cells(11).innerText;      
					originalappsheetnoa.innerText=tablerows(j).cells(12).innerText;      
					discountrateofcommissiona.innerText=	tablerows(j).cells(13).innerText;      
					otherfundcodea.innerText=tablerows(j).cells(14).innerText;      
					othersharetypea.innerText=tablerows(j).cells(15).innerText;      				
					otherfundaccounta.innerText=tablerows(j).cells(16).innerText;      
					frozencausea.innerText=tablerows(j).cells(17).innerText;      
					largeredemptionflaga.innerText=tablerows(j).cells(18).innerText;      		
					tranctiontypea.innerText=tablerows(j).cells(19).innerText;      
		
				ruleDiv.style.left=event.clientX+10;         
				ruleDiv.style.top=event.clientY+10;		
				ruleDiv.style.display = "block";							
		}else{
				for(q = 0;q<8;q++){
					tablerows(j).cells(q).bgColor="#ffffff";
				}			
		}

	}
	}	
}

function onclickgroupcolor6(obj,tableId,start,fundaccount,fundcode,bounusdate,taserialno,tradeno,flag){
		
	var tablerows = tableId.rows;  //此处table的ID属性为tableId
	var row;

	if(flag == 1){
		ruleDiv.style.display = "none";
	}else{	
	for (j = start; j < tablerows.length; j++)
	{
	

			if(tablerows(j).cells(0).innerText==fundaccount&&tablerows(j).cells(8).innerText==fundcode &&tablerows(j).cells(3).innerText==bounusdate && tablerows(j).cells(7).innerText==tradeno&& tablerows(j).cells(13).innerText==taserialno ){
				for(q = 0;q<7;q++){
					tablerows(j).cells(q).bgColor="#f5f5f5";
				}
					fundaccounta.innerText=tablerows(j).cells(0).innerText;
					fundnamea.innerText=tablerows(j).cells(1).innerText;
					fsharea.innerText=tablerows(j).cells(2).innerText;
					bounusdatea.innerText=tablerows(j).cells(3).innerText;
					dividendorsharea.innerText=tablerows(j).cells(4).innerText;
					dividendindeeda.innerText=tablerows(j).cells(5).innerText;
					dividendsharesa.innerText=tablerows(j).cells(6).innerText;
					
					tradenoa.innerText=tablerows(j).cells(7).innerText;
					fundcodea.innerText=tablerows(j).cells(8).innerText;
					sharetypea.innerText=tablerows(j).cells(9).innerText;
					agentnoa.innerText=tablerows(j).cells(10).innerText;
					registrationdatea.innerText=tablerows(j).cells(11).innerText;
					renetdatea.innerText=tablerows(j).cells(12).innerText;
		
				ruleDiv.style.left=event.clientX+10;         
				ruleDiv.style.top=event.clientY+10;		
				ruleDiv.style.display = "block";								
		}else{
				for(q = 0;q<7;q++){
					tablerows(j).cells(q).bgColor="#ffffff";
				}			
		}

	}
	}	
}

function VMLCurve(objDiv){
	
	this.objDiv = objDiv;				// obj
	this.toolTips    = "";				// 提示信息
	this.configXPerValue = 0;
    this.configYPerValue = 0;
    this.configXMinValue = 0;
    this.configYMinValue = 0; 
	
	this.OriginXValue = 0;				// 圆点坐标
	this.OriginYValue = 0;
	
	//定义区域参数
	this.group				= null;		// v:group
	this.n 					= 1			// 倍数
	this.gpWidth			= 700;		// Width
	this.gpHeight			= 350;		// Height
	
	this.configXTextLeft	= -10;		// 定义 X轴坐标值左边离坐标距离
	this.configXTextTop 	= 10;		// 定义 X轴坐标值上方离X轴的距离
	
	this.configYLeft 		= 60;		// 定义 Y轴距对象左边的距离
	this.configYTextRight	= 40;		// 定义 Y轴坐标值离Y轴右边的距离
	this.configYTextBottom 	= 5;		// 定义 Y轴坐标值离坐标下边距离
	
	//X轴值
	this.configXValue = new Array('一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月');
	//Y轴值
	this.configYValue = new Array('100','200','300','400','500','600','700','800','900','1000');
	
	// Init BackGround
	this.Background		= null;	
	this.bgColor		= "#C4E1FF";		// BackGround Color
	
	// Init ToolTip
	this.configToolLeft 			= 15;
	this.configToolTop				= 15;
	this.ToolTip 					= document.createElement("DIV");
	this.ToolTip.className 			= "ToolTip";
	this.ToolTip.id					= "ToolTip";
	this.ToolTip.style.zIndex 		= "100";
	this.ToolTip.style.position		= "absolute";
	this.ToolTip.style.display		= "none";
	this.ToolTip.innerHTML			= "";
	
	//设置点线的属性
	this.PointRadius = 5; 					//圆点的半径大小
	this.LineSize    = 2;                  	//线的大小
	this.PointColor  = "#FF6600";			//点的颜色
	this.LineColor   = "#FF6600";			//线的颜色
	
	this.Points = "";
	this.PreviousPointY = 0;
	this.PointsYCount   = 0;
 }

