﻿function changClass(obj,css){obj.className = css;}
function  trim(s){return  s.replace(/(^\s*)|(\s*$)/g, "");}
function chkDate(str){ 
  var   reg   =   /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;     
  var   r   =   str.match(reg);     
  if(r==null)return   false;     
  var   d=   new   Date(r[1],   r[3]-1,r[4]);     
  var   newStr=d.getFullYear()+r[2]+(d.getMonth()+1)+r[2]+d.getDate();
  return   newStr==str 
}
function $get(id) {return document.getElementById(id);}  
var brow="";
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
    brow = "ie"+navigator.appVersion.match(/MSIE (.)/)[1];
}
function oWin(u,s,w,h){
    return window.open(u,'',(brow=="ie6"?"menubar=1,toolbar=0":"menubar=0,toolbar=1")+",scrollbars="+
        s+",resizable=1,status=1,location=0"+ (w>0?(",width="+w):"")+(h>0?( ", height="+ h):""));
}
function oDg(u,s,w,h,c,l,t){
     return window.showModalDialog(u,"","dialogWidth='" + w + "px';dialogHeight='" + (brow=="ie6"?h+50:h) + "px';status=0;scroll="
        +s+";help=0;resizable=1;center="+c+(l>0?(";dialogLeft:"+l+";dialogTop:"+t):""));
}
function oDlg(u,s,w,h,c,l,t){
    return window.showModelessDialog(u,"","dialogWidth='" + w + "px';dialogHeight='" + (brow=="ie6"?h+50:h) + "px';status=0;scroll="
        +s+";help=0;resizable=1;center="+c+(l>0?(";dialogLeft:"+l+";dialogTop:"+t):""));
}
function oDgW(u,s,w,h,c,l,t){
     return window.showModalDialog(u,window,"dialogWidth='" + w + "px';dialogHeight='" + (brow=="ie6"?h+50:h) + "px';status=0;scroll="
        +s+";help=0;resizable=1;center="+c+(l>0?(";dialogLeft:"+l+";dialogTop:"+t):""));
}
function oDgV(v,u,s,w,h,c,l,t){
     return window.showModalDialog(u,v,"dialogWidth='" + w + "px';dialogHeight='" + (brow=="ie6"?h+50:h) + "px';status=0;scroll="
        +s+";help=0;resizable=1;center="+c+(l>0?(";dialogLeft:"+l+";dialogTop:"+t):""));
}
function toU(u){window.location=u}
function disTreeClass(){
    var b=$get("dvTreeClass");
    if(b.style.width=="20px"){
        b.style.width="180px";$get("dvTree").style.display="";$get("spTree").style.width="160px";
    }else{
        b.style.width="20px";$get("dvTree").style.display="none";$get("spTree").style.width="20px";
    }
}
function disTClass(){
    var b=$get("divClass");
    if(b.style.width=="20px"){
        b.style.width="180px";$get("dvTree").style.display="";$get("spTree").style.width="160px";
    }else{
        b.style.width="20px";$get("dvTree").style.display="none";$get("spTree").style.width="20px";
    }
}
function setDvTree(){
    try{var a=document.body.style.pixelHeight - 38;
    $get('divClass').style.height = a;$get('dvTree').style.height=a-25;}catch(ex){};
};
function setDvTr2(){
    try{var b=$get('divClass');if(b){
    var a=document.body.style.pixelHeight-38;
    b.style.height = a;$get('dvTree').style.height = a -25;}
    }catch(ex){};
}
function openEmailClear(){ parent.leftFrame.setMenuForMuenId(151);
    oDgW("../../user/mail/mailClear.aspx",1,500,180,1);
};


