var IS_DEBUG=0;
document.write('<script language="javascript" src="../../../eaf/common/js/dropdown_menu.js"></script>');
function getSmsSendUrl(){
return"../../../oa/cmmnct/sms/sms_add.aspx?moduleID=3222&menuPath=%cd%a8%d1%b6%bd%bb%c1%f7[$SPLIT_FLAG$]%b7%a2%cf%fb%cf%a2";
}
function getMailSendUrl(){
return"../../../oa/cmmnct/mail/mail_add.aspx?moduleID=3212&menuPath=%cd%a8%d1%b6%bd%bb%c1%f7[$SPLIT_FLAG$]%b7%a2%d3%ca%bc%fe";
}
function list_lookup(moduleID,lookupTypeCode,menuPath) {
  var url; 
  url = "../../../eaf/main/web/single_list.aspx?moduleID=" + moduleID + "&fkField=lookup_type_code&fkValue=" + lookupTypeCode + "&menuPath=" + menuPath;	  
  parent.right.location.href = url;
}
function readXsFile(hs,jk,hd,ii){
var url="../../../eaf/main/file/file_read.aspx?xsRefFileID="+hs+"&xsFileID="+jk;
url=url+"&xsRefFileCode="+escape(hd)+"&xsFileName="+escape(ii);
window.open(url);
}
function getTagTemplatesPath(){
var skinCode=document.Form1.skinCode.value;
return"../../../eaf/tag_templates/"+skinCode+"/";
}
function checkPageText(obj) {
  var val = obj.value;
  var valid = true;
  var ival;
  if(val.length>1&&val.substring(0,1)=="0")
    valid = false;
  else {
    for(var i=0;i<val.length;i++){
      ival = val.substring(i,i+1)
      if(ival<"0"||ival>"9")
        valid =false;
    }
  }
  if (!valid)
    alert("请输入正确的分页数据!");
  return valid;
}
function go_page(page){
document.Form1.curPage.value=page;
document.Form1.submit();
//__doPostBack("ButtonAction", ""); // call postback 
}
function convert2Date(ct){
if(ct==null||ct==undefined||ct=="")
return null;
else{
return(new Date(Date.parse(ct.replace("-","/").replace("-","/"))));
}
}
function lr_frame(iw,iv,moduleCode,moduleName,menuPath){
var url="../../../eaf/main/web/lr_frame.aspx?moduleID="+iv;
url=url+"&sonModuleID="+"0"+"&resideID="+iw+"&moduleCode="+moduleCode+"&menuPath="+menuPath;
parent.right.location.href=url;
}
function openNewWindow(url)
{
var ci;
var bt;
if(document.all)
ci=screen.width,bt=screen.height;
else
if(document.layers)
ci=window.outerWidth,bt=window.outerHeight;
else
ci=640,bt=480;
var da=(ci-580)/2;
var cz=(bt-460)/2;
WindowFeature="height=460, width=580, top="+cz+", left="+da+", toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no";
window.open(url,"",WindowFeature);
}
function show_tip_window(ar,url){
var ci;
var bt;
if(document.all)
ci=screen.width,bt=screen.height;
else
if(document.layers)
ci=window.outerWidth,bt=window.outerHeight;
else
ci=640,bt=480;
var da=0;
var cz=bt;
WindowFeature="height=220, width=380, top="+cz+", left="+da+", toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no";
var kz=window.open(url,"tip_window",WindowFeature);
}
function show_detail_grid(ar,url){
WindowFeature="height=519, width=638, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no";
var EditWin=window.open(url,ar,WindowFeature);
}
function show_new_win(ar,url){
WindowFeature="height=519, width=638, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no";
var EditWin=window.open(url,ar,WindowFeature);
}
function show_search_win(ar,url){
var ci;
var bt;
if(document.all)
ci=screen.width,bt=screen.height;
else
if(document.layers)
ci=window.outerWidth,bt=window.outerHeight;
else
ci=640,bt=480;
var da=(ci-360)/2;
var cz=(bt-230)/2;
WindowFeature="height=230, width=360, top="+cz+", left="+da+", toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no";
var EditWin=window.open(url,ar,WindowFeature);
}
function getBaseUrl() {
    var path = location.pathname;	
	var sposp = path.lastIndexOf("/");	
	sposp = path.lastIndexOf("/",sposp-1);	
	sposp = path.lastIndexOf("/",sposp-1);
	sposp = path.lastIndexOf("/",sposp-1);
	path = path.substring(0,sposp);	
	path = "http://" + location.hostname + (location.port=="" ? "" : ":" + location.port) + path + "/";
	return path;
}
function getSysUrlParam(){
var moduleID=document.Form1.moduleID.value;
var sonModuleID=document.Form1.sonModuleID.value;
var keyField=document.Form1.keyField.value;
var fkField=document.Form1.fkField.value;
var fkValue=document.Form1.fkValue.value;
var filterCond=document.Form1.filterCond.value;
var keyID=document.Form1.keyID.value;
var menuPath=document.Form1.menuPath.value;
var locationName=document.Form1.locationName.value;
var cm="moduleID="+moduleID+"&sonModuleID="+sonModuleID;
cm=cm+"&keyField="+keyField+"&keyID="+keyID+"&fkField="+fkField+"&fkValue="+fkValue;
cm=cm+"&filterCond="+filterCond;
cm=cm+"&menuPath="+menuPath+"&locationName="+locationName;
return cm;
}
function getSysSonUrlParam(){
var moduleID=document.Form1.moduleID.value;
var sonModuleID=document.Form1.sonModuleID.value;
var keyField=document.Form1.keyField.value;
var fkField=document.Form1.fkField.value;
var fkValue=document.Form1.fkValue.value;
var filterCond=document.Form1.filterCond.value;
var keyID=document.Form1.keyID.value;
var menuPath=document.Form1.menuPath.value;
var locationName=document.Form1.locationName.value;
var cm="moduleID="+moduleID+"&sonModuleID="+sonModuleID;
cm=cm+"&keyField=&keyID=&fkField="+keyField+"&fkValue="+keyID;
cm=cm+"&menuPath="+menuPath+"&locationName="+locationName;
return cm;
}
function doBoxHiddenInsert(dp){
theTable.insertRow(theTable.rows.length);
theTable.rows[theTable.rows.length-1].insertCell(0);
theTable.rows[theTable.rows.length-1].insertCell(1);
theTable.rows[theTable.rows.length-1].cells(1).colSpan="3";
theTable.rows[theTable.rows.length-1].cells(1).innerHTML=dp;
}
function doBox2Insert(gi,dp,bh){
theTable.insertRow(theTable.rows.length);
theTable.rows[theTable.rows.length-1].insertCell(0);
theTable.rows[theTable.rows.length-1].insertCell(1);
theTable.rows[theTable.rows.length-1].cells(0).vAlign="top";
theTable.rows[theTable.rows.length-1].cells(1).vAlign="top";
theTable.rows[theTable.rows.length-1].cells(0).align="right";
if(bh!=0)
theTable.rows[theTable.rows.length-1].cells(0).width=bh;
theTable.rows[theTable.rows.length-1].cells(1).colSpan="3";
theTable.rows[theTable.rows.length-1].cells(0).innerHTML=gi+": ";
theTable.rows[theTable.rows.length-1].cells(1).innerHTML=dp;
return theTable.rows.length-1;
}
function doBox2Update(row,gi,dp,bh){
if(bh!=0)
theTable.rows[row].cells(0).width=bh;
if(gi!="")
theTable.rows[row].cells(0).innerHTML=gi+": ";
if(dp!="")
theTable.rows[row].cells(1).innerHTML=dp;
}
function doBox4Insert(gi,dp,ig,kg,bh){
theTable.insertRow(theTable.rows.length);
theTable.rows[theTable.rows.length-1].insertCell(0);
theTable.rows[theTable.rows.length-1].insertCell(1);
theTable.rows[theTable.rows.length-1].insertCell(2);
theTable.rows[theTable.rows.length-1].insertCell(3);
theTable.rows[theTable.rows.length-1].cells(0).vAlign="top";
theTable.rows[theTable.rows.length-1].cells(1).vAlign="top";
theTable.rows[theTable.rows.length-1].cells(2).vAlign="top";
theTable.rows[theTable.rows.length-1].cells(3).vAlign="top";
theTable.rows[theTable.rows.length-1].cells(0).align="right";
if(bh!=0)
theTable.rows[theTable.rows.length-1].cells(0).width=bh;
theTable.rows[theTable.rows.length-1].cells(2).align="right";
if(bh!=0)
theTable.rows[theTable.rows.length-1].cells(2).width=bh;
theTable.rows[theTable.rows.length-1].cells(0).innerHTML=gi+": ";
theTable.rows[theTable.rows.length-1].cells(1).innerHTML=dp;
if(ig!=null&&ig!="")
theTable.rows[theTable.rows.length-1].cells(2).innerHTML=ig+": ";
theTable.rows[theTable.rows.length-1].cells(3).innerHTML=kg;
}
function doRowInsert(row){
var r=parseFloat(row);
if(r>=0){
if(r>theTable.rows.length){
alert("can't add row beyond defined rows");
return;
}
theTable.insertRow(r);
}
}
function doCellInsert(row,column){
var r=parseFloat(row);
var az=parseFloat(column);
var bc=theTable.rows.length;
if((r>=0)&&(az>=0)){
if(r>=bc){
alert("can't add beyond defined rows");
return;
}
if(az>theTable.rows[r].cells.length){
alert("can't add more than one beyond columns");
return;
}
theTable.rows[r].insertCell(az);
}
}
function doCellModification(row,column,fg){
var r=parseFloat(row);
var az=parseFloat(column);
var bc=theTable.rows.length;
if((r>=0)&&(az>=0)){
if(r>=bc){
alert("can't modify cells with row outside the table");
return;
}
if(az>=theTable.rows[r].cells.length){
alert("can't modify cells with column outside the table");
return;
}
theTable.rows[r].cells(az).innerHTML=fg;
}
}
function doCellDelete(row,column){
var r=parseFloat(row);
var az=parseFloat(column);
var bc=theTable.rows.length;
if((r>=0)&&(az>=0)){
if(r>=bc){
alert("can't delete cell beyond defined rows");
return;
}
if(az>=theTable.rows[r].cells.length){
alert("can't delete cell beyond defined column");
return;
}
theTable.rows[r].deleteCell(az);
}
}
function PopupDialog(an,Url,g)
{
var len=an.length;
var ac;
if(len==null)
ac=an;
else
ac=an[0];
if(ac.readOnly||ac.disabled)
return false;
if(g==null)
g="";
showx=event.screenX-event.offsetX-4-210;
showy=event.screenY-event.offsetY+18;
cb=210+4+18;
var ay=window.showModalDialog(Url,g,"dialogWidth:280px; dialogHeight:180px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; ");
if(ay!=null){
if(len==null)
ac.value=ay;
else
{
for(var i=0;i<len;i++)
an[i].value=ay;
}
}else{
}
}
function PopupLocate(an,Url,g)
{
var len=an.length;
var ac;
if(len==null)
ac=an;
else
ac=an[0];
if(ac.readOnly||ac.disabled)
return false;
if(g==null)
g="";
showx=event.screenX-event.offsetX-4-240;
showy=event.screenY-event.offsetY+18;
if(showy+380>screen.availHeight)
showy=screen.availHeight-380-20;
cb=210+4+18;
var ay=window.showModalDialog(Url,g,"dialogWidth:480px; dialogHeight:380px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=yes; ");
if(ay!=null&&ac!=null&&ac!=undefined){
if(len==null)
ac.value=ay;
else
{
for(var i=0;i<len;i++){
an[i].value=ay[i];
}
}
}
else if(ay!=null){
return ay;
}
}
function URLDecode(al){
return unescape(al);
}
function URLEncode(al){
al=escape(al);
while(al.indexOf("/")!=-1){
al=al.replace("/","%2F");
}
return al;
}
function GetUrlParam(hc,it)
{
var ew;
var i,j;
i=hc.indexOf(it+"=");
if(i==-1)return"";
ew=hc.substring(i);
i=ew.indexOf("=")+1;
j=ew.indexOf("&");
if(j==-1)return ew.substring(i);
return ew.substring(i,j);
}
function addXmlTree2TreeNode(moduleid,menupath,treeview,fu,cg,url,target,node,parentid,be,am,eo){
var bb=new ActiveXObject("MSXML.DOMDocument");
var y,cw,dl,en,fd;
if(node==undefined||node==null)
node=treeview.getTreeNode(TreeView1.clickedNodeIndex);
if(parentid==undefined)
parentid=0;
if(be==undefined)
be="";
if(am==undefined)
am=true;
bb.loadXML(fu);
y=bb.selectNodes("/TreeData/List/Item/ID");
cw=bb.selectNodes("/TreeData/List/Item/ParentID");
dl=bb.selectNodes("/TreeData/List/Item/Code");
en=bb.selectNodes("/TreeData/List/Item/Name");
fd=bb.selectNodes("/TreeData/List/Item/IconUrl");
if(y.length==0){
if(eo!=undefined&&eo!=null&&eo!="")
alert(eo);
}
else
addNode2TreeNode(moduleid,menupath,treeview,node,y,cw,en,dl,fd,cg,url,target,parentid,be,am);
}
function addNode2TreeNode(moduleid,menupath,treeview,node,y,cw,en,dl,fd,cg,url,target,parentid,be,am){
var ab;
var i;
var k;
var hg=false;
if(am==undefined)
am=true;
for(i=0;i<y.length;i++){
if(parentid==0&&be!=undefined&&be!="")
hg=(dl[i].text==be);
else
hg=(cw[i].text==parentid);
if(hg&&!am){
addNode2TreeNode(moduleid,menupath,treeview,node,y,cw,en,dl,fd,cg,url,target,y[i].text,be);
}
else if(hg){
k=url;
ab=treeview.createTreeNode();
ab.setAttribute("ID",moduleid+"_"+y[i].text);
ab.setAttribute("Text",en[i].text);
k=k.replace("[$ID$]",y[i].text);
k=k.replace("[$NAME$]",en[i].text);
k=k.replace("[$MENU_PATH$]",menupath);
k=k.replace("[$MODULE_ID$]",moduleid);
if(dl.length>0)
k=k.replace("[$CODE$]",dl[i].text);
ab.setAttribute("NavigateUrl",k);
if(url.indexOf("javascript:")<0)
ab.setAttribute("Target",target);
if(fd.length>0)
ab.setAttribute("ImageUrl",fd[i].text);
else if(cg!=null&&cg!=undefined&&cg!="")
ab.setAttribute("ImageUrl",cg);
node.add(ab);
if(moduleid==3620){
var dj;
var hn=["按时间","按作者","按类别"];
var ei=["CREATE_TIME","CREATE_BY","TEAMKB_TYPE_ID"];
var m;
for(m=0;m<ei.length;m++){
dj=treeview.createTreeNode();
dj.setAttribute("ID",moduleid+"_"+y[i].text+"_"+ei[m]);
dj.setAttribute("Text",hn[m]);
k=url;
k=k.replace("[$ID$]",y[i].text);
k=k.replace("[$NAME$]",en[i].text);
k=k.replace("[$MENU_PATH$]",menupath);
k=k.replace("[$MODULE_ID$]",moduleid);
k=k.replace("[$VIEW_BYWAY$]",ei[m]);
if(dl.length>0)
k=k.replace("[$CODE$]",dl[i].text);
dj.setAttribute("NavigateUrl",k);
if(url.indexOf("javascript:")<0)
dj.setAttribute("Target",target);
dj.setAttribute("ImageUrl","../../../eaf/common/iconstree/teamkb_byway.gif");
ab.add(dj);
}
}
addNode2TreeNode(moduleid,menupath,treeview,ab,y,cw,en,dl,fd,cg,url,target,y[i].text,be);
ab.setAttribute("Expanded",true);
}
}
}
function add1Node2TreeNode(treeview,node,id,name,ji,jh,url,target){
var ab;
var i;
var k;
k=url;
ab=treeview.createTreeNode();
ab.setAttribute("ID",id);
ab.setAttribute("Text",name);
k=k.replace("[$ID$]",id);
k=k.replace("[$NAME$]",name);
if(ji!=null&&ji!=undefined)
k=k.replace("[$CODE$]",ji);
ab.setAttribute("NavigateUrl",k);
if(url.indexOf("javascript:")<0)
ab.setAttribute("Target",target);
if(jh!=null&&jh!=undefined)
ab.setAttribute("ImageUrl",jh);
node.add(ab);
return ab;
}
