//2002-9-25\u4FEE\u6539\uFF0C\u6DFB\u52A0\u51FD\u6570checkstatus(),\u90E8\u5206\u51FD\u6570\u52A0\u5165\u662F\u5426\u9009\u62E9\u4E86\u6587\u6863\u7684\u5224\u65ADvar seperator=";";var fieldstart;var fieldcount;var fieldtotal;var fieldshowunread;var fieldshowselect;var fieldshowseq;var fieldaction;var fieldfolder;var fieldcollapsStatus;var fieldcollapsCategories;function chkIsEmpty(field, errMsg) { if(field && trim(field.value)=="") {  alert(errMsg);  field.focus();  field.select();  return true; } else return false;}function setCookie(cookieName,cvalue,expiredays,path){	var expireDate=new Date();	var expireStr="";	if(expiredays!=null) {		expireDate.setTime(expireDate.getTime()+(expiredays*24*3600*1000));		expireStr="; expires="+expireDate.toGMTString();	}	pathStr=(path==null)?"; path=/":"; path="+path;	document.cookie=cookieName+'='+escape(cvalue)+expireStr+pathStr;}function getCookie(cookieName){	var index=-1; 	if(document.cookie)  		index=document.cookie.indexOf(cookieName); 	if(index==-1) { 		return ""; 	} else { 	     var iBegin = (document.cookie.indexOf("=", index) +1);          var iEnd =document.cookie.indexOf(";", index);          if (iEnd == -1)          {              iEnd = document.cookie.length;          }          return unescape(document.cookie.substring(iBegin,iEnd));	}}function imgclick(nth,unid){	var pathname = (window.location.pathname);	var imgname;	var field=eval('document.forms[0].entry_'+nth);	var imgs=eval('document.img_'+nth);	if (field.value==unid)	{	imgname="checkoff.gif";		field.value="";	} else {		imgname="check.gif";		field.value=unid;	}	imgs.src=pathname.substring(0,(pathname.lastIndexOf(".nsf")+5))+imgname+'?OpenImageResource';}function appendElement(mylist,str){//\u5C06str\u8FFD\u52A0\u5230mylist\u4E2D	 return(mylist+((trim(mylist)==""||trim(str)=="")?"":seperator)+str);}function trim(str){   return str.replace(/^\s*/,'').replace(/\s*$/,'');}//\u83B7\u53D6\u4EE5substr\u5F00\u5934\u7684\uFF0Cseperator\u4E3A\u5206\u9694\u7B26\u7684\u53C2\u6570function getRef(str,start,substr,seperator){var pos;var endpos;pos=str.indexOf(substr,start);if (pos==-1) return "";endpos=str.indexOf(seperator,pos+1);if (endpos==-1)return str.substring(pos+substr.length,str.length);elsereturn str.substring(pos+substr.length,endpos);}function getRefValue(refstring,tag){//\u83B7\u53D6\u53C2\u6570	var pos1;	var pos2;	if (-1==(pos1=refstring.indexOf(tag))) return "";	if (-1==(pos2=refstring.indexOf("&",pos1+1))) pos2=refstring.length;	return(refstring.substring(pos1+tag.length,pos2));}function CheckAll(){	var elems=window.document.forms[0].elements;	for (var i=0;i<elems.length;i++)	{		if(elems[i].name.substring(0,6)=="entry_")		{		elems[i].checked=document.forms[0].chkall.checked;		}	}checkclick();}function CheckAll2(){	var field;	var i=0;	while (eval("field=document.forms[0].entry_"+(++i)))	{		field.checked=document.forms[0].chkall.checked;	}checkclick();}function doWithInput(){//\u672C\u51FD\u6570\u6E05\u9664\u90A3\u4E9Bhtml\u7684\u8F93\u5165\u57DF\uFF0C\u4EE5\u514Ddomino\u627E\u4E0D\u5230\u5BF9\u5E94\u7684notes\u57DF\u65F6\u51FA\u9519//\u540C\u65F6\uFF0C\u5C06\u9009\u62E9\u7684\u6587\u6863\u7684unid\u653E\u5165\u5230selctedEntries\u57DF\u4E2Dvar selected="";var elems=window.document.forms[0].elements;if (fieldshowselect.value=="on"){	//\u56E0\u4E3A\u5141\u8BB8\u7528\u6237\u4F7F\u7528\u590D\u9009\u6846\u9009\u62E9\uFF0C\u56E0\u6B64\u9700\u8981\u8FDB\u884C\u5904\u7406	for (var i=0;i<elems.length;i++)	{		if(elems[i].name.substring(0,6)=="entry_"&&elems[i].checked)		{			selected=appendElement(selected,elems[i].value);			//\u6E05\u9664\u6240\u6709\u5229\u7528javascript\u6DFB\u52A0\u7684\u8F93\u5165\u57DF\uFF0C\u4EE5\u514D\u63D0\u4EA4\u65F6\u51FA\u9519;			elems[i].checked=false;		}	}	document.forms[0].chkall.checked=false;	//\u5C06\u6240\u6709\u9009\u4E2D\u7684\u6587\u6863\u7684unid\u5B58\u653E\u5230selectedEntries\u57DF\u4E2D\uFF0C	//\u4EE5\u4F9Bwebquerysave\u4EE3\u7406\u5904\u7406	document.forms[0].selectedEntries.value=selected;}}function doWithInput2(){//\u672C\u51FD\u6570\u6E05\u9664\u90A3\u4E9Bhtml\u7684\u8F93\u5165\u57DF\uFF0C\u4EE5\u514Ddomino\u627E\u4E0D\u5230\u5BF9\u5E94\u7684notes\u57DF\u65F6\u51FA\u9519//\u540C\u65F6\uFF0C\u5C06\u9009\u62E9\u7684\u6587\u6863\u7684unid\u653E\u5165\u5230selctedEntries\u57DF\u4E2Dvar field;var i=0;var selected="";if (fieldshowselect.value=="on"){	//\u56E0\u4E3A\u5141\u8BB8\u7528\u6237\u4F7F\u7528\u590D\u9009\u6846\u9009\u62E9\uFF0C\u56E0\u6B64\u9700\u8981\u8FDB\u884C\u5904\u7406	while (eval("field=document.forms[0].entry_"+(++i)))	{		if (field.checked)		{			selected=appendElement(selected,field.value);			//\u6E05\u9664\u6240\u6709\u5229\u7528javascript\u6DFB\u52A0\u7684\u8F93\u5165\u57DF\uFF0C\u4EE5\u514D\u63D0\u4EA4\u65F6\u51FA\u9519;			field.checked=false;		}	}	document.forms[0].chkall.checked=false;	//\u5C06\u6240\u6709\u9009\u4E2D\u7684\u6587\u6863\u7684unid\u5B58\u653E\u5230selectedEntries\u57DF\u4E2D\uFF0C\u4EE5\u4F9Bwebquerysave\u4EE3\u7406\u5904\u7406	document.forms[0].selectedEntries.value=selected;}}//\u5224\u65AD\u7528\u6237\u662F\u5426\u9009\u62E9\u4E86\u6587\u6863\u3002function checkstatus(){	var field;	var i=0;	var flag=0;	while (eval("field=window.document.forms[0].entry_"+(++i)))	{		if (field.checked)		{			flag=1;			break;		}	}	return flag;}function removeclick(){if(checkstatus()==1) {if (confirm("\u5B8C\u5168\u5220\u9664\u540E\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u60A8\u786E\u8BA4\u662F\u5426\u7EE7\u7EED?"))	{	doWithInput();	fieldaction.value="remove";	document.forms[0].submit();	}}	else{alert('\u8BF7\u9009\u62E9\u8981\u5220\u9664\u7684\u6587\u6863\uFF01');}}function deleteclick(){if(checkstatus()==1) {	doWithInput();	fieldaction.value="move";	fieldfolder.value="($Trash)";	document.forms[0].submit();}	else{alert('\u8BF7\u9009\u62E9\u8981\u5220\u9664\u7684\u6587\u6863\uFF01');}}function moveclick(){if(checkstatus()==1) {	if (fieldfolder&&fieldfolder.value=="-1")	{	alert("\u8BF7\u60A8\u5148\u9009\u62E9\u9700\u8981\u79FB\u5165\u7684\u6587\u4EF6\u5939");	   	fieldfolder.focus();		return;	}	doWithInput();	fieldaction.value="move";	document.forms[0].submit();}	else{alert('\u8BF7\u9009\u62E9\u8981\u8F6C\u79FB\u7684\u6587\u6863\uFF01');}}function moveclick2(){if(checkstatus()==1) {	if (fieldfolder.value=="-1")	{	alert("\u8BF7\u60A8\u5148\u9009\u62E9\u9700\u8981\u79FB\u5165\u7684\u6587\u4EF6\u5939");	   	fieldfolder.focus();		return;	}	doWithInput();	fieldaction.value="move";	document.forms[0].submit();}	else{alert('\u8BF7\u9009\u62E9\u8981\u8F6C\u79FB\u7684\u6587\u6863\uFF01');}}function previouspage(){	var pathname=window.location.pathname;	var searchstr=window.location.search;	var viewname=getRefValue(searchstr,"&view=");	var start=parseInt(fieldstart.value);	var count=parseInt(fieldcount.value);	var total=parseInt(fieldtotal.value);	start=(start<=count)?1:start-count;	var showunread=(fieldshowunread.value!="on")?"&showunread=off":""	var showselect=(fieldshowselect.value!="on")?"&showselect=off":""	var showseq=(fieldshowseq.value!="on")?"&showseq=off":""	if (fieldcollapsStatus)	var collapsStatus=(fieldcollapsStatus.value=="all")?"&collapsStatus=all":""	if (fieldcollapsCategories) var collapsCategories=(collapsStatus=="" && fieldcollapsCategories.value!="") ? "&collapsCategories="+fieldcollapsCategories.value:""	window.location.href=pathname+"?openform&view=" + viewname + "&start="+start + "&count="+count + showunread+showselect+showseq+collapsStatus+collapsCategories;}function nextpage(){	var pathname=window.location.pathname;	var searchstr=window.location.search;	var viewname=getRefValue(searchstr,"&view=");	var start=parseInt(fieldstart.value);	var count=parseInt(fieldcount.value);	var total=parseInt(fieldtotal.value);	start=(start+count>total)?start:start+count;	var showunread=(fieldshowunread.value!="on")?"&showunread=off":""	var showselect=(fieldshowselect.value!="on")?"&showselect=off":""	var showseq=(fieldshowseq.value!="on")?"&showseq=off":""	if (fieldcollapsStatus)	var collapsStatus=(fieldcollapsStatus.value=="all")?"&collapsStatus=all":""	if (fieldcollapsCategories) var collapsCategories=(collapsStatus=="" && fieldcollapsCategories.value!="") ? "&collapsCategories="+fieldcollapsCategories.value:""	window.location.href=pathname+"?openform&view=" + viewname + "&start="+start + "&count="+count + showunread+showselect+showseq+collapsStatus+collapsCategories;}function expandCat(catName)//\u5C55\u5F00\u4E00\u4E2A\u5206\u7C7B{	var pathname=window.location.pathname;	var searchstr=window.location.search;	var viewname=getRefValue(searchstr,"&view=");	var start=parseInt(fieldstart.value);	var count=parseInt(fieldcount.value);	var total=parseInt(fieldtotal.value);	var showunread=(fieldshowunread.value!="on")?"&showunread=off":""	var showselect=(fieldshowselect.value!="on")?"&showselect=off":""	var showseq=(fieldshowseq.value!="on")?"&showseq=off":""	var strCats=','+fieldcollapsCategories.value+','	var strCat=','+catName+','	var nStart=strCats.indexOf(strCat)	var nEnd=nStart+strCat.length	var strRes=strCats.substring(0,nStart+1)+strCats.substring(nEnd,strCats.length)	strRes=strRes.substring(1,strRes.length-1)	fieldcollapsCategories.value=(strRes==',')?'':strRes	var collapsCategories=(fieldcollapsCategories.value!="")?"&collapsCategories="+fieldcollapsCategories.value:""	window.location.href=pathname+"?openform&view="+viewname+"&start="+start+"&count="+count+showunread+showselect+showseq+collapsCategories;}function collapsCat(catName)//\u6298\u53E0\u4E00\u4E2A\u5206\u7C7B{	var pathname=window.location.pathname;	var searchstr=window.location.search;	var viewname=getRefValue(searchstr,"&view=");	var start=parseInt(fieldstart.value);	var count=parseInt(fieldcount.value);	var total=parseInt(fieldtotal.value);	var showunread=(fieldshowunread.value!="on")?"&showunread=off":""	var showselect=(fieldshowselect.value!="on")?"&showselect=off":""	var showseq=(fieldshowseq.value!="on")?"&showseq=off":""	var collapsCategories="&collapsCategories="+((fieldcollapsCategories.value!="")?fieldcollapsCategories.value+','+catName:catName)	window.location.href=pathname+"?openform&view="+viewname+"&start="+start+"&count="+count+showunread+showselect+showseq+collapsCategories;}function expandAll()//\u5168\u90E8\u5C55\u5F00{	var pathname=window.location.pathname;	var searchstr=window.location.search;	var viewname=getRefValue(searchstr,"&view=");	var start=parseInt(fieldstart.value);	var count=parseInt(fieldcount.value);	var total=parseInt(fieldtotal.value);	var showunread=(fieldshowunread.value!="on")?"&showunread=off":""	var showselect=(fieldshowselect.value!="on")?"&showselect=off":""	var showseq=(fieldshowseq.value!="on")?"&showseq=off":""	window.location.href=pathname+"?openform&view="+viewname+"&start="+start+"&count="+count+showunread+showselect+showseq;}function collapsAll()//\u5168\u90E8\u6298\u53E0{	var pathname=window.location.pathname;	var searchstr=window.location.search;	var viewname=getRefValue(searchstr,"&view=");	var start=parseInt(fieldstart.value);	var count=parseInt(fieldcount.value);	var total=parseInt(fieldtotal.value);	var showunread=(fieldshowunread.value!="on")?"&showunread=off":""	var showselect=(fieldshowselect.value!="on")?"&showselect=off":""	var showseq=(fieldshowseq.value!="on")?"&showseq=off":""	var collapsStatus="&collapsStatus=all"	window.location.href=pathname+"?openform&view="+viewname+"&start="+start+"&count="+count+showunread+showselect+showseq+collapsStatus;}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) { //v3.0  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); return x;}function MM_swapImage() { //v3.0    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 editclick(){if (confirm("\u8BF7\u9009\u4E2D\u5355\u4E2A\u6587\u6863\u8FDB\u884C\u7F16\u8F91."))	{	doWithInput();	}	fieldaction.value="edit";	document.forms[0].submit();}function readonlyClsColor(oHtml){//\u5728html\u7F16\u8F91\u5668\u4E2D\u4F7F\u7528\uFF0C\u7528\u4E8E\u5728\u53EA\u8BFB\u72B6\u6001\u4E0B\u6E05\u9664html\u6587\u4EF6\u4E2D\u7684\u6587\u672C\u7684\u989C\u8272\u8BBE\u7F6E\uFF0C\u4EA7\u751F\u7EAF\u9ED1\u53D1\u6587 var sHtml=oHtml.toUpperCase(); var retHtml=""; var tmpstr=""; var nowCursor=0; var lastCursor=0; var pos=0; var tmppos=0; var tmppos2=0; var flag; var delstack=""; //\u5B58\u653E\u7684\u662F\u5230\u76EE\u524D\u4E3A\u6B62\u9700\u8981\u5220\u9664\u7684</font>\u6807\u8BB0\u7684\u5806\u6808(\u8003\u8651\u5230font\u7684\u5D4C\u5957)     //\u6BCF\u4E00\u4F4D\u5BF9\u5E94\u4E00\u4E2Afont\u6807\u8BB0\uFF0C\u7528\u6765\u5224\u65AD\u662F\u5426\u5E94\u5220\u9664\u5BF9\u5E94\u7684</font>\u6807\u8BB0 while(lastCursor<=sHtml.length-1) {    tmppos=myIndexOf(sHtml,"<FONT ",lastCursor);    tmppos2=sHtml.indexOf("</FONT>",lastCursor);    if(tmppos<0&&tmppos2<0) {     retHtml+=oHtml.substring(lastCursor,sHtml.length);     lastCursor=sHtml.length;    } else if(tmppos>tmppos2||(tmppos<0&&tmppos2>=0)) {      //\u5148\u5904\u7406</font>\u6807\u8BB0      if(delstack.length>0&&delstack.substring(0,1)=="1") {       //\u5806\u6808\u8868\u660E\u8BE5\u6807\u8BB0\u5E94\u8BE5\u5220\u9664   retHtml=retHtml+oHtml.substring(lastCursor,tmppos2);      } else {       //\u4FDD\u7559</font>\u6807\u8BB0   retHtml=retHtml+oHtml.substring(lastCursor,tmppos2+7);      }       //\u4ECE\u5806\u6808\u4E2D\u6E05\u9664\u4E00\u4F4D       delstack=delstack.substring(1,delstack.length);       lastCursor=tmppos2+7;    } else {  //\u68C0\u67E5font\u6807\u8BB0\uFF0C\u6E05\u9664\u5176\u4E2D\u7684color\u5C5E\u6027\uFF0C\u4FDD\u7559\u5176\u4F59\u7684\u5C5E\u6027       nowCursor=tmppos;  //\u8BBE\u5B9A\u6E38\u6807       delstack="0"+delstack;  //\u7F3A\u7701\u5806\u6808\u4E2D\u8BBE\u7F6E\u4E0D\u5220\u9664</font>  retHtml+=oHtml.substring(lastCursor,nowCursor);  pos=nowCursor+5;  tmppos=myIndexOf(sHtml," COLOR",pos);  tmppos2=sHtml.indexOf(">",pos);  if(tmppos2<0&&tmppos<0) {   //\u672A\u627E\u5230>\u6216color\u5C5E\u6027\uFF0C\u8D4B\u503C\u540E\u7ED3\u675F   retHtml+=oHtml.substring(nowCursor,sHtml.length);   lastCursor=sHtml.length-1;  } else if (tmppos>tmppos2||tmppos<0) {   //\u8BE5font\u6807\u8BB0\u4E0D\u5305\u542Bcolor\u5C5E\u6027\uFF0C\u8D4B\u503C\u540E\u7EE7\u7EED   retHtml+=oHtml.substring(nowCursor,tmppos2+1);   lastCursor=tmppos2+1;  } else {   //\u5305\u542Bcolor\u5C5E\u6027\u7684font\u6807\u8BB0\uFF0C\u9700\u8981\u4FDD\u7559color\u5C5E\u6027\u4EE5\u5916\u7684\u5176\u4ED6\u5C5E\u6027   //\u5148\u5224\u65ADcolor\u5C5E\u6027\u4E4B\u524D\u6709\u6CA1\u6709\u5176\u4ED6\u5C5E\u6027   flag=true; //\u6807\u8BB0\u8BE5font\u6807\u8BB0\u5E94\u5220\u9664   tmpstr=sHtml.substring(pos,tmppos);   if(trim(tmpstr)!="") {    //color\u5C5E\u6027\u4E4B\u524D\u6709\u5176\u4ED6\u5C5E\u6027,\u5C5E\u6027\u5305\u542B\u79FB\u52A8\u524D\u6307\u9488\uFF0C\u5C06\u8FD9\u4E9B\u5305\u542B\u8FDB\u53BB    pos=tmppos;    flag=false;   }   //\u63A5\u7740\u5224\u65ADcolor\u5C5E\u6027\u4E4B\u540E\u6709\u6CA1\u6709\u4EC0\u4E48\u5C5E\u6027   tmpstr=trim(oHtml.substring(tmppos+6,tmppos2));   if(tmpstr.substring(0,1)=="=") {    tmpstr=trim(tmpstr.substring(1,tmpstr.length));    var i=0;    while (i<tmpstr.length&&tmpstr.substring(i,i+1)!=" "&&tmpstr.substring(i,i+1)!="\n") {     i++;    }    if (i<tmpstr.length) {     i=tmpstr.indexOf(" ",i);     if (i>=0) {      tmpstr=trim(tmpstr.substring(i,tmpstr.length))      if (tmpstr!="") {       //color\u5C5E\u6027\u4E4B\u540E\u5B58\u5728\u5176\u4ED6\u5C5E\u6027       retHtml+=oHtml.substring(nowCursor,tmppos)+" ";       retHtml+=tmpstr+">";       flag=false;      }     }    }   }   lastCursor=tmppos2+1;   if (flag) {    //\u5728\u5806\u6808\u4E2D\u6807\u8BB0\u5176\u5BF9\u5E94\u7684</font>\u6807\u8BB0\u9700\u8981\u5220\u9664    delstack="1"+delstack.substring(1,delstack.length);   }  }    } } //while end return (retHtml);}function myIndexOf(oStr,findStr,startPos) { //\u89E3\u51B3\u7531\u4E8Edomino\u7684bug\uFF08\u5728\u4E00\u5B9A\u957F\u5EA6\u540E\u81EA\u52A8\u6DFB\u52A0\u4E00\u4E2A\u56DE\u8F66\uFF09\u6240\u5BFC\u81F4\u7684\u67E5\u627E\u4E0D\u5230\u7684\u95EE\u9898 //readonlyClsColor\u51FD\u6570\u4E2D\u4F7F\u7528 var pos1=0; var pos2=-1; var pos3=-1; if(startPos==null) startPos=0; pos1=oStr.indexOf(findStr,startPos); //\u5C06\u7A7A\u683C\u7528\u56DE\u8F66\u66FF\u6362\uFF0C\u7136\u540E\u518D\u67E5\u627E if(findStr.substring(0,1)==" ") pos2=oStr.indexOf("\n"+findStr.substring(1,findStr.length),startPos); if(findStr.substring(findStr.length-1,findStr.length)==" ") pos3=oStr.indexOf("\n"+findStr.substring(0,findStr.length-1),startPos); if(pos2>-1&&(pos1==-1||pos1>pos2)) pos1=pos2; if(pos3>-1&&(pos1==-1||pos1>pos3)) pos1=pos3; return pos1;}