var up,down;

var cmin1,csec1,cmin2,csec2;
function Minutes(data) {
for(var i=0;i<data.length;i++) if(data.substring(i,i+1)==":") break;
return(data.substring(0,i)); }
function Seconds(data) {
for(var i=0;i<data.length;i++) if(data.substring(i,i+1)==":") break;
return(data.substring(i+1,data.length)); }
function Display(min,sec) {
var disp;
if(min<=9) disp=" 0";
else disp=" ";
disp+=min+":";
if(sec<=9) disp+="0"+sec;
else disp+=sec;
return(disp); }

function UpRepeat() {
csec1++;
if(csec1==60) { csec1=0; cmin1++; }
span_timeshow.innerHTML=Display(cmin1,csec1);
up=setTimeout("UpRepeat()",1000); 
}

function noBorderWin(filename,w,h)
{
pop=window.open(filename,"_blank","fullscreen=yes,scrollbars=no");
  pop.resizeTo(w,h);
  pop.moveTo((screen.width-w)/2,(screen.height-h)/2);
}

function nomenuopen(url,wpix,hpix,scroll) {  //弹出无边框窗口
  popup=window.open(url,"popup","toolbar=no,location=no,status=no,menubar=no,scrollbars="+scroll+",resizable=yes,width="+wpix+",height="+hpix);
}
function mopen(url,wpix,hpix) {  //弹出无边框窗口,不能缩放
  window.open(url,"","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+wpix+",height="+hpix);
}

function nopen(url,name,wpix,hpix) {  //弹出无边框窗口,不能缩放,指定窗口
  window.open(url,name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+wpix+",height="+hpix);
}
function nopenr(name,wpix,hpix) {  //弹出无边框窗口,不能缩放,指定窗口用户主页
  var mainnew=window.open("about:blank",name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+wpix+",height="+hpix);
  mainnew.resizeTo(window.screen.width,window.screen.height);
  mainnew.moveTo(0,0);
  mainnew.focus();
}
function turnit()
{
   if(frmTitle.style.display==""){ frmTitle.style.display="none";document.displ.src="/jasinda/jsp/mlls/images/an_3.gif"}
   else{frmTitle.style.display="";document.displ.src="/jasinda/jsp/mlls/images/an_1.gif"}
}

/**
 * 隐藏和显示列表.
 * @return
 */
function turnhide(formid,sb_c){
  if(sb_c.checked==true)
    formid.style.display="none";
  else
    formid.style.display="";
}






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) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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 opens(theURL,width,height) { //v2.0
   window.open(theURL,"","toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=no,width="+width+",height="+height);
}
function opene(theURL) { //v2.0
   window.open(theURL);
}
function opent(theURL,target) { //v2.0
   window.open(theURL,target,"");
}
function delete_onclick(url,d){
   if(confirm("是否确实要删除该记录？注意，删除后不能恢复！")){
      newwin=window.open(url+'?id='+d);
      }
}
function deletes(url,d){
   if(confirm("是否确实要删除该记录？注意，删除后不能恢复！")){
      newwin=window.open(url+'&id='+d,"","left=3000,top=0");
      }
}
function openhide(url,d){//打开隐藏窗口
   newwin=window.open(url+'&id='+d,"","left=3000,top=0");
}
function Trim( s )
{
	return s.replace(/(^\s*)|(\s*$)/g, "");
}

function lTrim( s )
{
    return s.replace(/(^\s*)/g, "");
}

function rTrim( s )
{
    return s.replace(/(\s*$)/g, "");
}
function CheckAll(form){
 {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }
}
function checkShortMessage()
 {
   convertMessageContent()
       if(window.frmMain.NoteSX.value.Trim()=="")
       {
         alert("收消息人不能为空")
             return false
       }
       else if(window.frmMain.NoteNR.value.Trim()=="")
       {
         alert("短消息不能为空")
             return false
       }
       return true
 }
function showmsg()
 {
   window.resizeTo(361,450)
   document.all.showmsgs.style.display="None"
   document.all.hidemsgs.style.display=""
   document.all.hisMsg.style.display=""
   document.all.hisMsg.src="hismsg.jsp?hisname="+document.sendmsg.sendto.value;
	//messageContent.focus();

 }
 function hidemsg()
 {
   window.resizeTo(361,200)
   document.all.showmsgs.style.display=""
   document.all.hidemsgs.style.display="None"
   document.all.hisMsg.style.display="None"
 }
function gf(){
window.moveTo((screen.width-800)/2,(screen.height-600)/2);
window.resizeTo(800,605);
}
function fd(){
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
}

