//基础AJAX
var net=new Object();
net.READY_STATE_UNINITIALIZED=0;
net.READY_STATE_LOADING=1;
net.READY_STATE_LOADED=2;
net.READY_STATE_INTERACTIVE=3;
net.READY_STATE_COMPLETE=4;
net.ContentLoader=function(http_url,onload,onerror)
{
	this.http_url=http_url;
	this.req=null;
	this.onload=onload;
	this.onerror=(onerror)?onerror:this.defaultError;	
	this.loadXMLDoc(http_url);
}
net.ContentLoader.prototype=
{
	loadXMLDoc:function(http_url)
	{
		if(window.XMLHttpRequest)
		{
			this.req=new XMLHttpRequest();
		}
		else if(window.ActiveXObject)
		{
			this.req=new ActiveXObject("Microsoft.XMLHTTP");
		}
		if(this.req)
		{
			try
			{
				var loader=this;
				this.req.onreadystatechange=function()
				{
					loader.onReadyState.call(loader);					
				}
				this.req.open('GET',http_url,true);
				this.req.send(null);				
			}
			catch(err)
			{
				this.onerror.call(this);
			}//end try
		}//end if
	},	
	onReadyState:function()
	{
		var req=this.req;
		var ready=req.readyState;
		if(ready==net.READY_STATE_COMPLETE)
		{
			var httpStatus=req.status;
			if(httpStatus==200 || httpStatus==0)
			{
				this.onload.call(this);
			}
			else
			{
				this.onerror.call(this);
			}//end if
		}//end if		
	},
	defaultError:function()
	{
		alert("网页获取数据错误!"
			+"\n\nreadyState:"+this.req.readyState
			+"\nstatus:"+this.req.status
			+"\nheaders:"+this.req.getAllResponseHeaders());
	}
}//end net

//树结构
// Node object
function Node(id, pid, name, itemUrl, title, target,UrlisClickEvent,recordCount, icon, iconOpen, open) {
	this.id = id;
	this.pid = pid;
	this.name = name;
	this.itemUrl = itemUrl;
	this.title = title;
	this.target = target;
	this.urlisclickevent=UrlisClickEvent;	
	if(recordCount)
		this.recordcount=recordCount;
	else
		this.recordcount="0";
	this.icon = icon;
	this.iconOpen = iconOpen;
	this._io = open || false;
	this._is = false;
	this._ls = false;
	this._hc = false;
	this._ai = 0;
	this._p;
};

// Tree object
function dTree(objName) {
	this.config = {
		target					: null,
		urlisclickevent	:false,		
		folderLinks			: true,
		useSelection		: true,
		useCookies			: true,
		useLines				: true,
		useIcons				: true,
		useStatusText		: false,
		closeSameLevel	: false,
		inOrder					: false
	}
	this.icon = {
		root				: '/allf/tree/rootdown.gif',
		folder			: '/allf/tree/folder.gif',
		folderOpen	: '/allf/tree/folderopen.gif',
		node				: '/allf/tree/page.gif',
		empty				: '/allf/tree/empty.gif',
		line				: '/allf/tree/line.gif',
		join				: '/allf/tree/join.gif',
		joinBottom	: '/allf/tree/joinbottom.gif',
		plus				: '/allf/tree/plus.gif',
		plusBottom	: '/allf/tree/plusbottom.gif',
		minus				: '/allf/tree/minus.gif',
		minusBottom	: '/allf/tree/minusbottom.gif',
		nlPlus			: '/allf/tree/nolines_plus.gif',
		nlMinus			: '/allf/tree/nolines_minus.gif'
	};
	this.obj = objName;
	this.aNodes = [];
	this.aIndent = [];
	this.root = new Node(-1);
	this.selectedNode = null;
	this.selectedFound = false;
	this.completed = false;
	this.showRoot=true;
};

// append a new node to the node array
dTree.prototype.add = function(id, pid, name, itemUrl, title, target,UrlisClickEvent,recordCount, icon, iconOpen, open) {
	this.aNodes[this.aNodes.length] = new Node(id, pid, name, itemUrl, title, target,UrlisClickEvent,recordCount, icon, iconOpen, open);
};

// Open/close all nodes
dTree.prototype.openAll = function() {
	this.oAll(true);
};
dTree.prototype.closeAll = function() {
	this.oAll(false);
};

// Outputs the tree to the page
dTree.prototype.toString = function() {
	var str = '<div class="dtree">\n';
	if (document.getElementById) {
		if (this.config.useCookies) this.selectedNode = this.getSelected();
		str += this.addNode(this.root);
	} else str += 'Browser not supported.';
	str += '</div>';
	if (!this.selectedFound) this.selectedNode = null;
	this.completed = true;
	return str;
};

// 树变化,在toString之前调用本函数,避免ls的break影响
dTree.prototype.dataChanged = function() {
	var eOld;
	var n=0;	
	for(n;n<this.aNodes.length; n++) 
	{
		this.aNodes[n]._ls=false;
		this.aNodes[n]._is=false;
	}	
	this.selectedNode=null;
	this.selectedFound=false;
	this.completed=false;	
};

// Creates the tree structure
dTree.prototype.addNode = function(pNode) {
	var str = '';
	var n=0;
	if (this.config.inOrder) n = pNode._ai;
	for (n; n<this.aNodes.length; n++) {
		if (this.aNodes[n].pid == pNode.id) {
			var cn = this.aNodes[n];
			cn._p = pNode;
			cn._ai = n;
			this.setCS(cn);
			if (!cn.target && this.config.target) cn.target = this.config.target;			
			if (!cn.urlisclickevent && this.config.urlisclickevent) cn.urlisclickevent = this.config.urlisclickevent;			
			if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
			if (!this.config.folderLinks && cn._hc) cn.itemUrl = null;
			if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {
					cn._is = true;
					this.selectedNode = n;
					this.selectedFound = true;
			}
			str += this.node(cn, n);
			if (cn._ls) break;
		}
	}
	return str;
};

// Creates the node icon, itemUrl and text
dTree.prototype.node = function(node, nodeId) {
	var str='<div class="dTreeNode"';	
	if(!this.showRoot && nodeId==0)
			str+=" style='height:0'";
	str+=">" + this.indent(node, nodeId);
	if (this.config.useIcons) {
		if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
		if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
		if (this.root.id == node.pid) {
			node.icon = this.icon.root;
			node.iconOpen = this.icon.root;
		}
		if(this.showRoot || nodeId!=0)
				str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';
	}
	if (node.itemUrl) {
		
		str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node')+'"';
		if(!node.urlisclickevent)
			str+=' href="' + node.itemUrl + '"';		
		if (node.title) str += ' title="' + node.title + '"';
		if (node.target) str += ' target="' + node.target + '"';
		if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" ';
		if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))
		{
			str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');';
			if(node.urlisclickevent)
			{
				str+=node.itemUrl;
				str +='" style="cursor:hand"';
			}
			else
			{
				str +='"';
			}//end if
		}
		else if(node.urlisclickevent)
		{
			str+=' onclick="javascript: ' + node.itemUrl + '" style="cursor:hand"';			
		}
		str += '>';
	}
	else if ((!this.config.folderLinks || !node.itemUrl) && node._hc && node.pid != this.root.id)
		str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
	if(this.showRoot || nodeId!=0)
			str += node.name;
	if (node.itemUrl || ((!this.config.folderLinks || !node.itemUrl) && node._hc)) str += '</a>';
	str += '</div>';
	if (node._hc) {
		str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';
		str += this.addNode(node);
		str += '</div>';
	}
	this.aIndent.pop();
	return str;
};

// Adds the empty and line icons
dTree.prototype.indent = function(node, nodeId) {
	var str = '';
	if (this.root.id != node.pid) {
		for (var n=0; n<this.aIndent.length; n++)
			str += '<img src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />';
		(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
		if (node._hc) {
			str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
			if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
			else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
			str += '" alt="" /></a>';
		} else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />';
	}
	return str;
};

// Checks if a node has any children and if it is the last sibling
dTree.prototype.setCS = function(node) {
	var lastId;
	for (var n=0; n<this.aNodes.length; n++) {
		if (this.aNodes[n].pid == node.id) node._hc = true;
		if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;
	}
	if (lastId==node.id) node._ls = true;
};

// Returns the selected node
dTree.prototype.getSelected = function() {
	var sn = this.getCookie('cs' + this.obj);
	return (sn) ? sn : null;
};

// Highlights the selected node
dTree.prototype.s = function(id) {
	if (!this.config.useSelection) return;
	var cn = this.aNodes[id];
	if (cn._hc && !this.config.folderLinks) return;
	if (this.selectedNode != id) {
		if (this.selectedNode || this.selectedNode==0) {
			eOld = document.getElementById("s" + this.obj + this.selectedNode);
			if(eOld)
				eOld.className = "node";
		}		
		eNew = document.getElementById("s" + this.obj + id);		
		eNew.className = "nodeSel";
		this.selectedNode = id;
		if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id);
	}
};

// Toggle Open or close
dTree.prototype.o = function(id) {
	var cn = this.aNodes[id];
	this.nodeStatus(!cn._io, id, cn._ls);
	cn._io = !cn._io;
	if (this.config.closeSameLevel) this.closeLevel(cn);
	if (this.config.useCookies) this.updateCookie();
};

// Open or close all nodes
dTree.prototype.oAll = function(status) {
	for (var n=0; n<this.aNodes.length; n++) {
		if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {
			this.nodeStatus(status, n, this.aNodes[n]._ls)
			this.aNodes[n]._io = status;
		}
	}
	if (this.config.useCookies) this.updateCookie();
};

// Opens the tree to a specific node
dTree.prototype.openTo = function(nId, bSelect, bFirst) {
	if (!bFirst) {
		for (var n=0; n<this.aNodes.length; n++) {
			if (this.aNodes[n].id == nId) {
				nId=n;
				break;
			}
		}
	}
	var cn=this.aNodes[nId];
	if (cn.pid==this.root.id || !cn._p) return;
	cn._io = true;
	cn._is = bSelect;
	if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
	if (this.completed && bSelect) this.s(cn._ai);
	else if (bSelect) this._sn=cn._ai;
	this.openTo(cn._p._ai, false, true);
};

// Closes all nodes on the same level as certain node
dTree.prototype.closeLevel = function(node) {
	for (var n=0; n<this.aNodes.length; n++) {
		if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {
			this.nodeStatus(false, n, this.aNodes[n]._ls);
			this.aNodes[n]._io = false;
			this.closeAllChildren(this.aNodes[n]);
		}
	}
}

// Closes all children of a node
dTree.prototype.closeAllChildren = function(node) {
	for (var n=0; n<this.aNodes.length; n++) {
		if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {
			if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);
			this.aNodes[n]._io = false;
			this.closeAllChildren(this.aNodes[n]);		
		}
	}
}

// Change the status of a node(open or closed)
dTree.prototype.nodeStatus = function(status, id, bottom) {
	eDiv	= document.getElementById('d' + this.obj + id);
	eJoin	= document.getElementById('j' + this.obj + id);
	if (this.config.useIcons) {
		eIcon	= document.getElementById('i' + this.obj + id);
		eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
	}
	eJoin.src = (this.config.useLines)?
	((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):
	((status)?this.icon.nlMinus:this.icon.nlPlus);
	eDiv.style.display = (status) ? 'block': 'none';
};


// [Cookie] Clears a cookie
dTree.prototype.clearCookie = function() {
	var now = new Date();
	var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
	this.setCookie('co'+this.obj, 'cookieValue', yesterday);
	this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
};

// [Cookie] Sets value in a cookie
dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {
	document.cookie =
		escape(cookieName) + '=' + escape(cookieValue)
		+ (expires ? '; expires=' + expires.toGMTString() : '')
		+ (path ? '; path=' + path : '')
		+ (domain ? '; domain=' + domain : '')
		+ (secure ? '; secure' : '');
};

// [Cookie] Gets a value from a cookie
dTree.prototype.getCookie = function(cookieName) {
	var cookieValue = '';
	var posName = document.cookie.indexOf(escape(cookieName) + '=');
	if (posName != -1) {
		var posValue = posName + (escape(cookieName) + '=').length;
		var endPos = document.cookie.indexOf(';', posValue);
		if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
		else cookieValue = unescape(document.cookie.substring(posValue));
	}
	return (cookieValue);
};

// [Cookie] Returns ids of open nodes as a string
dTree.prototype.updateCookie = function() {
	var str = '';
	for (var n=0; n<this.aNodes.length; n++) {
		if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
			if (str) str += '.';
			str += this.aNodes[n].id;
		}
	}
	this.setCookie('co' + this.obj, str);
};

// [Cookie] Checks if a node id is in a cookie
dTree.prototype.isOpen = function(id) {
	var aOpen = this.getCookie('co' + this.obj).split('.');
	for (var n=0; n<aOpen.length; n++)
		if (aOpen[n] == id) return true;
	return false;
};

// If Push and pop is not implemented by the browser
if (!Array.prototype.push) {
	Array.prototype.push = function array_push() {
		for(var i=0;i<arguments.length;i++)
			this[this.length]=arguments[i];
		return this.length;
	}
};
if (!Array.prototype.pop) {
	Array.prototype.pop = function array_pop() {
		lastElement = this[this.length-1];
		this.length = Math.max(this.length-1,0);
		return lastElement;
	}
};

//其它功能
function CanFoundSubStrNoCase(strSource,strFind)
{		
		var strTemp=strSource.toUpperCase();
		var strTempFind=strFind.toUpperCase();		
		if(strTemp.indexOf(strTempFind)>=0)
				return true;
		else
				return false;
}

function StrIsInt(Argstr)  //错误返回－1，正确则返回数值
 {
    var i,j,c,val,k;
    j=Argstr.length;
    if(j<1)
       return -1;   //如果字符串长度是0，那肯定不是数值。
    val=0
    for(i=0;i<j;i++)
    {
        c=Argstr.substr(i,1);
        if (!((c >="0")&&(c<="9")))
           return -1;
        k=c - "0";
        val=val + k * (Math.pow(10,(j-i-1))); //得到数值
    }
    return val;
 }
 function GetDateTimeFromString(strDateTime,strDateSep,strTimeSep,strDateTimeSep) //缺省格式:YYYY-MM-DD HH:mm:SS,可无时间,错误返回null,正确返回Date对象
 {
 		if(strDateSep==null)
 				strDateSep="-";
 		if(strTimeSep==null)
 				strTimeSep=":";
 		if(strDateTimeSep==null)
 				strDateTimeSep=" ";
 		if(strDateTime==null || strDateTime=="")
 				return null;
 		var nY,nM,nD,nH,nMi,nS,arrDT,arrTemp;
 		arrDT=strDateTime.split(strDateTimeSep);
 		if(arrDT.length<1 || arrDT.length>2)
 				return null;
 		arrTemp=arrDT[0].split(strDateSep);
 		if(arrTemp.length!=3)
 				return null;
 		nY=parseInt(arrTemp[0]);
 		if(isNaN(nY) || nY<1000 || nY>9999)
 				return null;
 		nM=parseInt(arrTemp[1]);
 		if(isNaN(nM) || nM<1 || nM>12)
 				return null;
 		nD=parseInt(arrTemp[2]);
 		if(isNaN(nD) || nD<1 || nD>31)
 				return null;
 		if(arrDT.length==2)
 		{
 				arrTemp=arrDT[1].split(strTimeSep);
		 		if(arrTemp.length!=3)
		 				return null;
		 		nH=parseInt(arrTemp[0]);
		 		if(isNaN(nH) || nH<0 || nH>23)
		 				return null;
		 		nMi=parseInt(arrTemp[1]);
		 		if(isNaN(nMi) || nMi<0 || nMi>59)
		 				return null;
		 		nS=parseInt(arrTemp[2]);
		 		if(isNaN(nS) || nS<0 || nS>59)
		 				return null;
		}
 		else
 		{
 				nH=0;
 				nMi=0;
 				nS=0;
 		}
 		var dtResult=new Date(nY,nM-1,nD,nH,nMi,nS,0);
 		return dtResult;		
 }
 function GetStringFromDateTime(dtArg,strDateSep,strTimeSep,strDateTimeSep) //缺省格式:YYYY-MM-DD HH:mm:SS,返回相应串,错误返空串
 {
 		var strResult="";
 		if(dtArg==null)
 				return "";
 		if(strDateSep==null)
 				strDateSep="-";
 		if(strTimeSep==null)
 				strTimeSep=":";
 		if(strDateTimeSep==null)
 				strDateTimeSep=" ";
 		try
 		{ 				
 				strResult=(dtArg.getFullYear()).toString();
 				strResult+=strDateSep;
 				strResult+=(dtArg.getMonth()+1).toString();
 				strResult+=strDateSep;
 				strResult+=(dtArg.getDate()).toString();
 				var nH=dtArg.getHours();
 				var nMi=dtArg.getMinutes();
 				var nS=dtArg.getSeconds();
 				if(nH!=0 || nMi!=0 || nS!=0)
 				{
 						strResult+=strDateTimeSep;
 						strResult+=nH.toString();
 						strResult+=strTimeSep;
 						strResult+=nMi.toString();
 						strResult+=strTimeSep;
 						strResult+=nS.toString(); 						
 				}
 		}
 		catch(ex)
 		{
 				strResult="";
 		}
 		return strResult;
 }
 function GotoPageRightNow(strCountValue,strFileName)
 {
     if(document.forms("GotoPageForm").item("GotoPage").value=="")
     {
         alert("请输入您要跳转的页码数值，跳转页码不能为空。");
         document.forms("GotoPageForm").elements("GotoPage").focus();
         return false;
     }
     if(-1==StrIsInt(document.forms("GotoPageForm").item("GotoPage").value))
     {
         alert("输入的跳转页码数据必须是数值，请您输入正整数作为跳转页码。");
         document.forms("GotoPageForm").elements("GotoPage").focus();
         return false;
     }
     if(StrIsInt(document.forms("GotoPageForm").item("GotoPage").value)<1 || StrIsInt(document.forms("GotoPageForm").item("GotoPage").value)>StrIsInt(strCountValue))
     {
         alert("跳转页码必须在1和" + strCountValue +"之间，请重新输入正确的跳转页码数值。");
         document.forms("GotoPageForm").elements("GotoPage").focus();
         return false;
     }
     if(strFileName.indexOf("?")>=0)
     		window.location.href=strFileName+"&PageTo=" + document.forms("GotoPageForm").item("GotoPage").value;
     else
     		window.location.href=strFileName+"?PageTo=" + document.forms("GotoPageForm").item("GotoPage").value;
     return false; //用于阻止onsubmit方式的提交
 } 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0 参数为 控件名称,?,要替换进来的图象src,控件名称,?,要替换进来的图象src,...
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ButtonMouseOut(obj)
{
   obj.bgColor="#dbdbdb";
}
function ButtonMouseOver(obj)
{
   obj.bgColor="#eaeaea";
}

function BarMouseOut(obj,nHotColIndex)
{
   obj.bgColor="#e0e0e0";
   if(nHotColIndex==null)
   		obj.cells(1).bgColor="#dbdbdb";
   else
   		obj.cells(nHotColIndex).bgColor="#dbdbdb";
}
function BarMouseOver(obj,nHotColIndex)
{
   obj.bgColor="#E7EBF7";
   if(nHotColIndex==null)
   		obj.cells(1).bgColor="#C6DBF7";
   else
   		obj.cells(nHotColIndex).bgColor="#C6DBF7";   	
}

function NoHotBarMouseOut(obj)
{
   obj.bgColor="#e0e0e0";   
}
function NoHotBarMouseOver(obj)
{
   obj.bgColor="#E7EBF7";   
}

function DeleteSelInfo(strDealURL,strOpTipInfo,strDealWhatInfo,strMoreTipInfo)
{
		 var strShowTipInfo;
     var strAllSel;
     document.forms("InfoDoSearchForm").item("SelectedToDelInfos").value="";     
     for (var i=0;i<document.forms("InfoDoSearchForm").elements.length;i++)
     {
        var e = document.forms("InfoDoSearchForm").elements[i];
        if (e.name == 'InfoToDelete')
        {        	 
           if(e.checked)
           {
              bAnySel=true;
              strAllSel=document.forms("InfoDoSearchForm").item("SelectedToDelInfos").value;
              if(strAllSel!="")
                 strAllSel+=",";
              strAllSel+=e.value; //以,分隔多个选项
              document.forms("InfoDoSearchForm").item("SelectedToDelInfos").value=strAllSel;
           }
        }
     }
     if(document.forms("InfoDoSearchForm").item("SelectedToDelInfos").value=="")
     {
     		strShowTipInfo="请选择至少一条";     		
     		if(strDealWhatInfo!=null)
	   	 			strShowTipInfo+=strDealWhatInfo;
	   	 	else
	   	 			strShowTipInfo+="信息记录";     		
     		strShowTipInfo+=",没有任何选择时不能";
     		if(strOpTipInfo!=null)
     				strShowTipInfo+=strOpTipInfo;
     		else
     				strShowTipInfo+="删除";
     		strShowTipInfo+="选中记录。";
        alert(strShowTipInfo);
        return false;
     }
     strShowTipInfo="您真的确认要";
     if(strOpTipInfo!=null)
   				strShowTipInfo+=strOpTipInfo;
   	 else
   				strShowTipInfo+="删除";
   	 strShowTipInfo+="这些选中的";
   	 if(strDealWhatInfo!=null)
   	 			strShowTipInfo+=strDealWhatInfo;
   	 else
   	 			strShowTipInfo+="信息记录";
   	 strShowTipInfo+="吗？";   	 
   	 if(strMoreTipInfo!=null)
   	 			strShowTipInfo+=strMoreTipInfo;
     if(!confirm(strShowTipInfo))  return false;
     document.forms("InfoDoSearchForm").action=strDealURL;
     document.forms("InfoDoSearchForm").submit();
} 
function DoArticleConfirm(strType,strDealURL)
{
     var strAllSel;
     document.forms("InfoDoSearchForm").item("SelectedToDelInfos").value="";     
     for (var i=0;i<document.forms("InfoDoSearchForm").elements.length;i++)
     {
        var e = document.forms("InfoDoSearchForm").elements[i];
        if (e.name == 'InfoToDelete')
        {        	 
           if(e.checked)
           {
              bAnySel=true;
              strAllSel=document.forms("InfoDoSearchForm").item("SelectedToDelInfos").value;
              if(strAllSel!="")
                 strAllSel+=",";
              strAllSel+=e.value; //以,分隔多个选项
              document.forms("InfoDoSearchForm").item("SelectedToDelInfos").value=strAllSel;
           }
        }
     }
     if(document.forms("InfoDoSearchForm").item("SelectedToDelInfos").value=="")
     {
        alert("请选择至少一条信息记录,没有任何选择时不能进行审批或取消审批。");     
        return false;
     }
     if(strType=="Y")
     {
     		if(!confirm("您真的确认要审批选中这些的信息记录吗？"))  
     			return false;
     }
     else
     {
     		if(!confirm("您真的确认要取消这些选中信息记录的审批状态吗？"))
     			return false;
     }
     document.forms("InfoDoSearchForm").action=strDealURL;
     document.forms("InfoDoSearchForm").submit();
}
 
 function CheckAllInfo()
 {
    for (var i=0;i<document.forms("InfoDoSearchForm").elements.length;i++)
    {
        var e = document.forms("InfoDoSearchForm").elements[i];
        if (e.name == 'InfoToDelete')
            e.checked = document.forms("InfoDoSearchForm").CheckAll.checked;
     }
} 
function DoAddInfo(strInputURL)
{    
    document.location.href=strInputURL;
}
function DoArticleInfoCopyOrMove(strType)
{ 
	  if(strType!="C" && strType!="M")
	  {
	  		alert("参数错误");
	  		return false;
	  }
	  alert("用对话框收集参数并处理");
}
function GotoNewURL(strOpenNewWindow,strURL)
{
	if(strOpenNewWindow=="Y")
		window.open(strURL,new Date().getTime());
	else
		document.location.href=strURL;
}
function GotoMPageButton(strEnableNow,strIndexValue,strFileName)
{
	if(strEnableNow!="Y") return false;
	var nGoto=StrIsInt(strIndexValue);
 	if(nGoto<1) return false;
 	if(nGoto>1)
   		window.location.href=strFileName+"p" + strIndexValue+".htm";
   else
   		window.location.href=strFileName+".htm";	
}
function GotoMPageRightNow(strCountValue,strFileName)
{
     if(document.forms("GotoMPageForm").item("GotoMPage").value=="")
     {
         alert("请输入您要跳转的页码数值，跳转页码不能为空。");
         document.forms("GotoMPageForm").elements("GotoMPage").focus();
         return false;
     }
     var nGoto=StrIsInt(document.forms("GotoMPageForm").item("GotoMPage").value);     
     if(-1==nGoto)
     {
         alert("输入的跳转页码数据必须是数值，请您输入正整数作为跳转页码。");
         document.forms("GotoMPageForm").elements("GotoMPage").focus();
         return false;
     }
     var nPCount=StrIsInt(strCountValue);
     if(nGoto<1 || nGoto>nPCount)
     {
         alert("跳转页码必须在1和" + strCountValue +"之间，请重新输入正确的跳转页码数值。");
         document.forms("GotoMPageForm").elements("GotoMPage").focus();
         return false;
     }
     if(nGoto>1)
     		window.location.href=strFileName+"p" + document.forms("GotoMPageForm").item("GotoMPage").value+".htm";
     else
     		window.location.href=strFileName+".htm";     	
     return false; //阻止提交
}
var showDlgProcessindex=0;
function ShowDlgProcessColorText(){
	var objShowTable=document.getElementById("ShowContentTableID");
  if(showDlgProcessindex==0) objShowTable.innerHTML="<table border=0 class='ft_md_bk_bd' width=100% height=320><tr><td align='center' valign='middle'><font color=#800000>数据库操作中,请等待...</font></td></tr></table>";
  if(showDlgProcessindex==1) objShowTable.innerHTML="<table border=0 class='ft_md_bk_bd' width=100% height=320><tr><td align='center' valign='middle'><font color=#FF0000>数据库操作中,请等待...</font></td></tr></table>";
  if(showDlgProcessindex==2) objShowTable.innerHTML="<table border=0 class='ft_md_bk_bd' width=100% height=320><tr><td align='center' valign='middle'><font color=#008000>数据库操作中,请等待...</font></td></tr></table>";
  if(showDlgProcessindex==3) objShowTable.innerHTML="<table border=0 class='ft_md_bk_bd' width=100% height=320><tr><td align='center' valign='middle'><font color=#000060>数据库操作中,请等待...</font></td></tr></table>";
  if(showDlgProcessindex==4) objShowTable.innerHTML="<table border=0 class='ft_md_bk_bd' width=100% height=320><tr><td align='center' valign='middle'><font color=#0000A0>数据库操作中,请等待...</font></td></tr></table>";
  if(showDlgProcessindex==5) objShowTable.innerHTML="<table border=0 class='ft_md_bk_bd' width=100% height=320><tr><td align='center' valign='middle'><font color=#0000FF>数据库操作中,请等待...</font></td></tr></table>";
  if(showDlgProcessindex==6) objShowTable.innerHTML="<table border=0 class='ft_md_bk_bd' width=100% height=320><tr><td align='center' valign='middle'><font color=#000080>数据库操作中,请等待...</font></td></tr></table>";
  if(showDlgProcessindex==7) objShowTable.innerHTML="<table border=0 class='ft_md_bk_bd' width=100% height=320><tr><td align='center' valign='middle'><font color=#008000>数据库操作中,请等待...</font></td></tr></table>";
  if(showDlgProcessindex==8) objShowTable.innerHTML="<table border=0 class='ft_md_bk_bd' width=100% height=320><tr><td align='center' valign='middle'><font color=#FF0000>数据库操作中,请等待...</font></td></tr></table>";
  if(showDlgProcessindex==9) objShowTable.innerHTML="<table border=0 class='ft_md_bk_bd' width=100% height=320><tr><td align='center' valign='middle'><font color=#000000>数据库操作中,请等待...</font></td></tr></table>";  
  showDlgProcessindex++;
  if(showDlgProcessindex>9) showDlgProcessindex=0;
}
function SetDlgProcessFunc()
{
	window.setInterval("ShowDlgProcessColorText()",300);
}
//智能等比微缩图片JS方法
//参数：objIMG（传入this,如<IMG onload='....'>调用函数）
//参数：maxWidth（图片的最大宽度，值为0则表示不限制宽度）
//参数：maxHeight（图片的最大高度，值为0则表示不限制高度）
function setImgSize(objIMG,maxWidth,maxHeight)
{
	if(objIMG==null)
		return false;
	if(maxWidth<1)
	{
		if(objIMG.height>maxHeight)
		{
			objIMG.height=maxHeight;
		}
		return true;
	}
	if(maxHeight<1)
	{
		if(objIMG.width>maxWidth)
		{
			objIMG.width=maxWidth;
		}
		return true;
	}
	if(objIMG.height>maxHeight || objIMG.width>maxWidth)
	{
		if((objIMG.height / maxHeight) > (objIMG.width / maxWidth))
		{
			objIMG.height=maxHeight;
		}
		else
		{
			objIMG.width=maxWidth;
		}
		return true;
	}
}
//分行翻页函数
function fhfy_goto_next_page(strFirstID,nIndexNow,nMaxPageIndex)
{
		if(nIndexNow>=nMaxPageIndex)
				return false;
		var nTemp=nIndexNow+1;
		var strTemp="p"+strFirstID+"_"+nTemp.toString();		
		var objNowActTR=document.getElementById("p"+strFirstID+"_"+nIndexNow.toString());
		if(objNowActTR==null)
				return false;
		objNowActTR.style.display="none";
		objNowActTR=document.getElementById(strTemp);
		if(objNowActTR==null)
				return false;
		objNowActTR.style.display="block";
}
function fhfy_goto_last_page(strFirstID,nIndexNow,nMaxPageIndex)
{
		if(nIndexNow>=nMaxPageIndex)
				return false;		
		var strTemp="p"+strFirstID+"_"+nMaxPageIndex.toString();
		var objNowActTR=document.getElementById("p"+strFirstID+"_"+nIndexNow.toString());
		if(objNowActTR==null)
				return false;
		objNowActTR.style.display="none";
		objNowActTR=document.getElementById(strTemp);
		if(objNowActTR==null)
				return false;
		objNowActTR.style.display="block";
}
function fhfy_goto_prev_page(strFirstID,nIndexNow)
{
		if(nIndexNow<=0)
				return false;
		var nTemp=nIndexNow-1;
		var strTemp="p"+strFirstID+"_"+nTemp.toString();
		var objNowActTR=document.getElementById("p"+strFirstID+"_"+nIndexNow.toString());
		if(objNowActTR==null)
				return false;
		objNowActTR.style.display="none";
		objNowActTR=document.getElementById(strTemp);
		if(objNowActTR==null)
				return false;
		objNowActTR.style.display="block";
}
function fhfy_goto_first_page(strFirstID,nIndexNow)
{
		if(nIndexNow<=0)
				return false;		
		var strTemp="p"+strFirstID+"_0";
		var objNowActTR=document.getElementById("p"+strFirstID+"_"+nIndexNow.toString());
		if(objNowActTR==null)
				return false;
		objNowActTR.style.display="none";
		objNowActTR=document.getElementById(strTemp);
		if(objNowActTR==null)
				return false;
		objNowActTR.style.display="block";
}

//政务搜索跳转
function DealLocalSearchBarBtnFunc()
{	
		var objValue=document.getElementById("LocalSearchBarKeyword");
		if(objValue==null)
		{
				alert('意外错误,关键词不存在!');
				return false;
		}
		var strTemp="/zwzrss.htm?";
		strTemp+=objValue.value;
		document.location.href=strTemp;
}

//新的简洁菜单
function MM_findObjByID(objName)
{
  if(document.getElementById)
		return eval('document.getElementById("'+objName+'")');
	else
		return eval('document.all.'+objName);
}

function MM_showHideLayers(strIDName,bToShow)
{ //v6.0
  var obj;  
  if((obj=MM_findObjByID(strIDName))!=null)
  {
  	if(bToShow)
    	obj.style.visibility="visible";
    else
    	obj.style.visibility="hidden";
  }
}

function MM_ChangeItemBgColor(objCur,bTransparent)
{
	if(bTransparent)
		objCur.style.backgroundColor="transparent";
	else
		objCur.style.backgroundColor="#d1ddec";
}

function DealDirectGotoPage(objSelect,strCurPageIndex,strURLNoPageToArg)
{
		if(strURLNoPageToArg=="" || objSelect.options[objSelect.selectedIndex].value==strCurPageIndex)	
				return false;		
		if(strURLNoPageToArg.indexOf(".")<0)
		{
				if(objSelect.options[objSelect.selectedIndex].value=="1")
						document.location.href=strURLNoPageToArg+".htm";
				else
						document.location.href=strURLNoPageToArg+"p" + objSelect.options[objSelect.selectedIndex].value + ".htm";
		}
		else
		{		
				if(strURLNoPageToArg.indexOf("?")>0)
		     		document.location.href=strURLNoPageToArg+"&PageTo=" + objSelect.options[objSelect.selectedIndex].value;
		     else
		     		document.location.href=strURLNoPageToArg+"?PageTo=" + objSelect.options[objSelect.selectedIndex].value;
		}//end if
}

function AddToBookMark()
{
		var strTitle=document.title;
		var strUrl=document.location.href;		
		if (window.sidebar)
		{				
				window.sidebar.addPanel(strTitle, strUrl,"");
		}
		else if( window.opera && window.print )
		{				
				var mbm = document.createElement('A');
				mbm.setAttribute('rel','sidebar');
				mbm.setAttribute('href',strUrl);
				mbm.setAttribute('title',strTitle);
				mbm.click();
		}
		else if( document.all ) 
		{				
				window.external.AddFavorite(strUrl,strTitle);
		}
}
