 var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;

function dbg(t){
		if(typeof(top.user)==undefined){return;}
		if(top.user[0]=="1" ||top.user[0]=="116"){
			prompt("", t);
			}
	}
	var btns = new Array(null, null,null,null, null,null,null, null,null,null, null,null,null);
function shiftbtn(o, d, commcss, thiscss) {
    if (btns[d] != null) {
        btns[d].className = commcss;
    }
    o.className = thiscss;
    btns[d] = o;
}
/*
function shiftTabPage(o,subpgId){
	var p=o.parentNode;
	var pg=p.getAttribute("pg").split(";");
	if(pg[0]==o.id){
		return;
	}
	$(pg[0]).className="";
	$(pg[1]).className="h";
	o.className="currentTabPage";
	$(subpgId).className="currentSubPage";
	addattr(p,"pg",o.id + ";" + subpgId);
}
*/
function $(o)
{
	return document.getElementById(o);
}
function $tags(d)
{
	return document.getElementsByTagName(d);
}
function $class(oElm, strTagName, strClassName,strnewClassName){ 
		if(oElm==null){return;}
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all :  
        oElm.getElementsByTagName(strTagName);  
    var arrReturnElements = new Array();  
    strClassName = strClassName.replace(/\-/g, "\\-");  
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");  
    var oElement;  
    for(var i=0; i < arrElements.length; i++){  
        oElement = arrElements[i];  
        if(oRegExp.test(oElement.className)){  
            arrReturnElements.push(oElement);  
            if(strnewClassName!=null){
            		oElement.className=strnewClassName;
            }
        }  
    }  
    return (arrReturnElements)  
} 

function $names(d)
{
	
	return document.getElementsByName(d);
}


 function w(e)
{
	if(e==null || e=="undefined")
 		return document;
 	else 	return e;
}
function js(v)
{ 
    var s = document.createElement('script'); 
    s.src = v; 
    s.type = 'text/javascript'; 
    var h = document.getElementsByTagName('head').item(0); 
    h.appendChild(s); 
} 
function addeditor(designmode,css,h,w,toolscss){
    if(css==null){css="h";}
    if(h==null){h=650;}
    if(w==null){w=280;}
    
    var o=document.createElement("DIV");
    o.id="editors";
    o.className=css;
      o.innerHTML=" <div id=\"editorstoolbar\" class=dlgtitle> <img src=\"images/del0.png\" alt=\"关闭窗口\" style=\"float:right;\" onClick=\"$('editors').className='h';\" /> <img alt=\"保存\"  src=\"/oa/img/docstatus1.png\" style=\"float:right;\"  onClick=\"saveedit();\" id=\"btneditorsave\" /></div><iframe id=\"editor\" frameborder=\"0\" style=\"width:" + h + "px;height:" + w + "px;\" scrolling=\"auto\" src=\"/oa/editorsmp.htm?mode=" + designmode + "&tools=" + toolscss + "\"></iframe>";
    document.body.appendChild(o);
  }
function addprint()
{
    js("/oa/js/CheckActivX.js");
    document.write("<object id=\"LODOP\" codebase=\"/oa/prt/prt.exe\" width=0 height=0 classid=\"clsid:2105C259-1E0C-4534-8141-A753534CB4CA\"></object>");
 }
String.prototype.a2b=function( ){
	return this.replace(/\u007C/g,"/")	;
}
String.prototype.b2a=function( ){
	return this.replace(/\//g,"\u007C");

}
 
 Array.prototype.indexOf=function(substr,start)
 {
	var ta,rt,d='\0';
	if(start!=null){ta=this.slice(start);rt=start;}else{ta=this;rt=0;}
	var str=d+ta.join(d)+d,t=str.indexOf(d+substr+d);
	if(t==-1)return -1;rt+=str.slice(0,t).replace(/[^\0]/g,'').length;
	return rt;
}
 function arrfind(arr,t)      
{
    var re = new RegExp(t,[""])
    return (arr.toString().replace(re,"┢").replace(/[^,┢]/g,"")).indexOf("┢");
}


 
function showbg()
{   
	var o=top.$("editor");
	if(o!=null){
		if(o.className=="topall"){return;}	
	}
	var bg= $("bg");
    if(bg!=null)
    {
         bg.className="bg";
         var a=document.documentElement.scrollHeight;
         var b=document.documentElement.clientHeight;
         var c=(a<b)? b:a ;
         bg.style.height=c + "px";
   	     document.body.style.overflow = "hidden";
  	 }
 }
 function showbgtt(tt,rt)
{  var bg= $("bg");
    bg.innerHTML= "" + tt+"";
    if(bg!=null)
    {
         bg.className="bg";
         bg.style.height= document.documentElement.scrollHeight+ "px";
  	     document.body.style.overflow = "hidden";
  	     
  	 }
  	 if(rt!=null){return rt;}
 }
function hidebg()
{
    var bg= $("bg");
    if(bg==null){return;}
         bg.style.height="0px";
          bg.innerHTML="";
          bg.className="h";
   
 }


function fire(o){
	if(o.onchange!=null){
  			if(top.isIE){
   	    o.fireEvent("onchange");
  	  }else
  	  	{
  	  		 var evt=document.createEvent('HTMLEvents');  
           evt.initEvent('change',true,true);  
          o.dispatchEvent(evt);  
  	  		}
  	}
	}
//utf8

  
   function s10(v)
{
	if(v=="0")
	{
	    return "1";
	}
	else
	{
	    return "0";
	}
}

 function s102s(v,v1,v0)
{
	if(v=="0")
	{
	    return v0;
	 }
	else
	{
	    return v1;
	}
}

  function tf(v)
{
    if(v=="1")    {
        return true;
    }
    else    {
        return false;
    }
    
}
  function tfindexof(v)
{
    if(v=="-1")    {
        return true;
    }
    else    {
        return false;
    }
    
}
function tf1(v)
{
   if(v.checked==true)
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
 
function GEtradio(obj)
{
    var v=-1;
    for(comi=0;comi<obj.length;comi++)
    {
        if(obj[comi].checked==true)
        {
             return obj[comi].value;
        }
    }
    return v;
}
function SEtradio(obj,v)
{
    for(comi=0;comi<obj.length;comi++)
    {
        if(obj[comi].value==v)
        {
              obj[comi].checked=true;
        }
    }
}
function NUllradio(obj)
{
    for(comi=0;comi<obj.length;comi++)
    {
               obj[comi].checked=false;
     }
}
function getlabel(obj,dot,headdot) //获得checkbox的选中的label
{			if(dot==null){dot="";}
			var rt="";
		 for (comi = 0; comi < obj.length; comi++) {
        if (obj[comi].checked == true) {
           	rt += obj[comi].parentNode.innerText + dot;
            

        }
        if(headdot==1){rt=dot + rt;}
      }
       
         return rt;
}
function getoptiontext(o){
return o.options[o.selectedIndex].text;
}
function getv(obj,dot,headdot)
{
    var rt="";
    var ty;
 		if(obj.value!==undefined){
 			return obj.value;
 		}
    var l=obj.length;
      if(l>0){ty=obj[0].type;
   }
	else
	{		ty=obj.type;
 		 
	}

      if(l==0){return "";}
    if(dot==null){dot=";";}
 
     switch(ty){
     case "checkbox":
         for (comi = 0; comi < l; comi++) {
             if (obj[comi].checked == true) {
                 rt += obj[comi].value + dot;
             }
         }
         if(headdot==1){rt=dot + rt;}
         return rt;
     case "radio":
        for(comi=0;comi<l;comi++)
    		{ 
        	if(obj[comi].checked==true)
        	{
             return obj[comi].value;
        	}
        	
    		}
     default:
     
        if(l>1){
            for (comi = 0; comi < l; comi++) {
                      rt += obj[comi].value + dot;
              }
              return rt;
        }
        
        if(obj.getAttribute("value")==null && obj[0].getAttribute("value")!=null){return obj[0].value;}
         return obj.value; 
         
     }
     
      
}
function setv(obj,v,sp)
{
 
			var o;
			o=obj;
 			if(obj.length>1){o=obj[0];}
       if(o.type=="checkbox")
           {
           	if(sp==null){sp="|";}
           	if(v.indexOf(sp)!=0 && v.length>0){v=sp + v; }
           	if(v.substr(v.length-1,1)!=sp && v.length>0){v +=sp; }
           	for(i=0;i<obj.length;i++){
         
	             if(v.indexOf(sp + obj[i].value + sp)>-1)
	             {
	             	obj[i].checked=true;
	             }
	             else
	             {
	             obj[i].checked=false;
	             }
             }
           }
           else
           {

               if (obj.type == "text" || obj.type == "textarea")
                {
                    obj.value=v;
                }
                else {
                     SEtradio(obj,v);
                }
           }
           
}


 function Msgbox(sc,title,txt,tm) //sc=1:editor,2:消息; title:标题; txt:消息内容; tm:关闭时间;
{
   //flash调用不能保存在form中
 
 	var o=top.$("msgbox");
 	o.className="msgbox";
	o.style.left=180;
	o.style.top=100;
    o.getmsg(sc,title,txt,tm);
  settop(o);
 	 //document["msgbox"].(txt);
}
function hidemsgbox()
{
    $("msgbox").className="msgboxh";
    canceltop($("msgbox"));
 }

  //flash begin
 

function swf(source,nm,w,h,wm,classn)
{
	var wms=new Array('','transparent','opaque','window');
    if(isNaN(wm)==false)
    {
        wm=wms[wm];
    }
    
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" id=\"" + nm+ "\" width=\""+ w +"\" height=\""+ h +"\" class=\""+ classn +"\"  align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"wmode\" value=\"" + wm + "\" /><param name=\"menu\" value=\"false\"><param name=\"movie\" value=\"" + source + ".swf\" /><param name=\"quality\" value=\"high\" /></object>");
	}
function flash(o)
{
	return  isIE ? document.all[o] : document[o];  
}
  function trim(str){  //删除左右两端的空格
 return str.replace(/(^\s*)|(\s*$)/g, "");
}
function ltrim(str){  //删除左边的空格
 return str.replace(/(^\s*)/g,"");
}
function rtrim(str){  //删除右边的空格
 return str.replace(/(\s*$)/g,"");
}
function stopBubble(e){
if(e&&e.stopPropagation){
 
e.stopPropagation();
}else{
 
window.event.cancelBubble = true;
}
}

 

function me()
    {
        var w=window;
         var t="";
         while(w!=top)
        {
            t =w.name + "." + t;
                 w=w.parent;
        }
           return "top." + t;
    }
    
function dtitle(t)
{
    document.title=t;
}

function addload111(v)
{
  var wload=window.onload;
  
  if(wload!=null)
 {
 	wload=String(wload);
 
 
 	wload=wload.replace("function anonymous()","");
 	wload=wload.replace(/{/,"");
 	wload=wload.replace(/}/,"");
 	 	wload=wload.replace(/function onload()/,"");
 	 		wload=wload.replace(/\(\)/,"");
  
 	window.onload=new Function(wload + v);
 	}
 	else
 		{
 			window.onload=new Function(v);
 			}
 			 
}
 
function out(txt,tt)
{
    var oo=$("msgbox");
  
    if(oo!=null)
    {
        if(tt==null){tt="Publishop";}
        //top.Msgbox(1,tt,txt,10);
         o=document.msgbox;
         oo.className="msgbox";
         o.getmsg(1,tt,txt,10);
         settop(o);
    }
    else
    {
        alert(txt);
    }
}

function confirms(txt,tt)
{
    var m=top.$("msgbox");
     if(m!=null)
    {
        if(tt==null){tt="Publishop";}
         top.Msgbox(1,tt,txt,10);
    }
    else
    {
        confirm(txt);
    }


}
var currentselecturl="";
var currentselectmode;
var currentzindex=0;
var currentSelectWin;
function hidedlgyes(){
	 
		 acts.saveit();
	 
}
function getdlg(obj,selecturl,mode,title,h,w,notshowbg)
{ 
 		currentSelectWin=window.frameElement;
     selectobj=obj;
   
     var dlg=$("dlg");
     if(dlg==null)
     {
     	dlg=document.createElement("div");
     		dlg.innerHTML="";
     	}
        dlg.className="movediv";
 
          $("dlgtitle").innerHTML=title;
         if(h!=null){
            dlg.style.height= h ;
         }
          if(w!=null){
            dlg.style.width= w;
         }
         
         if(currentselecturl!=selecturl )
         {
           
          	 if(mode.length>0){mode="&mode=" + mode;}
            if(selecturl!=""){ 
            	acts.location.href=selecturl + mode;
           }
        }
        else
        {
         		acts.getdata();
            //dlg.frames[0].getdata();
        }
        
        currentselecturl=selecturl;
        currentselectmodel=mode;
     	  settop(dlg);
        if(notshowbg==null){
        showbg();
			}
		 
    }
    
    function settop(o){
    	try{
    	 	var thiszindex=o.style.zIndex;
    	 	//dbg(thiszindex);
      	if(thiszindex<currentzindex){
      		currentzindex++;
      		o.style.zIndex=currentzindex +1;
      	}
      	else
      		{
      			currentzindex=thiszindex;
      		}
      	}
      	catch(ex){
      		dbg("settoperr:" + ex);
      		return;
      		}
    }
    function canceltop(o){
    	o.style.zIndex=0;
    	currentzindex=0;
    }
   function fixdlg(){
  return;
   	if (acts.document.readyState!="complete") return;
   	var  h1= acts.document.documentElement.scrollHeight;
   	var  w1=acts.document.documentElement.scrollWidth;
		var h2= top.acts.document.body.scrollHeight;
		var w2= top.acts.document.body.scrollWidth;
    var h=Math.max(h1, h2);
    var w=Math.max(w1, w2);
   	$("acts").style.height=h+ "px";
   	$("acts").style.width=w+ "px";
     $("dlg").style.height=(h+25) + "px";
   	$("dlg").style.width=(w+5)+ "px";  
   }
 function showdlg()
{
 $("dlg").className="movediv";
 showbg();
 settop($("dlg"));
 fixdlg();
}
 function hidedlg()
{
 $("dlg").className="h";
 canceltop($("dlg"));
  hidebg();


}

    function rep(o, findt,newt) {
        var re = new RegExp(findt, "gi");
        
        return o.replace(re, newt);
    }
    function reptxt(o) {
        return rep(o,"\"","\\" +"\"");
    }
    
    /*
    点的转义：.  ==> \\u002E
美元符号的转义：$  ==> \\u0024
乘方符号的转义：^  ==> \\u005E
左大括号的转义：{  ==> \\u007B
左方括号的转义：[  ==> \\u005B
左圆括号的转义：(  ==> \\u0028
竖线的转义：| ==> \\u007C
右圆括号的转义：) ==> \\u0029
星号的转义：*  ==> \\u002A
加号的转义：+  ==> \\u002B
问号的转义：?  ==> \\u003F
反斜杠的转义：\ ==> \\u005C 
    */
function regs(s){
  var buf = [];
  for(var i=0;i<s.length;i++){
    var c=s.charAt(i);
    switch (c) {
      case '.' : buf.push('\\x2E');break;
      case '$' : buf.push('\\x24');break;
      case '^' : buf.push('\\x5E');break;
      case '{' : buf.push('\\x7B');break;
      case '[' : buf.push('\\x5B');break;
      case '(' : buf.push('\\x28');break;
      case '|' : buf.push('\\x28');break;
      case ')' : buf.push('\\x29');break;
      case '*' : buf.push('\\x2A');break;
      case '+' : buf.push('\\x2B');break;
      case '?' : buf.push('\\x3F');break;
      case '\\' : buf.push('\\x5C');break;
      default : buf.push(c);
    }
  }
  return buf.join('');
}

function cleanword( html ) {//清除word杂乱
 	html = html.replace(/<\/?SPAN[^>]*>/gi, "" );
 	html = html.replace(/<\/?FONT[^>]*>/gi, "" );
 	html = html.replace(/<(\w[^>]*) class=X([^ |>]*)([^>]*)/gi, "<$1$3") ;
 	html = html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
 	html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
 	html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
 	html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
 	
return html;
}
	function attr(o,d){
			if(o==null){return "";}
			return o.getAttribute(d);
		}
    function addattr(obj, attrname, attrvalue) {
    	if(attrname=="value"){
        				obj.value=attrvalue;
        				return;
        			}
        var n = obj.getAttribute(attrname);
          if (n == null) {
            n = document.createAttribute(attrname);
            n.nodeValue = attrvalue;
            obj.setAttributeNode(n);
        }
        else {
        		
             obj.setAttribute(attrname,attrvalue);
        }
        
    }

    function addattrs(obj, txt,sp) {
    		txt=txt.replace(/\s/g,"");
    		if(sp==null){sp=",";}
        var a = txt.split(sp);
         var n;
        for (var k = 0; k < a.length; k += 2) {
              n = obj.getAttributeNode(a[k]);
            if (n == null) {
            	 
                n = document.createAttribute(a[k]);
                n.nodeValue =  a[k+1];
                obj.setAttributeNode(n);
                
            }
            else {
                n.nodeValue =  a[k + 1];
                 
            }
         }

     }
     function addoption(o, arr) {//添加OPTION
          
         var l = o.options.length;
         var oOption;
         var ii=l;
         for (var i = 0; i < arr.length; i += 2) {
             oOption = new Option(arr[i + 1], arr[i]);
             o.options[ii] = oOption;
         ii++;
         }

     }
     function addoptionSmp(o, arr) {//添加OPTION
         
         var l = o.length;
          var oOption;
         for (var i = 0; i < arr.length; i ++) {
             oOption = new Option(arr[i], arr[i]);
             o.options[l] = oOption;
             l++;
         }

     }
     function chgoption(o, arr, add) {
         if (add != null) { addoption(o, arr); return; }
       
         var l = o.length;
         for (var i = l - 1; i > -1; i--) {
             o.options.remove(i);
         }
         l = 0;
         var oOption;
         
         for (var i = 0; i < arr.length; i += 2) {
             oOption = new Option(arr[i + 1], arr[i]);
             o.options[l] = oOption;
             l++;
         }

     }
  function chgoptionSmp(o, arr, add) {
         if (add != null) { addoptionSmp(o, arr); return; }
                 var l = o.length;

         for (var i = l - 1; i > -1; i--) {
             o.options.remove(i);
         }
         l = 0;
         var oOption;
         for (var i = 0; i < arr.length; i++) {
             oOption = new Option(arr[i], arr[i]);
             o.options[i] = oOption;
         }

     }
 function addinputs(n, arr,itype) {//添加
       	 var t="";
         for (var i = 0; i < arr.length; i +=2) {
             t += "<label><input type=\"" + itype + "\" name=\"" + n + "\"  value=\"" + arr[i] + "\" />" + arr[i+1] + "</label> ";
         }
			return t;
     }
 function addinputsSmp(n, arr,itype) {//添加
       	 var t="";
         for (var i = 0; i < arr.length; i++) {
             t += "<label><input type=\"" + itype + "\" name=\"" + n + "\"  value=\"" + arr[i] + "\" />" + arr[i] + "</label> ";
         }
			return t;
     }

function QueryString(it,nullstring){
var svalue = location.search.match(new RegExp("[\?\&]" + it + "=([^\&]*)(\&?)","i"));
 
var v= svalue ? svalue[1] : svalue;

if(v==null){
	return nullstring;
}
return v;
}

 

 function TDhtml(d){
   return (d.length>0)?d:"&nbsp;";
 }       
 

function showhide(o)
{

 	if (o.style.display=="block" || o.style.display=="" )
	{
 		o.style.display="none"
	}
	else {
	o.style.display="";
 }
}

function set2fld(t)
{
	return t.replace(/'/g,"''");
}
function getframe(o) {
    try {
    		//dbg(o.contentWindow==window);
        if (window != o.contentWindow) {
            var a = parent.document.getElementsByTagName("IFRAME");
            for (var i = 0; i < a.length; i++) //author:meizz
            {
                if (a[i].contentWindow == window) {
                    return a[i];
                }
            }
        }

    }
    catch (ex) {
    	dbg("getframe:" + ex);
    	 }
}
function getTop(e){
    var offset=e.offsetTop;
    if(e.offsetParent!=null) {offset+=getTop(e.offsetParent);}
    
    return offset;
}
function getLeft(e){
    var offset=e.offsetLeft;
    if(e.offsetParent!=null) offset+=getLeft(e.offsetParent);
    return offset;
}

function getXY(obj){
 var x = 0, y = 0;
 if (obj.getBoundingClientRect) {
  var box = obj.getBoundingClientRect();
  var D = document.documentElement;
  x = box.left + Math.max(D.scrollLeft, document.body.scrollLeft) - D.clientLeft;
  y = box.top + Math.max(D.scrollTop, document.body.scrollTop) - D.clientTop;
 }
 else {
  for (; obj != document.body; x += obj.offsetLeft, y += obj.offsetTop, obj = obj.offsetParent) {
  }
 }
 return {
  x: x,
  y: y
 }
}
 
function txt2htm(v){
    return  rep(v,"\r\n","</br>") ;
}
function date2timeticks(dd){

}
function htm2txt(v){
     return rep(v,"&lt;BR&gt;","\r\n");
    
}

//gettext
function divsgettxt(d,ref,vi){
    var dd=d.split(",");
    for(var i=0;i<dd.length;i+=2){
        divgettxt(dd[i],dd[i+1],ref,vi);
    }
}
function divgettxt(o,divs,ref,vi){   
         $(divs).innerHTML=gettxt(o,ref,vi);
     }   

     function gettxt(o,ref,vi,defaultv){  
      
        var vtype=new Array("txt","htm","css","xml","");
        if(vi==null){vi=0;}
        if(defaultv==null){defaultv="";}
        var tt=""; 
        if(ref!=null){
             tt="?d=" + Math.random();
            //要求刷新
        }
		 var url = o+ "." + vtype[vi] + tt;
		 if(vi==4){
		 	url = o;
		 }
		  var v=defaultv;
		 
          if(window.ActiveXObject){ 
          var xmlHttp_mainlist = new ActiveXObject("Microsoft.XMLHTTP"); 
         }else if(window.XMLHttpRequest){ 
            xmlHttp_mainlist = new XMLHttpRequest();    
         }    
         try{    

             if(isIE == false ){    
                 xmlHttp_mainlist.open("GET", url, false);    
                 xmlHttp_mainlist.overrideMimeType("text/html;charset=gb2312");    
                 xmlHttp_mainlist.send(null); 
            
                  if (xmlHttp_mainlist.status == 200 || xmlHttp_mainlist.status == 0){ 
                     	  return xmlHttp_mainlist.responseText;   
                      } 
                  
                    
             }else{    
                 var xx=xmlHttp_mainlist.open("GET", url, false);    
                 xmlHttp_mainlist.send(null); 
                
                  if(xmlHttp_mainlist.readyState == 4){  
                      
                      if (xmlHttp_mainlist.status == 200 || xmlHttp_mainlist.status == 0){ 
                     	  return Recenspace(xmlHttp_mainlist.responseBody);  
                      } 
                        return  v;
  
                 }    
             }    
         }catch(ex){   
         	  top.dbg("xmlerr:" + ex);
            return defaultv ;    
         }    
     }   
     function Recenspace(Html){    
        rs_mainlist=new ActiveXObject("ADODB.RecordSet");    
         rs_mainlist.fields.append("a",201,1);    
         rs_mainlist.open();          
         rs_mainlist.addNew();    
         rs_mainlist(0).appendChunk(Html);    
         rs_mainlist.update();    
         return rs_mainlist(0).value;    
         rs_mainlist.close();    
}

 
function today(fmt){
	return (new Date()).format(fmt);
}

Date.prototype.format = function (fmt) {
    if (fmt == null) { fmt = "yyyy-MM-dd EEE"; }
 
    var o = {
        "M+": this.getMonth() + 1,
        //月份
        "d+": this.getDate(),
        //日
        "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12,
        //小时
        "H+": this.getHours(),
        //小时
        "m+": this.getMinutes(),
        //分
        "s+": this.getSeconds(),
        //秒
        "q+": Math.floor((this.getMonth() + 3) / 3),
        //季度
        "S": this.getMilliseconds() //毫秒
    };
    var week = {
        "0": "\u65e5",
        "1": "\u4e00",
        "2": "\u4e8c",
        "3": "\u4e09",
        "4": "\u56db",
        "5": "\u4e94",
        "6": "\u516d"
    };
    if (/(y+)/.test(fmt)) {
        fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    }
    if (/(E+)/.test(fmt)) {
        fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "\u661f\u671f" : "\u5468") : "") + week[this.getDay() + ""]);
    }
    for (var k in o) {
        if (new RegExp("(" + k + ")").test(fmt)) {
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        }
    }
 
    return fmt;
}



 var currentfloatdiv;
        function initfloatdiv(odiv) {
             
          //  odiv.className="movediv";
            var oh = odiv.firstChild;
              oh.className="movedivtitle";
              var moveimg=$class(odiv,"IMG","moveimg");
               var o=oh;
              if(moveimg.length>0){
              	o= moveimg[0];
              	}
              	 
            o.onmousedown = function (e) {

                if (e == null) e = window.event;
                var x = e.layerX ? e.layerX : e.offsetX;
                var y = e.layerY ? e.layerY : e.offsetY;
               
                currentfloatdiv=odiv;
                if (o.setCapture) { // for ie brower
                    o.setCapture();
                    document.onmousemove = function (e) {
                    	 
                        if (e == null) e = window.event;
                        if (!e.pageX) e.pageX = e.clientX;
                        if (!e.pageY) e.pageY = e.clientY;
                        var tx = e.pageX - x;
                        var ty = e.pageY - y;
                        
                        odiv.style.left =tx+ "px";
                        odiv.style.top = ty + "px";
                    };
                    document.onmouseup = function () {
                        if (currentfloatdiv.style.left.indexOf("-") == 0) { currentfloatdiv.style.left = 10; }
                        if (currentfloatdiv.style.top.indexOf("-") == 0) { currentfloatdiv.style.top = 10; }
                        o.releaseCapture();
                        document.onmousemove = null;
                        document.onmouseup = null;
                    };
                } else if (document.addEventListener) {
                     function mouseup(e) {
                        document.removeEventListener("mousemove", mousemove, false);
                        document.removeEventListener("mouseup", mouseup, false);
                    };
                     document.addEventListener("mousemove", mousemove, false);
                    document.addEventListener("mouseup", mouseup, false);
                }
            };
        }
   function initalpha(o,Opacityvalue,showhide,endclass){
   		if(endclass==null){endclass="";}else{endclass=",'" + endclass + "'";}
   	 	o.onfilterchange = new Function("alpha" + showhide + "(this" + endclass + ");");
        o.style.cssText = "filter:alpha(Opacity=" + Opacityvalue + ")";
   	} 
   	 function clearalpha(o){
   	  o.onfilterchange = null;
    	o.style.cssText = "";
   	} 
     function alphahide(obj,endclass) {
         with (obj.filters(0)) {
         		 
             if (Opacity >0) {
                 Opacity -=5;
              }
              else
              {if(endclass!=null){
              	
              		obj.className=endclass;
              
              	}
              	}	
         }
     }
 function alphashow(obj) {
         with (obj.filters(0)) {
             if (Opacity <100) {
                 Opacity +=5;
                 
             }
         }
     }

//chartBegin
function createChart(objChartDiv,strChartType,strChartId,strXml){//生成一个chart
	if(strChartId==null && objChartDiv.children.length>0 ){strChartId=objChartDiv.children[0].id;}
	if(strXml==null){strXml=objChartDiv.getAttribute("xml");}
	if(strChartType==null){strChartType="Column3D";}
 	var	objChart= new FusionCharts("/oa/chart/"+ chartType +".swf", chartId , objChartDiv.offsetWidth, objChartDiv.offsetHeight);
		objChart.setDataXML(strXml);
		objChart.render(objChartDiv);
		addattr(objChartDiv,"xml",strXml);
		
}
function getChartXmlSmp(myRows,cellIdx,captionCellIdx,decimal,myCaption){//按列生成图
		if(decimal==null){decimal="1";}
		if(captionCellIdx==null){captionCellIdx=0;}
     var t="<graph caption=\"" + myCaption + "\" decimalPrecision=\"" + decimal + "\" formatNumberScale=\"0\">";
 		for(var i=0;i<myRows.length;i++){
 			t += "<set name=\"" + myRows[i].cells[captionCellIdx].innerText + "\" value=\"" + myRows[i].cells[cellIdx].innerText + "\" /> ";
			}
		t +="</graph>";
		return t;
}

//chartEnd
