﻿var tTimer;function setToolCalss()
{$(".table-box td").each(function(i){this.className=['rowR','row1'][i%2];});$("#iButton td").addClass("menubar_button").hover
(function(){$(this).addClass("menubar_button_on");},function(){$(this).removeClass("menubar_button_on");});$(".menubar_title img").attr({border:"0",align:"absmiddle",hspace:"3",vspace:"3",src:"images/toolbar/default.gif"});$("#i_cancel").attr({title:"返回"}).html('<img src="images/toolbar/back.gif">&nbsp;返回&nbsp;').bind("click",function(){i_Cancel();});$("#i_save").attr({title:"保存当前信息"}).html('<img src="images/toolbar/save.gif">&nbsp;保存&nbsp;').bind("click",function(){i_DataSave();});$("#i_new").attr({title:"添加信息"}).html('<img src="images/toolbar/new.gif">&nbsp;添加&nbsp;').bind("click",function(){i_DataNew();});$("#i_edit").attr({title:"修改当前信息"}).html('<img src="images/toolbar/edit.gif">&nbsp;修改&nbsp;').bind("click",function(){var selectID=getID(false,false,"i_DataEdit");});$("#i_del").attr({title:"删除当前信息"}).html('<img src="images/toolbar/delete.gif">&nbsp;删除&nbsp;').bind("click",function(){getID(true,true,"i_DataDel");});$("#i_copy").attr({title:"复制当前信息"}).html('<img src="images/toolbar/copy.gif">&nbsp;复制&nbsp;').bind("click",function(){getID(false,true,"i_DataCopy");});$("#i_ref").attr({title:"刷新信息"}).html('<img src="images/toolbar/ref.gif">&nbsp;刷新&nbsp;').bind("click",function(){location.reload(false);});$("#i_exit").attr({title:"退出"}).html('<img src="images/toolbar/exit.gif">&nbsp;退出&nbsp;').bind("click",function(){i_DataExit();});$("#i_checkok").attr({title:"批准当前申请单"}).html('<img src="images/toolbar/checkok.gif">&nbsp;批准&nbsp;').bind("click",function(){i_DataCheck(1);});$("#i_checknot").attr({title:"不批准当前申请单"}).html('<img src="images/toolbar/checknot.ico">&nbsp;退回&nbsp;').bind("click",function(){i_DataCheck(2);});$("#i_desi").attr({title:"设计本窗体框架"}).html('<img src="images/toolbar/Wizard.ico">&nbsp;设计&nbsp;').bind("click",function(){i_Design();});$("#i_report").attr({title:"导出自定义报表"}).html('<img src="images/toolbar/Wizard.ico">&nbsp;报表&nbsp;').bind("click",function(){i_Report();});$("#i_print").attr({title:"打印与预览"}).html('<img src="images/toolbar/print.gif">&nbsp;打印&nbsp;').bind("click",function(){i_print();});$("#i_chart").attr({title:"查看统计图表"}).html('<img src="images/chart.gif">&nbsp;统计&nbsp;').bind("click",function(){fn_chart();});$("#i_datain").attr({title:"导入以制表符分隔的文本文件（不需ID字段）"}).html('<img src="images/toolbar/txt.gif">&nbsp;导入&nbsp;').bind("click",function(){fn_datain();});$("#i_dataout").attr({title:"导出记录"}).html('<img src="images/toolbar/out.gif">&nbsp;导出&nbsp;').bind("click",function(){fn_dataout();});$("#iButton td[name='i_place']").html('<img src="images/toolbar/separator.gif">');$("#iButton img").attr({border:"0",align:"top"});$("#i_TD_seach").attr({align:"right"}).html('<input id="i_INPUT_keyword" onkeypress="if(event.keyCode==13) dataSearch();" class="menubar_function_text" maxlength="20" type="text" value="查找记录内容" style="border-width: 0;text-align: right;cursor:text;" title="输入查找内容后直接回车确认"/>&nbsp;<img id="i_IMG_serch" onclick="dataSearch();" src="images/toolbar/sea.gif" alt="智能查询" style="width: 20px; height: 20px" /><img id="i_IMG_serch2" onclick="Fn_SearchShow();" src="images/sort_desc.gif" alt="高级查询" style="width: 7px; height: 7px" />&nbsp;');$("#i_INPUT_keyword").one("mousemove",function(){if($(this).val()=="查找记录内容")$(this).val("");this.focus();});$("#i_IMG_serch,#i_IMG_serch2").hover
(function(){$(this).addClass("menubar_button_on");},function(){$(this).removeClass("menubar_button_on");});}
function i_print()
{window.open("i_print.html?2","打印预览","fullscreen=1,toolbar=0,scrollbars=1,status=1,menubar=0");}
function i_Cancel()
{if(window.history.length==0)location.reload();else window.history.back();}
function i_DataDel(selectID)
{cSr("!Dele",selectID);}
function dataSearch()
{showDate(1,"*",null);}
function setDataGridCalss()
{$("#showData1 tr").slice(1).hover
(function()
{$(this).addClass("MouseMoveInTD");},function()
{$(this).removeClass("MouseMoveInTD");}).bind("click",function(){dataGrid_Click(this);}).bind("dblclick",function(){dataGrid_dbClick(this);}).each(function(i){this.className=['row','row1'][i%2];this.tag=this.className;});$("#showData1 .mover").bind("mousedown",function(){DronFw.Class.GridTable.mousedown(this.parentNode,event);});$("#showData1 input[type='checkbox']").click(function(){checkbox_onClick(this)});$("#dataGrid td").attr({"title":function(){return $(this).text();}}).css({"white-space":"nowrap"});}
function checkbox_onClick(thisCheck)
{if(thisCheck.checked)
{IDs_this.push(thisCheck.tag);IDs_order.push(thisCheck.id.substr(3));}
else
{IDs_this=$.grep(IDs_this,function(n,i)
{return n==thisCheck.tag;},true);IDs_order=$.grep(IDs_order,function(n,i)
{return n==thisCheck.id.substr(3);},true);}
$("#showChkSel").text(IDs_this.length);}
function cSr(type,val,isShowLoad)
{if(isShowLoad==null)isShowLoad=true;if(isShowLoad)showloadImg(true);$.post("ioas.aspx",{iUrl:location.host+location.pathname,iType:type,iVal:encodeURI(val)},function(data)
{showloadImg(false);switch(data.substr(0,4))
{case"!err":var toArry=new Array(data.substr(4));try
{showTip(toArry[0].replace(/<[^>]+>/g,""));showDialog("showErrMess.html?1",toArry);}
catch(e)
{alert(toArry[0]);}
return;case"!out":if(top.tmp=="!out")return;top.tmp="!out";var toArry=new Array("<br><p>&nbsp;&nbsp;&nbsp;&nbsp;抱歉，可能因电脑闲置时间过长，导致系统找不到您的登录信息，请重新登录。</p><p align='center'><button onclick='window.close();'>重新登录</button></p>");showDialog("showErrMess.html?7",toArry);$("#t_login",top.document).click();return;}
if(type.substr(0,1)=="@"&&data.substr(0,1)=="[")
{if(data.length<=2)
return CallBackOther(type,"");else
return CallBackOther(type,$.parseJSON(data));}
switch(type)
{case"!NoBack":break;case"!Back":showTip("操作完成！");break;case"!gDat":refDataGrid(data);refDataGrid_doOther(data);break;case"!Dele":showTip("记录删除成功！");clearChkStat();if(typeof(frmTableName)!='undefined')
getDataFromServer();break;case"!Copy":showTip("记录复制成功！");if(typeof(frmTableName)!='undefined')
getDataFromServer();break;default:CallBackOther(type,data);}});}
function formatString(in1out2,Str)
{if(in1out2==1)
{Str=Str.replace(/\"/g,"&#34;");Str=Str.replace(/\'/g,"&#39;");}
else
{Str=Str.replace(/\&#34;/g,'"');Str=Str.replace(/\&#34;/g,"'");}
return Str;}
function dataGrid_Click(thisTD)
{changeIDcurr(thisTD.orderID,thisTD.id.substr(3));}
function dataGrid_dbClick(thisTD)
{}
function changeIDcurr(newOrder,newID)
{if(newID.length!=0)
{if(ID_this.length>0)try{document.getElementById("row"+ID_this).style.color="black";}catch(e){};try{document.getElementById("row"+newID).style.color="red";}catch(e){};}
ID_order=newOrder;ID_this=newID;}
function chkSelect(selType)
{if(selType==1)
{clearChkStat();$("#showData1 input[type='checkbox']").each(function(i,n)
{this.checked=true;IDs_this.push(this.tag);IDs_order.push(this.id.substr(3));});}
else
{$("#showData1 input[type='checkbox']").each(function(i,n)
{var thistag=this.tag;var thisid=this.id.substr(3);this.checked=!this.checked;if(this.checked)
{IDs_this.push(thistag);IDs_order.push(thisid);}
else
{for(var x=0;x<IDs_this.length;x++)
{if(IDs_this[x]==thistag)
{IDs_this.splice(x,1);IDs_order.splice(x,1);break;}}}});}
$("#showChkSel").text(IDs_this.length);if(IDs_this.length>0)
{if(typeof(doDataType)!='undefined')
{try{if(doDataType==0||doDataType==4)setDoStat(3);}catch(e){}}}}
function showDialog(frm,toArry,dialogWidth,dialogHeight)
{if(dialogWidth==null)dialogWidth=780;if(dialogHeight==null)dialogHeight=500;try
{return window.showModalDialog(frm,toArry,"dialogWidth="+dialogWidth+"px;dialogHeight="+dialogHeight+"px;resizable:1;status:0;edge:sunken;scroll:0;help:0");}catch(e)
{alert("抱歉，提示信息给浏览器拦截了！\n\r解决：请将本网站添加入可信任网站列表里。\n\r\n\r--不清楚如何操作？请与我们客服联系(QQ:506769373)。");if(frm.substr(0,11)=="showErrMess")
alert(toArry[0].replace(/<[^>]+>/g,"").replace(/&nbsp;/g,"\n\r"));}}
function addWindows(url,title)
{if(top.isNewFrm)
{url=url.replace(/"/gi,"'");top.navTab.openTab(url,url,{title:title,fresh:false});}
else
top.fraMain.AddWin(url,title);}
function getID(isSuportMul,isConfirm,CallFun)
{var getValue="";if(isSuportMul==null)isSuportMul=true;if(isConfirm==null)isConfirm=true;var tTip="操作";switch(CallFun)
{case"i_DataDel":tTip="删除";break;case"i_DataEdit":tTip="修改";break;case"i_DataCopy":tTip="复制";break;}
if(isSuportMul&&IDs_this.length>0)
{var saystr="";var sql="";getValue="ID in ("+IDs_this.join(",")+")";if(isConfirm)
{showMess(tTip+"确认","<p>您选择了以下ID序号记录:</br>"+IDs_order.join("、")+"</br>---总共 "+IDs_order.length+" 条，是否确定"+tTip+"？</p>",1,CallFun+"('"+getValue+"')");}
else if(CallFun!=null)eval(CallFun+"('"+getValue+"')");}
else
{if(ID_order.length==0)
{showTip("请选择记录！");return null;}
getValue="ID ="+ID_this;if(isConfirm)
{showMess(tTip+"确认","<p>您选择了ID序号为 "+ID_order+" 的记录！"+"</br>---是否确定"+tTip+"？</p>",1,CallFun+"('"+getValue+"')");}
else if(CallFun!=null)eval(CallFun+"('"+getValue+"')");}
return getValue;}
function showDate(EventType,newWhere,newOrderfld)
{switch(EventType)
{case 0:dgPageCurrent=myPager.CurrentPage;$("#showPager1").html(myPager.ShowPagerBar());break;case 1:if(newWhere=="*")
{newWhere=$.trim($("#i_INPUT_keyword").val());if(newWhere.length==0)
newWhere="1=1";else
newWhere=";*;"+newWhere+";*;";}
if(tvWhere==newWhere)return;dgPageCurrent=1;myPager.CurrentPage=dgPageCurrent;tvWhere=newWhere;newWhere=newWhere.replace(baseWhere,"");break;case 2:if(newOrderfld==Orderfld)
{OrderType=(OrderType==1)?0:1;}
else
{Orderfld=newOrderfld;OrderType=1;}
dgPageCurrent=1;myPager.CurrentPage=dgPageCurrent;break;case 3:if(newWhere=="*")newWhere=";*;"+$("#i_INPUT_keyword").val()+";*;";dgPageCurrent=1;myPager.CurrentPage=dgPageCurrent;tvWhere=newWhere;newWhere=newWhere.replace(baseWhere,"");break;case 9:break;default:showTip("错误的EventType参数："+EventType);break;}
getDataFromServer();}
function getDataFromServer()
{var tfldlist;var MenuID="";try
{tfldlist=fldlist;if(isFrmFlow)
{MenuID=MID2;tfldlist+=",[申请状态]";}}catch(e){tfldlist="*";}
var getX=new Array();getX.push(dgPageCurrent);getX.push(dgPageSize);getX.push(Fn_Trans(baseWhere+tvWhere));getX.push("["+Orderfld+"]");getX.push(OrderType);getX.push(frmTableName);getX.push(tfldlist);getX.push(MenuID);cSr("!gDat",$.toJSON(getX),false);var div_loadImg="<div class=\"gridtable\" id=\"div_loadImg2\" style=\"width:110px\"><table class=\"table-box\" cellspacing=\"1\" cellpadding=\"0\"><tr>"+"<td class=\"tit\" ><img src='images/icon_onload.gif'/><b>&nbsp;&nbsp;loading...</b></td></tr>"+"</table></div>";$("#showData1").html(div_loadImg);$("#div_loadImg2").show(500);}
function refDataGrid(data)
{data=$.parseJSON(data);var rc=data[1];data=$.parseJSON(data[0]);myDateGrid=new DronFw.Class.GridTable;myDateGrid.Titles=[data[0]];myDateGrid.Orderfld=Orderfld;if(OrderType==1)myDateGrid.OrderImg=OrderImg_des;else myDateGrid.OrderImg=OrderImg_asc;for(var x=1;x<data.length;x++)
{myDateGrid.AddItem([data[x]],(x%2==0)?"":"1");}
$("#showData1").html(myDateGrid.CreateTable());setDataGridCalss();showPager(rc);refChkStat();try
{if(frmSubArr.length>0)
{$("#showData1 tr").slice(1).find("td:first-child").append("<img name='subImg' src='images/addImg.gif' onclick='getMSCallS(this)'/>");$("[name='subImg']").toggle
(function()
{$(this).attr("src","images/subImg.gif");},function()
{$(this).attr("src","images/addImg.gif");});}}
catch(e){}}
function showPager(Total)
{myPager=new DronFw.Class.Pager("myPager");if(Total==null)
{DronFw.Class.Pager.prototype.goPrePage=function(){this.CurrentPage--;showDate(0);};DronFw.Class.Pager.prototype.goPage=function(n){this.CurrentPage=n;showDate(0);};DronFw.Class.Pager.prototype.goNexPage=function(){this.CurrentPage++;showDate(0);};return;}
Total=Total||0;myPager.Total=Total;myPager.PageSize=dgPageSize;myPager.PageButtonNumber=9;myPager.CurrentPage=dgPageCurrent;$("#showPager1").html(myPager.ShowPagerBar());$("#showChkSel").text(IDs_order.length);}
function refChkStat()
{$("#showData1 input[type='checkbox']").each(function(index)
{if(jQuery.inArray(this.tag,IDs_this)!=-1)$(this).attr({"checked":"checked"});});}
function clearChkStat()
{ID_this="";ID_order="";IDs_this=new Array();IDs_order=new Array();}
function OpenIt(selectID,theStyle,theOP,openHTML,theTit)
{if(selectID==null)
{selectID=getID(false,false);if(selectID==null)return;}
if(openHTML==null)openHTML="OpenIt.html";if(theTit==null)theTit='查阅'+(theStyle=='1'?'流程图 ':'申请单 ');addWindows(openHTML+'?'+selectID+';!;'+theStyle+';!;'+theOP,theTit+theOP);}
function getEditorHTMLContents()
{if(oEditor==null)oEditor=FCKeditorAPI.GetInstance("FCKeditor1");return(oEditor.GetXHTML(true));}
function getEditorTextContents()
{if(oEditor==null)oEditor=FCKeditorAPI.GetInstance("FCKeditor1");return(oEditor.EditorDocument.body.innerText);}
function SetEditorContents(ContentStr)
{if(oEditor==null)oEditor=FCKeditorAPI.GetInstance("FCKeditor1");oEditor.SetHTML(ContentStr);}
function SetEditorFocus()
{if(oEditor==null)oEditor=FCKeditorAPI.GetInstance("FCKeditor1");oEditor.Focus();}
function FCKeditor_OnComplete(editorInstance)
{if(FCK_DefMem==null)FCK_DefMem="";else
{SetEditorContents(FCK_DefMem);FCK_DefMem=null;}
if(editorInstance==null)return;try
{if(FCK_DefHight==null)FCK_DefHight=300;switch(FCK_DefHight)
{case 0:$("#FCKeditor1___Frame").hide();break;default:$("#FCKeditor1___Frame").css("height",FCK_DefHight);break;}}
catch(e){}}
function upFile(attFiles,ext,showDel)
{if(ext==null)
ext="";if(showDel==null)
showDel=($("#upFile").css("display")=="block"?true:false);if(attFiles==null)
{var toArry=new Array(10,10);var backArry=showDialog("i_upFile.aspx?"+ext.toUpperCase(),toArry,600,360);if(backArry[0]=="0")return;upFilesIni=((upFilesIni.length>0)?(upFilesIni+";;"):"")+backArry[1];}
else upFilesIni=attFiles;if(upFilesIni.length==0)$("#upTit").html("");else
{var fileArr=upFilesIni.split(";;");var contArr=new Array();var tmp="";var tL;var ext;for(var x=0;x<fileArr.length;x++)
{contArr=fileArr[x].split(";");tL=contArr[3].split(".");if(tL.length==1)
ext="";else
ext=tL[tL.length-1];tmp+="<tr><td><img src='images/file/"+ext+".gif' onerror=\"javascript:this.src='images/toolbar/icon_att.gif'\" />&nbsp;<a tag=1 href='UserFile\\UpFs\\"+contArr[3]+"'>"+contArr[0]+"</a>&nbsp;("+(contArr[2]>=100?(contArr[2]/1024).toFixed(2)+" MB":contArr[2]+" KB")+")&nbsp;&nbsp;&nbsp;<a tag=2 tX="+x+">删除</a></td></tr>";}
$("#upTit").html('<fieldset style="height:20px"><legend><a><img />&nbsp;附件('+fileArr.length+')</a></legend><div><table>'+tmp+'</table></div></fieldset><br />');attfieldsetChange("#upTit",true,showDel);upFile_doOther();}}
function upFile_doOther()
{}
function upFile_killFile(killx)
{var fileArr=upFilesIni.split(";;");fileArr=$.grep(fileArr,function(n,i)
{return i!=killx;});upFile(fileArr.join(";;"));}
function attfieldsetChange(theFather,isInit,showDel)
{var stat;var Img;theFather=theFather||"#upTit";if(showDel==null)
showDel=($("#upFile").css("display")!="none"?true:false);if(isInit)
{$(theFather+" legend a").attr({"title":"点击伸缩","style":"cursor:pointer"}).click(function(){attfieldsetChange(theFather);});$(theFather+" table a[tag=1]").attr({"target":"_blank","title":"点击打开"});if(showDel)
{$(theFather+" table a[tag=2]").attr({"target":"_self","title":"删除本附件"}).each(function(n,i){$(this).attr({"href":"javascript:upFile_killFile("+$(this).attr("tX")+")"})});}
else
{$(theFather+" table a[tag=2]").css("display","none");}
$(theFather+"").css("display","block");stat="block";Img="SubImg";}
else
{if($(theFather+" fieldset > div").css("display")=="block")
{stat="none";Img="addImg";}
else
{stat="block";Img="SubImg";}}
$(theFather+" fieldset > div").css("display",stat);$(theFather+" legend img").attr({"src":"images/"+Img+".gif"});$(theFather+" fieldset img").attr({border:"0",align:"absmiddle",hspace:"3",vspace:"3"});}
function showDialogTit()
{var HexA0s=["%A0"];for(var x=1;x<=150;x++)HexA0s.push("%A0");document.title=document.title+unescape(HexA0s.join(" "));}
function showloadImg(T_F)
{if(T_F)
{if(!($("#div_loadImg").length))
{var div_loadImg="<div class=\"gridtable\" id=\"div_loadImg\" style=\"width:110px\"><table class=\"table-box\" cellspacing=\"1\" cellpadding=\"0\"><tr>"+"<td class=\"tit\" ><img src='images/icon_onload.gif'/><b>&nbsp;&nbsp;loading...</b></td></tr>"+"</table></div>";$("body").append(div_loadImg);$("#div_loadImg").css({"z-index":"9999","position":"absolute","filter":"alpha(opacity:100)","top":"0px","left":"0px"});}
$("#div_loadImg").show(500);}
else
{$("#div_loadImg").hide(500);}}
function showTip(mess,time)
{$("#frm_HeadOPTxt").css({"color":"Red"}).attr({"title":mess}).html(mess.length>40?(mess.substr(0,35)+"..."):mess).show(1000);window.clearTimeout(tTimer);tTimer=window.setTimeout("try{$(\"#frm_HeadOPTxt\").css({'color':'#808080'});}catch(e){}",time==undefined?5000:time);}
function showMess(title,content,buttons,jsDo1,jsDo0,oWidth,oHeight,loadUrl)
{jQuery.openWindow({"title":title,"content":content,"buttons":buttons,"jsDo1":jsDo1,"jsDo0":jsDo0,"oWidth":oWidth,"oHeight":oHeight,"loadUrl":loadUrl});}
function loodCss(jsArr)
{loadFile("css/Site_Css.css","css");loadFile("scripts/jquery.ui.all.js","js");loadFile("css/table/"+fn_getCssStyle()+"/css.css","css");loadFile("css/themes/"+fn_getTheme()+"/jquery.ui.all.css","css");loadFile("scripts/DatePicker/WdatePicker.js","js");if(jsArr!=null)
{var getX=jsArr.split(",");for(var x=0;x<getX.length;x++)
loadFile("scripts/"+getX[x]+".js","js");}
if(document.layers)
document.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT);document.onmouseover=disableStatus;document.onmouseout=disableStatus;}
function fn_getTheme()
{return top.theTheme||$.cookie("ck_theme")||"south-street";}
function fn_getCssStyle()
{return top.theCssStyle||$.cookie("ck_CssStyle")||"Green";}
function loadFile(filePath,type)
{var element=null;if(type==null)
{var getX=filePath.split(".");type=getX[getX.length-1];}
if(type=="js")
{element=document.createElement('script');element.setAttribute("type","text/javascript");element.setAttribute("src",filePath);}else if(type=="css")
{element=document.createElement("link");element.setAttribute("rel","stylesheet");element.setAttribute("type","text/css");element.setAttribute("href",filePath);}else
{return;}
var eHead=document.getElementsByTagName("head");if(eHead!=null)
eHead[0].appendChild(element);}
function disableStatus()
{window.status='';return true;}
function repX(stringObj,replaceText)
{var reCat=/@!@/gi;return stringObj.replace(reCat,replaceText);}
function getWeek(theDate,isNeedXQ)
{if(theDate==null||theDate.length==0)theDate=formatDateToCN();isNeedXQ=isNeedXQ||true;var x=new Array("日","一","二","三","四","五","六");var d=new Date();if(theDate.indexOf("年")!=-1)
{theDate=theDate.replace("年","-").replace("月","-").replace("日","");}
var getX=theDate.split("-");getX[1]=getX[1].substr(0,1)=="0"?getX[1].substr(1,1):getX[1].substr(0,2);getX[2]=getX[2].substr(0,1)=="0"?getX[2].substr(1,1):getX[2].substr(0,2);d.setFullYear(getX[0]);d.setMonth(parseInt(getX[1])-1);d.setDate(getX[2]);var getVal=(isNeedXQ?"星期":"")+x[d.getDay()];return getVal;}
function AdvanceMinFn(getIndex0_Html1_Min2,theVal)
{var AdvanceMin;switch(getIndex0_Html1_Min2)
{case 0:switch(theVal)
{case"10":AdvanceMin=0;break;case"20":AdvanceMin=1;break;case"30":AdvanceMin=2;break;case"45":AdvanceMin=3;break;case"60":AdvanceMin=4;break;case"120":AdvanceMin=5;break;case"180":AdvanceMin=6;break;case"300":AdvanceMin=7;break;}
break;case 1:AdvanceMin=""+'<option>10分钟</option>'+'<option>20分钟</option>'+'<option>30分钟</option>'+'<option>45分钟</option>'+'<option>1小时</option>'+'<option>2小时</option>'+'<option>3小时</option>'+'<option>5小时</option>';break;case 2:switch(theVal)
{case 0:AdvanceMin=10;break;case 1:AdvanceMin=20;break;case 2:AdvanceMin=30;break;case 3:AdvanceMin=45;break;case 4:AdvanceMin=60;break;case 5:AdvanceMin=120;break;case 6:AdvanceMin=180;break;case 7:AdvanceMin=300;break;}
break;}
if(AdvanceMin==null)alert("取值出错!");return AdvanceMin;}
function getLogUserIni(id0_bm1_zw2_xm3_uID4)
{try
{var getX=$.parseJSON($.cookie("ck_LogUser"));if(id0_bm1_zw2_xm3_uID4==null)return"隶属部门:"+getX[1]+" 职位:"+getX[2];return getX[id0_bm1_zw2_xm3_uID4];}
catch(e)
{var toArry=new Array("<br><p>&nbsp;&nbsp;&nbsp;&nbsp;抱歉，Cookies不能缓存！<br>请检查是否安装了兔子等拦截Cookies缓存的软件。</p><p align='center'><button onclick='window.close();'>重新登录</button></p>");showDialog("showErrMess.html?7",toArry);}}
function Get2Set(tObj,setTxt)
{switch(tObj[0].tagName)
{case"INPUT":if(setTxt==null)
return tObj.val();else
return tObj.val(setTxt);break;default:if(setTxt==null)
return tObj.html();else
return tObj.html(setTxt);}}
function showDeptPer(backID,isMul,selType,Split,baseWhere)
{if(isMul==null)isMul=true;if(selType==null)selType="1";var toArry=new Array(selType,Get2Set($("#"+backID)),isMul,Split,$.trim(baseWhere));var backArry=window.showModalDialog("showDeptPer2.html?2",toArry,"dialogWidth=740px;dialogHeight=560px;resizable:1;status:0;edge:sunken;scroll:0;help:0");if(backArry==null||backArry[0]==0)return;Get2Set($("#"+backID),backArry[1]).attr("title",backArry[1]).focus();}
function formatLongDate(theDate,isHouMin,isSec)
{isHouMin=isHouMin||false;isSec=isSec||false;if(theDate==null)theDate=0;var theRealTime;var theMonth;var theDay;if(theDate<10)
{var theNow=new Date();if(theDate!=0)theNow=new Date(theNow.getYear(),theNow.getMonth(),theNow.getDate()-theDate);theMonth=theNow.getMonth()+1;theDay=theNow.getDate();theRealTime=theNow.getFullYear()+"-"+((""+theMonth).length==1?"0":"")+theMonth+"-"+((""+theDay).length==1?"0":"")+theDay;if(isHouMin)
{var theH=theNow.getHours();var theM=theNow.getMinutes();var theHouMin=((""+theH).length==1?"0":"")+theH;theHouMin+=":"+((""+theM).length==1?"0":"")+theM;if(isSec)
{var theS=theNow.getSeconds();theHouMin+=":"+((""+theS).length==1?"0":"")+theS;}
theRealTime+=" "+theHouMin;}
theDate=theRealTime;}
return $.trim(theDate);}
function formatDateToCN(theDate,isHouMin,isSec)
{isHouMin=isHouMin||false;if(theDate==null)theDate=0;var theMonth;var theDay;theDate=formatLongDate(theDate,isHouMin,isSec);if(theDate.indexOf("-")!=-1)
{var toA=new Array();toA=theDate.split("-");theDate=toA[0]+"年"+toA[1]+"月"+toA[2].substr(0,2)+"日"+toA[2].substr(2);}
return $.trim(theDate);}
function UserInList(ListTxt,UserTxt)
{UserTxt=UserTxt||getLogUserIni(3);if((","+ListTxt+",").indexOf(","+UserTxt+",")!=-1)return true;else return false;}
function showDg(tTitle,tContent,tButtons,tDoYes,tDoNo,oWidth,oHeight)
{$("body").css({cursor:"wait"});$("#tDialog").empty().html(tContent);var tDialog=$("#tDialog");tDialog.dialog({bgiframe:true,autoOpen:false,modal:true});tDialog.dialog("option","title",tTitle);if(oHeight!=null)
tDialog.dialog("option","height",oHeight);if(oWidth!=null)
tDialog.dialog("option","width",oWidth);if(tButtons==0)
tDialog.dialog('option','buttons',{"确定":function(){$(this).dialog('close');if(tDoYes!=null)eval(tDoYes);}});else
{tDialog.dialog('option','buttons',{"取消":function(){$(this).dialog('close');if(tDoNo!=null)eval(tDoNo);},"确定":function(){$(this).dialog('close');if(tDoYes!=null)eval(tDoYes);}});}
tDialog.dialog('open');$("button").each(function(x,n){if(tButtons==2){if(x==0)$(this).val("否");else $(this).val("是");};$(this).val("&nbsp;&nbsp;"+$(this).val()+"&nbsp;&nbsp;");});$("#tDialog input").each(function()
{if($(this).attr("type")=='text')
$(this).attr({"name":"OW"});}).filter(function(index)
{return $(this).attr("readOnly")!=true;}).slice(0,1).focus();$("body").css({cursor:"default"});}
function _w_table_lefttitle_rowspan(_w_table_id,_w_table_mincolnum,_w_table_maxcolnum){if(_w_table_mincolnum==void 0){_w_table_mincolnum=1;}
if(_w_table_maxcolnum==void 0){_w_table_maxcolnum=_w_table_mincolnum;}
if(_w_table_mincolnum>_w_table_maxcolnum){return"";}else{var _w_table_splitrow=new Array();for(iLoop=_w_table_mincolnum;iLoop<=_w_table_maxcolnum;iLoop++){_w_table_onerowspan(iLoop);}}
function _w_table_onerowspan(_w_table_colnum){_w_table_firstrow=0;_w_table_SpanNum=0;_w_table_splitNum=0;_w_table_Obj=$(_w_table_id+" tr td:nth-child("+_w_table_colnum+")");_w_table_curcol_rownum=_w_table_Obj.length-1;if(_w_table_splitrow.length==0){_w_table_splitrow[0]=_w_table_curcol_rownum;}
_w_table_lastrow=_w_table_splitrow[0];var _w_table_firsttd;var _w_table_currenttd;var _w_table_curcol_splitrow=new Array();_w_table_Obj.each(function(i){if(i==_w_table_firstrow){_w_table_firsttd=$(this);_w_table_SpanNum=1;}else{_w_table_currenttd=$(this);if(_w_table_firsttd.text()==_w_table_currenttd.text()){_w_table_SpanNum++;_w_table_currenttd.hide();_w_table_firsttd.attr("rowSpan",_w_table_SpanNum);}else{_w_table_firsttd=$(this);_w_table_SpanNum=1;setTableRow(i-1);}
if(i==_w_table_lastrow){setTableRow(i);}}
function setTableRow(_splitrownum){if(_w_table_lastrow<=_splitrownum&&_w_table_splitNum++<_w_table_splitrow.length){_w_table_lastrow=_w_table_splitrow[_w_table_splitNum];}
_w_table_curcol_splitrow[_w_table_curcol_splitrow.length]=_splitrownum;if(i<_w_table_curcol_rownum){_w_table_firstrow=_splitrownum+1;}}});_w_table_splitrow=_w_table_curcol_splitrow;}}
function Fn_Trans(tObj,newTxt)
{var isObj=(typeof tObj=="object"?true:false);var isNewTxt=(newTxt!=null?true:false);var tText;if(isNewTxt)
tText=newTxt;else
{if(isObj)
tText=Get2Set(tObj);else
tText=tObj;}
var isChange;if(tText.indexOf("{")!=-1)
{if(typeof fldAtt=="object")
{var tmpVal;var tIndex;$.each(fldAtt,function(x,n)
{if(tText.indexOf("[")==-1)return false;tIndex=tText.indexOf("{["+fldAtt[x][0]+"]}");if(tIndex>=0)
{tmpVal=$("#PrintArea div[name='["+fldAtt[x][0]+"]']").html();while(tIndex!=-1)
{tText=tText.replace("{["+fldAtt[x][0]+"]}",tmpVal);tIndex=tText.indexOf("{["+fldAtt[x][0]+"]}");}}});}
tText=tText.replace(/{今天}/gi,formatDateToCN());tText=tText.replace(/{今年}/gi,formatLongDate().substr(0,4));tText=tText.replace(/{本月}/gi,formatLongDate().substr(5,2));tText=tText.replace(/{本天}/gi,formatLongDate().substr(8,2));tText=tText.replace(/{星期}/gi,getWeek().substr(2));tText=tText.replace(/{时间}/gi,formatLongDate(0,true).substr(11));tText=tText.replace(/{日期}/gi,formatLongDate());tText=tText.replace(/{用户姓名}/gi,getLogUserIni(3));tText=tText.replace(/{用户职位}/gi,getLogUserIni(2));tText=tText.replace(/{用户部门}/gi,getLogUserIni(1));tText=tText.replace(/{用户ID}/gi,getLogUserIni(0));tText=tText.replace(/{uID}/gi,getLogUserIni(4));tText=tText.replace(/{隶属一级}/gi,getLogUserIni(5));tText=tText.replace(/{隶属二级}/gi,getLogUserIni(6));tText=tText.replace(/{隶属三级}/gi,getLogUserIni(7));tText=tText.replace(/{隶属四级}/gi,getLogUserIni(8));tText=tText.replace(/{单位名称}/gi,getLogUserIni(9));tText=tText.replace(/{性别}/gi,getLogUserIni(10));tText=tText.replace(/{手机号码}/gi,getLogUserIni(11));tText=tText.replace(/{在职情况}/gi,getLogUserIni(12));tText=tText.replace(/{相片}/gi,getLogUserIni(13));tText=tText.replace(/{部门负责人}/gi,getLogUserIni(13));tText=tText.replace(/{上级部门}/gi,getLogUserIni(13));try
{tText=tText.replace(/{本周}/gi,StringToDate(formatLongDate()).getWeekNumber());}
catch(e){};isChange=true;}
else
isChange=false;if(isObj&&(isChange||isNewTxt))
Get2Set(tObj,tText);return tText;}
function i_Report()
{window.open("i_Image.aspx","RecPrint","");}
function gFramesPath(iframeX)
{iframeX=iframeX||false;if(top.isNewFrm)
{var t=location.pathname.split("/");t=t[t.length-1]+location.search;var tH;$("iframe",top.document).each(function(i,x)
{if(this.src==t)
{tH=iframeX?i:"top.frames["+i+"]";return false;}});return tH;}
else
{var tF=top.fraMain;var tX=tF.length;var tHtml=location.href;for(var x=0;x<tX;x++)
{if(tF.frames[x].location.href.indexOf(tHtml)==-1)
{for(var y=0;y<tF.frames[x].frames.length;y++)
{if(tF.frames[x].frames[y].location.href.indexOf(tHtml)!=-1)
return(iframeX?x:'top.fraMain.frames['+x+'].frames['+y+']');}}
else
return(iframeX?x:'top.fraMain.frames['+x+']');}}}
function FlowOpenIt(selectID,theStyle,theOP,openHTML,theTit)
{if(selectID==null)
{selectID=getID(false,false);if(selectID==null)return;}
if(openHTML==null)openHTML="i_FormFlow_OpenIt.html";if(theTit==null)theTit='查阅'+(theStyle=='1'?'流程图 ':'申请单 ');addWindows(openHTML+'?'+selectID+';!;'+theStyle+';!;'+theOP,theTit+theOP);}
function Fn_SearchShow(tSel)
{var SearchTxt;if(tSel==null)
{var sfldArr=new Array();try
{for(var x=0;x<fldAtt.length;x++)
{if(fldAtt[x][2]!="否")
sfldArr.push(fldAtt[x][0]);}
try
{if(isFrmFlow)sfldArr.push("申请状态");}catch(e){}}
catch(e)
{$("#showData1 tr:first td").slice(1).each(function(i,n){sfldArr.push($(this).text().substr(1))});};var toTmp;var toInp=new Array();toInp1="&gt;:大于,&lt;:小于,=:等于,&gt;=:大于等于,&lt;=:小于等于,&lt;&gt;:不等于,Like:包含".split(",");for(var x=0;x<toInp1.length;x++)
{toTmp=toInp1[x].split(":");toInp1[x]='<input type="button" value=" '+toTmp[0]+' " title="'+toTmp[1]+'" />';}
var toInp2=new Array();toInp2="AND:并且,OR:或者,( ):括号".split(",");for(var x=0;x<toInp2.length;x++)
{toTmp=toInp2[x].split(":");toInp2[x]='<input type="button" value=" '+toTmp[0]+' " title="'+toTmp[1]+'" />';}
SearchTxt=$("#i_TD_seach").data("sT")||"";var tDate="<span id='gDate' style='display:none;'></span>&nbsp;<input type='button' onclick=\"$('#gDate').data('getPos',getCaret(i_SearchTxt));WdatePicker({dateFmt:'yyyy-MM-dd',el:'gDate',onpicked:function(dp) { setCaret(i_SearchTxt,$('#gDate').data('getPos'));Fn_SearchTxtInser(dp.cal.getDateStr()); setCaret(i_SearchTxt,getCaret(i_SearchTxt) + 2); } })\" value='日期'/>"
var tH='<p>插入字段：<select id="i_sel"><option> </option><option> ['+sfldArr.join("] </option><option> [")+'] </option></select>'+tDate+'</p><p id="p1">比较符号：'+toInp1.join("")+'</p><p id="p2">联接符号：'+toInp2.join("")+'</p><p><textarea style="width:100%;height:100px;" id="i_SearchTxt">'+SearchTxt+'</textarea></p><p><font color="#FF0000">如查找客户为联想，数量大于2008记录：<br>[客户]=&#39;联想&#39; AND [数量]>&#39;2008&#39;</font></p>';if(top.fraMain==null)
showMess("高级查询",tH,0,"Fn_SearchShow(1);");else
top.showMess("高级查询",tH,0,gFramesPath()+".Fn_SearchShow(1);");$('#p1 input[type=button]',top.document).click(function()
{var t1="'' ";var t2=2;if(this.value==" Like ")
{t1="'%%' ";t2=3;}
Fn_SearchTxtInser(this.value+t1);setCaret(top.i_SearchTxt,getCaret(top.i_SearchTxt)-t2);});$('#p2 input[type=button]',top.document).click(function(){Fn_SearchTxtInser((this.value==" ( ) "?"":"\n\r")+this.value);});$('#i_sel',top.document).change(function(){Fn_SearchTxtInser($(this).val());$(this).attr("value",'');});}
else
{SearchTxt=$('#i_SearchTxt',top.document).val();$("#i_TD_seach").data("sT",SearchTxt);if($.trim(SearchTxt).length==0)SearchTxt="1=1";$("#i_INPUT_keyword").val("");showDate(1,SearchTxt,null)}}
function getCaret(obj)
{var pos=0;obj.focus();var s=obj.scrollTop;var r=document.selection.createRange();var t=obj.createTextRange();t.collapse(true);t.select();var j=document.selection.createRange();r.setEndPoint("StartToStart",j);var str=r.text;var re=new RegExp("[\\n]","g");str=str.replace(re,"");pos=str.length;r.collapse(false);r.select();obj.scrollTop=s;return pos;}
function setCaret(obj,pos)
{var r=obj.createTextRange();r.collapse(true);r.moveStart('character',pos);r.select();}
function Fn_SearchTxtInser(str)
{$('#i_SearchTxt',top.document).focus();with(top.document.selection.createRange())
{text=str;collapse();select();}}
function fn_isPt(tItem,gButton)
{if(fn_isAdmin())
{if(gButton)
return[true,true,true,true,true,true,true,true,true,true];else
return true;}
if(gButton)
{var toArr=new Array("A","B","C","D","E","F","G","H","I","J");for(var x=0;x<toArr.length;x++)
toArr[x]=(top.tP.indexOf(","+tItem+toArr[x]+",")==-1?false:true);return toArr;}
else
return(top.tP.indexOf(","+tItem+",")==-1?false:true);}
function fn_isAdmin()
{if(top.isA==null)
{if(getLogUserIni(0)=="0")
{top.isA=true;}
else
{top.isA=false;}}
return top.isA;}
function fn_Mem(name,value)
{var MemValue=null;var tMem=top.tMem;$.each(tMem,function(i,n)
{if(name==n[0])
{if(typeof value!='undefined')
{tMem[i][1]=value;MemValue="";}
else
{MemValue=tMem[i][1];}
return false;}});if(MemValue==null)
{MemValue="";var newLength=tMem.length;tMem[newLength]=new Array();tMem[newLength].push(name);tMem[newLength].push(MemValue);}
return MemValue;}
function fn_select(tType)
{$("#tDialog input[type=checkbox]",top.document).each(function(){$(this).attr("checked",tType==1?true:!$(this).attr("checked"))});}
function fn_addSelectBtn(isTop)
{isTop=isTop||false;var tmp="<input type='button' onclick='"+(isTop?"":gFramesPath()+".");return"<p><span class='pad_l20'>"+tmp+"fn_select(1);' value='全选' />"+tmp+"fn_select(0);' value='反选' /></span></p>";}
function fn_gFlds(isHide)
{if(isHide==null)
isHide=true;var tL=new Array();$.each
(fldAtt,function(i,n)
{if(isHide&&fldAtt[i][2]=="否")
return true;tL.push("["+fldAtt[i][0]+"]");});return tL.join(",");}
function fn_playS(src)
{src=src||"msg";var _s=$("#snd");if(_s.length==1)
{_s.attr("src","/ioaoa/sound/"+src+".wav");}}
function fn_gUserDiy(tSty)
{var tV;var uArr=jQuery.cookie("ck_uArr").split(",");if(uArr[0].length==0)uArr[0]="0";switch(tSty)
{case 0:tV="";break;case 1:tV="us/"+uArr[0]+"/登录背景图.jpg";break;case 2:tV="us/"+uArr[0]+"/公司logo.jpg";break;case 3:tV="us/"+uArr[0]+"/桌面背景图.jpg";break;case 4:tV=uArr[0];break;}
return tV;}
function fn_dow(path)
{var fa=path.split("/");top.showDg("文件下载","是否下载【"+fa[fa.length-1]+"】？",1,"window.open('i_downFile.aspx?path="+encodeURI(path)+"')");}
function refDataGrid_doOther(data)
{}
