//**************基本设置****************************
var strFrameFolder	= "img/";	//框架文件资源目录
var strFrameTarget	= "frm_main";		//菜单目标框架名称
var strHomeUrl		= "/";		//虚拟路径
var g_strParam		= location.href.split("?")[1];	//页面参数
g_strParam=g_strParam?g_strParam:"";
var g_browser		= (document.all)?0:1;	//浏览器类型
//**************显示隐藏左栏****************************
var strFrameLeft="";
function shiftLeft(){
	strFrameLeft=(strFrameLeft=="")?"none":"";
	document.getElementById("td_left").style.display=strFrameLeft;
}
function swapBarOver(obj){
	obj.src=strFrameFolder+(strFrameLeft==""?"barOpen_1.gif":"barClose_1.gif");
}
function swapBarOut(obj){
	obj.src=strFrameFolder+(strFrameLeft==""?"barOpen_0.gif":"barClose_0.gif");
}
//**************生成多级目录树**************
var arrLinkRoute = new Array();
function drawMenuTree(arrMenu){
	var i=0,j=0,k,intLayerAim=0,intLayer=0;
	var intTrId=0,intUrlId=0;
	var arrLayerRoute=new Array();
	var objMenu,objFolder;
	var strHtml;
	strHtml="<TABLE id='tbRumorMenu' border='0' cellspacing='0' cellpadding='1'>";
	for(i=0;i<arrMenu.length;i++){
		while(arrMenu[i][0]!=intLayer){
			if(arrMenu[i][0]>intLayer){
				strHtml+="<tr id=\"tr_folder\" name=\"tr_folder\" style=\"display:none\">";
				strHtml+="<td>&nbsp;</td>";
				strHtml+="<td><TABLE border=0 cellspacing=0 cellpadding=0>";
				arrLayerRoute[intLayer]=intTrId;
				intTrId++;
				intLayer++;
			}
			if(arrMenu[i][0]<intLayer){
				strHtml+="</table></td></tr>";
				intLayer--;
				arrLayerRoute[intLayer]=intTrId;
			}
		};
		if(arrMenu[i+1]!=null&&arrMenu[i+1][0]>intLayer){
			strHtml+="<tr onclick=expandItem("+intTrId+")>";
			strHtml+="<td width=20><img id=\"pic_icon\" name=\"pic_icon\" src='"+strFrameFolder+"close.gif'></td>";
			}
		else{
			strHtml+="<tr>";
			strHtml+="<td width=20><img src='"+strFrameFolder+"file.gif'></td>";
		}
		strHtml+="<td valign=bottom>";
		switch(arrMenu[i].length)
		{
		case 4:
			strHtml+="<a class=\"menuNormal\" href=\""+arrMenu[i][2]+"\" id=\"url_link\" name=\"url_link\" target=\""+strFrameTarget+"\" title=\""+arrMenu[i][3]+"\" onclick=\"turn('正在连接到"+arrMenu[i][1]+"');setMenuActive("+intUrlId+")\">";
			arrLinkRoute[intUrlId]=new Array();
			for(k=0;k<intLayer;k++){
				arrLinkRoute[intUrlId][k]=arrLayerRoute[k];
			}
			intUrlId++;
			break;
		case 3:
			strHtml+="<a class=\"menuNormal\" href=\""+arrMenu[i][2]+"\" id=\"url_link\" name=\"url_link\" target=\""+strFrameTarget+"\" onclick=\"turn('正在连接到"+arrMenu[i][1]+"');setMenuActive("+intUrlId+")\">";
			arrLinkRoute[intUrlId]=new Array();
			for(k=0;k<intLayer;k++){
				arrLinkRoute[intUrlId][k]=arrLayerRoute[k];
			}
			intUrlId++;
			break;
		case 2:
			strHtml+="<a style=\"cursor:default\">";
			break;
		default:
			break;
		}
		strHtml+=arrMenu[i][1]+"</a></td></tr>";
	}	
	strHtml+="</TABLE>";
	while(intLayerAim>0){
		strHtml+="</td></tr></table>";
		intLayerAim--;
	};
	document.write(strHtml);
}
//**************展开关闭多级目录树节点****************************
function expandItem(i){
	var objTr=document.getElementsByName("tr_folder");
	var objPic=document.getElementsByName("pic_icon");
	if(objTr[i].style.display=="none"){
		objTr[i].style.display="";
		objPic[i].src=strFrameFolder+"open.gif";
	}else{
		objTr[i].style.display="none";
		objPic[i].src=strFrameFolder+"close.gif";
	}
}
//**************展开关闭多级目录树****************************
var intMenuExpand=0;
function expandMenus(){
	intMenuExpand=intMenuExpand?0:1;
	var strTrStyle=intMenuExpand?"":"none";
	var strPicIcon=intMenuExpand?"open.gif":"close.gif";
	var strPicFile="";
	var objTr=document.getElementsByName("tr_folder");
	var objPic=document.getElementsByName("pic_icon");
	for(var i=0;i<objTr.length;i++){
		objTr[i].style.display=strTrStyle;
		objPic[i].src=strFrameFolder+strPicIcon;
	}
}
function swapMenuOver(obj){
	obj.src=strFrameFolder+(intMenuExpand?"menuOpen_1.gif":"menuClose_1.gif");
}
function swapMenuOut(obj){
	obj.src=strFrameFolder+(intMenuExpand?"menuOpen_0.gif":"menuClose_0.gif");
}
//**************打开目录目标链接****************************
var intMenuActive=-1;
function setMenuActive(i){
	if(intMenuActive==i)return;
	var obj=document.getElementsByName("url_link");
	if(intMenuActive>-1)obj[intMenuActive].className="menuNormal";
	obj[i].className="menuActive";
	intMenuActive=i;
}
//**************设置父目录树选项活动**************************
//形如：setFrameActive(url,param)
function setFrameActive(){
	try{var intParentActive=parent.intMenuActive;}catch(e){return;}
	var argv=setFrameActive.arguments;
	var argc=setFrameActive.arguments.length;
	var strUrl=location.href;
	setCookie("strPageRefesh",strUrl);//设置刷新页cookie值
	strUrl=(argc>0)?path2url(argv[0]):strUrl.split("?")[0].toLowerCase();
	if(argc>1&&argv[1]!="")strUrl+="?"+argv[1].toLowerCase();
	//搜索目录树活动节点
	var obj=parent.document.getElementsByName("url_link");
	for(var i=0;i<obj.length;i++){
		if(obj[i].href.toLowerCase()==strUrl)break;
	}
	if(i==obj.length)return;
	//设置目录树选项样式
	if(intParentActive!=i){
		if(intParentActive>-1)obj[intParentActive].className="menuNormal";
		obj[i].className="menuActive";
		parent.intMenuActive=i;
	}
	//展开木录树节点
	var objTr=parent.document.getElementsByName("tr_folder");
	var objPic=parent.document.getElementsByName("pic_icon");
	for(var j=0;j<parent.arrLinkRoute[i].length;j++){
		objTr[parent.arrLinkRoute[i][j]].style.display="";
		objPic[parent.arrLinkRoute[i][j]].src=strFrameFolder+"open.gif";
	}
}
function setFrameRefresh(url){
	var strUrl=getCookie("strPageRefesh");
	strUrl=(strUrl)?strUrl:url;
	if(strUrl)
		document.getElementById(strFrameTarget).src=strUrl;
	else
		turn("您好，欢迎光临",0);		
}
//**************绝对路径转化为url*********************
//例：/a/c.asp->http://www.abc.com/a/c.asp**
function path2url(str){
	if(str=="")return(location.href.split("?")[0].toLowerCase());
	str=str.toLowerCase();
	if(str.substr(0,7)!="http://")str="http://"+location.host+strHomeUrl+str;
	return str;
}
//**************生成父框架子菜单****************************
function drawMenu(arrMenu){
	var strHtml="<table border='0' cellspacing='0' cellpadding='0'><tr>";
	for(var i=0;i<arrMenu.length;i++){
		strHtml+="<td>";
		if(i)strHtml+="　";
		switch (arrMenu[i].length)
		{
		case 1:
			strHtml+="<span id=\"span_title\">"+arrMenu[i][0]+"</span>";
			break;
		case 2:
			strHtml+="<a href='"+arrMenu[i][1]+"' target='"+strFrameTarget+"' onclick=turn('正在连接到"+arrMenu[i][0]+"')>"+arrMenu[i][0]+"</a>";
			break;
		case 3:
			strHtml+="<a href='"+arrMenu[i][1]+"' target='"+strFrameTarget+"' onclick=turn('正在连接到"+arrMenu[i][0]+"') title='"+arrMenu[i][2]+"'>"+arrMenu[i][0]+"</a>";
			break;
		default:		
			break;
		}
		strHtml+="</td><td";
		if(i<arrMenu.length-1)strHtml+=" ";
		strHtml+="></td>";
	}	
	try{
		parent.document.getElementById("td_menu").innerHTML = strHtml+"</tr></table>";
	}catch(e){}	
}
//**************生成提示信息****************************
function turn(str){
	var argv=turn.arguments;
	var argc=turn.arguments.length;
	var mode=(argc>1)?argv[1]:1;
	var strHtml="";	
	if(mode)str+="……";
	strHtml+="<table border='0' cellspacing='0' cellpadding='0'><tr>";
	if(mode)strHtml+="<td ><img src='"+strFrameFolder+"link.gif'></td>";
	strHtml+="<td background='"+strFrameFolder+"menu_back.gif'><span id=\"span_title\">"+str+"</span></td>";
	strHtml+="<td></td></tr></table>";   
	try{
		parent.document.getElementById("td_menu").innerHTML=strHtml;
	}catch(e){}
}
//**************JavaScript的Cookies函数库************************
//参数：名称，值，天数，路径，domain，是否保密传送
function setCookie(name, value, expires, path, domain, secure){
	var strCookie = name + "=" + value;
	if (expires){
		var dtmNow = new Date();
		dtmNow.setTime(dtmNow.getTime() + expires*24*60*60*1000);
		strCookie += "; expires=" + dtmNow.toGMTString();
	}
	strCookie +=  (path) ? "; path=" + path : "";
	strCookie +=  (domain) ? "; domain=" + domain : "";
	strCookie +=  (secure) ? "; secure" : "";
	top.document.cookie = strCookie;
}
// 使用名称参数取得Cookie值, null表示Cookie不存在
function getCookie(name){	
	var strCookies = document.cookie;
	var cookieName = name + "=";
	var intBegin, intEnd, strValue;
	intBegin = strCookies.indexOf(cookieName);
	if (intBegin == -1) return null;
	intEnd = strCookies.indexOf(";", intBegin);
	if (intEnd == -1) intEnd = strCookies.length;  // 最後一个Cookie
	strValue = strCookies.substring(intBegin+cookieName.length,intEnd);
	return strValue;
}
// 删除Cookie,设置Cookie的期限为己过期
function deleteCookie(name, path, domain){
	var strCookie;
	if (getCookie(name)){
		strCookie = name + "="; 
		strCookie += (path) ? "; path=" + path : "";
		strCookie += (domain) ? "; domain=" + domain : "";
		strCookie += "; expires=Thu, 01-Jan-70 00:00:01 GMT";
		top.document.cookie = strCookie;
	}
}
//*******************************************
//				其它通用JS函数
//*******************************************
String.prototype.trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/g, "");
}
//**************字符串编码**********
// 转化为Url字符串
function encodeUrl(str){
	var strUrl=str.replace(/\r/g,"%0A");
	strUrl=strUrl.replace(/\n/g,"%0D");
	strUrl=strUrl.replace(/\x2B/g,"%2B");
	strUrl=strUrl.replace(/\x20/g,"+");
	strUrl=strUrl.replace(/\x3F/g,"%3F");	
	strUrl=strUrl.replace(/&/g,"%26");
	strUrl=strUrl.replace(/\\/g,"%5C");
	strUrl=strUrl.replace(/\"/g,"%22");
	strUrl=strUrl.replace(/\'/g,"%27");
	return strUrl;
}
// 转化为Html字符串
function encodeHtml(str){
	var strHtml=str.replace(/\r/g,"&#13;");
	strHtml=strHtml.replace(/\n/g,"&#10;");
	strHtml=strHtml.replace(/\"/g,"&#34;");
	strHtml=strHtml.replace(/\'/g,"&#39;");
	return strHtml;
}
//**************QUERY_STRING 参数传递**************
function ridParam(strParam,strRid){
	strRid=strRid.toLowerCase();
	var arrParam=strParam.split("&");
	var j=arrParam.length;
	if(strParam=="")j=-1;
	var paramRid="";
	for(var i=0;i<j;i++){
		if(arrParam[i].toLowerCase().indexOf(strRid+"=")!=0){
			if(paramRid!="")paramRid+="&";
			paramRid+=arrParam[i];
		}
	}
	return paramRid;
}
function addParam(strParam,strAdd,value){
	strAdd=strAdd.toLowerCase();
	var arrParam=strParam.split("&");
	var j=arrParam.length;
	if(strParam=="")j=-1;
	var paramAdd="";
	for(var i=0;i<j;i++){
		if(arrParam[i].toLowerCase().indexOf(strAdd+"=")!=0){
			paramAdd+=arrParam[i]+"&";
		}
	}
	return (paramAdd+strAdd+"="+value);
}
//**************通用页面控件**************
// 绘制翻页
function drawPaging(rsCount,pageSize,pageCount,pageNo){
	with(document){
		write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td>页次：");
		write(pageNo+"/"+pageCount+" 每页："+pageSize+" 记录数："+rsCount);
		write("</td><td align=\"right\">");
		var intFrom=pageNo-5;
		if(intFrom<1)intFrom=1;
		var intTo=intFrom+10;
		if(intTo>pageCount){
			intTo=pageCount;
			if(pageCount>10)
				intFrom=intTo-10;
			else
				intFrom=1;
		}
		write("分页："	);
		if(intFrom>1)
			write("<a href=\"?"+encodeHtml(addParam(g_strParam,"page",1))+"\"><<</a> ");
		for(var i=intFrom;i<=intTo;i++){
			if(i==pageNo)
				write("<font class=\"highlight\">"+i+"</font> ");
			else
				write("<a href=\"?"+encodeHtml(addParam(g_strParam,"page",i))+"\" onclick=\"turn('正在翻页');\">"+i+"</a> ");
		}
		if(intTo<pageCount){
			write("<a href=\"?"+encodeHtml(addParam(g_strParam,"page",pageCount))+"\">>></a> ");
		}
		write("转到：<input type=\"text\" size=4 id=\"objPageNo\" style=\"text-align:center\" value=\""+pageNo+"\" ");
		write("onkeydown=\"if(event.keyCode==13){turn('正在翻页');location.replace('?'+addParam(g_strParam,'page',this.value));}\">");
		write("<input type=\"button\" value=\"GO\" onclick=\"turn('正在翻页');location.replace('?'+addParam(g_strParam,'page',getElementById('objPageNo').value));\">");
		write("</td></tr></table>");
	}
}
// 绘制搜索框，默认搜索本页
var g_strSearchUrl="";
function drawSearching(searchKey,searchInfo,strParam){
	with(document){
	write("<input type=\"text\" size=20 id=\"objSearchKey\" title=\""+encodeHtml(searchInfo)+"\" value=\""+encodeHtml(searchKey)+"\" ");
	write("onkeydown=\"if(event.keyCode==13){turn('正在搜索');location.replace(g_strSearchUrl+'?'+addParam(g_strParam,'search',this.value));}\"> ");
	write("<input type=\"button\" value=\"搜　索\" onclick=\"turn('正在搜索');location.replace(g_strSearchUrl+'?'+addParam(g_strParam,'search',getElementById('objSearchKey').value));\">");
	}
}
// 绘制选择页面参数按钮
function drawClass(classType,classInfo,strParam){
	var arrClass=classInfo.split(",");
	var j=arrClass.length;
	with(document){
	for(var i=0;i<j;i++){
		if(arrClass[i]!=""){
			write("<input type=\"radio\" name=\"objClassType\" onclick=\"turn('正在切换');location.replace('?'+addParam(g_strParam,'class',"+i+"));\"");
			if(i==classType)write(" checked");
			write(">"+arrClass[i]+" ");
		}
	}
	}
}
// 绘制用户组列表
function drawGroup(dic,intGroup){
	with(document){
		for(var i=0;i<dic.length;i++){
			write("<input type=\"radio\" name=\"objUserGroup\" onclick=\"turn('正在切换');location.replace('?'+addParam(g_strParam,'group',"+dic[i][2]+"));\"");
			if(intGroup==parseInt(dic[i][2]))write(" checked");
			write(">"+dic[i][1]+" ");
		}
		write("<input type=\"radio\" name=\"objUserGroup\" onclick=\"turn('正在切换');location.replace('?'+addParam(g_strParam,'group',0));\"");
		if(!intGroup)write(" checked");
		write(">默认组");

	}
}
// 绘制选项卡按钮
function showTbody(type){
	var obj=document.getElementsByName("objTbody");
	for(var i=0;i<obj.length;i++){
		if(i==type)obj[i].style.display="inline";
		else obj[i].style.display="none";
	}
}
function drawTbody(tbodyList){
	with(document){
		for(var i=0;i<tbodyList.length;i++){
			write("<input type=\"radio\" name=\"objTbodyType\" onclick=\"showTbody("+i+")\"");
			if(i==0)write(" checked");
			write(">"+tbodyList[i]+" ");
		}
	}
}
// drawSelect用
function getRoute(dic,value,mode){
	var strRoute,intDepth=-1;
	for(var i=dic.length-1;i>-1;i--){
		if(intDepth>-1){
			if(intDepth==0)	return(strRoute);
			if(dic[i][0]<intDepth){
				strRoute=i+","+strRoute;
				intDepth--;
			}
		}else{
			if(dic[i][mode]==value){
				strRoute=i.toString();
				intDepth=dic[i][0];
			}
		}
	}
	return(strRoute);
}
// drawSelect用
function getRoutes(dic,route,mode){
	var strRoute="",depth=0;
	var arrRoute=route.split(",");
	var intDepth=arrRoute.length-1;
	for(var i=0;i<dic.length;i++){
		if(dic[i][mode]==arrRoute[depth]){
			if(strRoute)strRoute+=","+i;
			else strRoute=i.toString();
			if(depth==intDepth)return(strRoute);
			else depth++;
		}
	}
	return(strRoute);
}
// 绘制多级连动下拉菜单
function drawSelect(obj,dicName){
	var argv=drawSelect.arguments;
	var argc=drawSelect.arguments.length;
	var mode=(argc>2)?argv[2]:0;
	var name=(argc>3)?argv[3]:"";
	var value=(argc>4)?argv[4]:"";
	var tips=(argc>5)?argv[5]:"";
	var prop=(argc>6)?argv[6]:"";
	
	var dic=eval(dicName),objValue="";
	switch(mode){
		case 0:value=getRoute(dic,value,2);mode=5;break;
		case 1:value=getRoutes(dic,value,1);mode=6;break;
		case 2:value=getRoute(dic,value,1);mode=7;break;
		case 3:value=getRoutes(dic,value,2);mode=8;break;
	}
	var strRoute="",arrRoute=new Array();
	if(value)arrRoute=value.split(",");
	var strHtml="",arrHtml=new Array();
	var intDepth,strTitle,strValue,j,selDepth=0;
	for(var i=0;i<dic.length;i++){
		intDepth=dic[i][0];strTitle=dic[i][1];strValue=dic[i][2];
		if(intDepth==selDepth){	
			if(arrHtml[selDepth]==null){
				arrHtml[selDepth]="<select onChange={drawSelect(this.parentNode,\""+dicName+"\","+mode+",\""+name+"\",this.value,\""+tips+"\",\""+prop+"\")} "+prop+">";
				if(tips){
					if(selDepth)arrHtml[selDepth]+="<option value=\""+strRoute+"\">"+tips+"</option>";
					else arrHtml[selDepth]+="<option value=\"\">"+tips+"</option>";
					if(arrRoute[selDepth]==null)arrRoute[selDepth]=-1;
				}else if(arrRoute[selDepth]==null)arrRoute[selDepth]=i;
			}
			if(i==arrRoute[selDepth]){
				arrHtml[selDepth]+="<option value=\""+strRoute+i.toString()+"\" selected>"+strTitle+"</option>";
				selDepth++;
				strRoute+=i.toString()+",";
				switch(mode){
					case 5:objValue=strValue;break;
					case 6:if(objValue)objValue+=","+strTitle;else objValue=strTitle;break;
					case 7:objValue=strTitle;break;
					case 8:if(objValue)objValue+=","+strValue;else objValue=strValue;break;
				}
			}else{
				arrHtml[selDepth]+="<option value=\""+strRoute+i.toString()+"\">"+strTitle+"</option>";
			}
		}else if(intDepth<selDepth){
			selDepth=intDepth;
			strRoute="";
			for(j=0;j<selDepth;j++)strRoute+=arrRoute[j]+",";
			arrHtml[selDepth]+="<option value=\""+strRoute+i.toString()+"\">"+strTitle+"</option>";
		}
	}
	for(i=0;i<arrHtml.length;i++){
		strHtml+=arrHtml[i]+"</select>";
	}
	strHtml+="<input type=\"hidden\" value=\""+encodeHtml(objValue)+"\" name=\""+name+"\" id=\""+name+"\">";
	if(obj==null)document.write("<span>"+strHtml+"</span>");
	else obj.innerHTML=strHtml;
}
// 绘制目录树下拉菜单
function drawTreeOption(dic,value,name){
	var intDepth,strTitle,strValue,i,j;
	name=(name)?name:"";
	with(document){
		write("<option value=\"0\">╋ 所有"+name+"</option>");
		for(i=0;i<dic.length;i++){
			intDepth=dic[i][0];strTitle=dic[i][1];strValue=dic[i][2];
			write("<option value=\""+encodeHtml(strValue)+"\"");
			if(value==strValue)write(" selected");
			write(">");
			for(j=0;j<intDepth;j++){
				write("　");
			}
			if(intDepth)
				write("├ ");
			else
				write("╋ ");
			write(strTitle+"</option>");
		}
		if(value=="-1")write("<option value=\"-1\" selected>╋ 其它"+name+"</option>");
		else write("<option value=\"-1\">╋ 其它"+name+"</option>");
	}
}
// drawSelIdName用
function setIdName(name,lngId,strName){
	if(window.opener){
		window.opener.document.getElementById(name).value=lngId;
		window.opener.document.getElementById(name+"_fonshen_strName").value=strName;
		window.close();
	}
}
// 绘制获取ID,NAME组
function drawSelIdName(name,url,features,lngId,strName,prop){
	features=(features)?features:"width=720,height=500";
	lngId	=(lngId)?lngId:0;
	strName	=(strName)?strName:"";
	prop	=(prop)?prop:"";
	var arrUrl=url.split("?");
	var strUrl=(arrUrl[1])?arrUrl[1]:"";
	strUrl	=arrUrl[0]+"?"+addParam(strUrl,"name",name);
	document.write("<input type=\"hidden\" name=\""+name+"\" id=\""+name+"\" value=\""+lngId+"\">");
	document.write("<input type=\"text\" name=\""+name+"_fonshen_strName\" id=\""+name+"_fonshen_strName\" value=\""+strName+"\" onclick={window.open(\""+strUrl+"\",\"\",\""+features+"\");} readonly"+prop+">");
}
//**************通用页面功能**************
// 验证浏览限制格式文件
function loadFile(obj,fileType){
	var strPath=obj.value.toLowerCase();
	var strExt=strPath.substr(strPath.length-4,4).replace(/./,"/")+"/";
	var strType="/"+fileType.toLowerCase()+"/";
	if(strType.indexOf(strExt)==-1){
		obj.outerHTML=obj.outerHTML;
		alert("仅可选择 "+fileType+" 文件");
	}
}
// 验证手工编号输入字母和数字
function isErrorIDStr(str){
	return(/[^A-Z0-9]/.test(str));
}
// 输入排序数字
function setSort(obj){
	var intNum=window.prompt("请输入序号(整数)：","0");
	if(intNum!=null){
		intNum=parseInt(intNum);
		if(isNaN(intNum))
			alert("不是整数,无效的输入");
		else{
			turn("正在执行排序");
			obj.href+="&sortTo="+intNum;
			return true;
		}	
	}
	return false;
}
//**************尚未整理******************
function drawRootItem(dic,value){
	for(var i=0;i<dic.length;i++){
		if(dic[i][0]==0){
			document.write("<option value=\""+encodeHtml(dic[i][2])+"\"");
			if(dic[i][2]==value)document.write(" selected");
			document.write(">"+dic[i][1]+"</option>");	
		}
	}
}
function getTitle(dic,id){
	for(var i=0;i<dic.length;i++){
		if(dic[i][2]==id)return(dic[i][1]);
	}
	return("其他");
}
// 绘制当前位置导航value形如Untitled
function drawRoute(dic,value,mode,url,target,arrow){
	mode=(mode)?mode:2;
	url=(url)?url:"?diid=";
	target=(target)?" target=\""+target+"\"":"";
	arrow=(arrow)?arrow:" &gt ";
	var strRoute="",intDepth=-1;
	for(var i=dic.length-1;i>-1;i--){
		if(intDepth>-1){
			if(intDepth==0)break;
			if(dic[i][0]<intDepth){
				strRoute=arrow+"<a href=\""+url+dic[i][mode]+"\""+target+">"+dic[i][1]+"</a>"+strRoute;
				intDepth--;
			}
		}else{
			if(dic[i][mode]==value){
				strRoute=arrow+dic[i][1];
				intDepth=dic[i][0];
			}
		}
	}
	document.write(strRoute);
}
function drawword(num,strid){
	var str;
	for(i=65;i<91;i++){
		str=String.fromCharCode(i);
		if(i==num)
			document.write ("<option value='"+str+strid+"' selected>"+str+"</option>");
		else
			document.write ("<option value='"+str+strid+"' >"+str+"</option>");
	}
}
function viewItem(objs,value){
	try{
	for(var i=0;i<objs.length;i++)
		objs[i].style.display=value;
	}catch(e){}
}
function route2top(route){
	return(route.substring(0,route.lastIndexOf("|")));
}
function getDicTitle(dic,route){
	var dicItem,title="";
	route=route2top(route);
	for(var i=dic.length-1;i>-1;i--){
		dicItem=dic[i].split(",");
		if(dicItem[2]==route+"|"){
			if(title!="")title=","+title;
			title=dicItem[1]+title;
			route=route2top(route);
			if(route2top(route)=="")return(title);
		}
	}
	return(title);
}
function drawPlace(dic,key,value,strParam){
	var arrRoute=value.split("|");
	var dicItem,j=1,l=arrRoute.length-1,k=0;
	if(l<2)return k;
	var strRoute=arrRoute[0]+"|"+arrRoute[1]+"|";
	for(var i=0;i<dic.length;i++){
		dicItem=dic[i].split(",");
		if(dicItem[2]==strRoute){
			k++;
			document.write(" -> <a href=\"?"+paramAdd(strParam,key,dicItem[2])+"\">"+dicItem[1]+"</a>");
			j++;
			if(j==l)return k;
			strRoute+=arrRoute[j]+"|";
		}
	}
	return k;
}
function drawSonItem(dic,key,value,strParam){
	var dicItem,i=0;j=0,k=0;
	if(value!="")
	for(i=0;i<dic.length;i++){
		dicItem=dic[i].split(",");
		if(dicItem[2]==value){
			j=parseInt(dicItem[0])+1;
			i++;
			break;
		}
	}
	for(;i<dic.length;i++){
		dicItem=dic[i].split(",");
		if(dicItem[0]==j){
			document.write("<a href=\"?"+paramAdd(strParam,key,dicItem[2])+"\" class=\""+key+"List\">"+dicItem[1])+"</a>";
			k++;
		}else if(dicItem[0]<j)return k;
	}
	return k;
}
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }
