﻿// JScript 文件
function showhintinfo(obj, objleftoffset,objtopoffset, title, info , objheight, showtype ,objtopfirefoxoffset)
{
   
   var p = getposition(obj);
   
   if((showtype==null)||(showtype =="")) 
   {
       showtype =="up";
   }
   document.getElementById('hintiframe'+showtype).style.height= 0;
   document.getElementById('hintinfo'+showtype).innerHTML = info;
   document.getElementById('hintdiv'+showtype).style.display='block';
   
   if(objtopfirefoxoffset != null && objtopfirefoxoffset !=0 && !isie())
   {
        document.getElementById('hintdiv'+showtype).style.top=p['y']+parseInt(objtopfirefoxoffset)+"px";
   }
   else
   {
        if(objtopoffset == 0)
        { 
			if(showtype=="up")
			{
				 document.getElementById('hintdiv'+showtype).style.top=p['y']-document.getElementById('hintinfo'+showtype).offsetHeight-40+"px";
			}
			else
			{
				 document.getElementById('hintdiv'+showtype).style.top=p['y']+obj.offsetHeight+5+"px";
			}
        }
        else
        {
			document.getElementById('hintdiv'+showtype).style.top=p['y']+objtopoffset+"px";
        }
   }
   document.getElementById('hintdiv'+showtype).style.left=p['x']+objleftoffset+"px";
}
function hidehintinfo()
{
    document.getElementById('hintdivup').style.display='none';
    document.getElementById('hintdivdown').style.display='none';
}
function getposition(obj)
{
	var r = new Array();
	r['x'] = obj.offsetLeft;
	r['y'] = obj.offsetTop;
	while(obj = obj.offsetParent)
	{
		r['x'] += obj.offsetLeft;
		r['y'] += obj.offsetTop;
	}
	return r;
}
function setcookie()
{
  var theForm = document.forms['form1'];
  if (!theForm) {
    theForm = document.form1;
  }
  var expireDate=new Date();
  document.cookie="uid="+theForm.txt_loginid.value+";"+"expires=Wednesday, 03-Jan-"+eval(expireDate.getYear()+1901)+" 12:34:56 GMT";
  document.cookie="pwd="+theForm.txt_loginpwd.value+";"+"expires=Wednesday, 03-Jan-"+eval(expireDate.getYear()+1901)+" 12:34:56 GMT";
  document.cookie="saves="+theForm.cb_mb.checked+";"+"expires=Wednesday, 03-Jan-"+eval(expireDate.getYear()+1901)+" 12:34:56 GMT";
}
function cookies()
{
   setcookie();
}
function getcookie()
{
  var theForm = document.forms['form1'];
  if (!theForm) {
    theForm = document.form1;
  }
  var strcookie=document.cookie;
  var struid=strcookie.indexOf("uid=");
  if(struid==-1){theForm.txt_loginid.focus();return;}
  var uidend=strcookie.indexOf(";",struid);
  if(uidend==-1){uidend=strcookie.length+1;}
  struid=strcookie.substring(struid+4,uidend);
  var strpwd=strcookie.indexOf("pwd=");
  if(strpwd==-1){theForm.txt_loginpwd.focus();return;}
  var pwdend=strcookie.indexOf(";",strpwd);
  if(pwdend==-1){pwdend=strcookie.length+1;}
  strpwd=strcookie.substring(strpwd+4,pwdend);
  var strsaves=strcookie.indexOf("saves=");
  if(strsaves==-1){return;}
  var savesend=strcookie.indexOf(";",strsaves);
  if(savesend==-1){savesend=strcookie.length+1;}
  strsaves=strcookie.substring(strsaves+6,savesend);
  if(eval(strsaves))
  {
    eval("theForm.cb_mb.checked="+strsaves);
	theForm.txt_loginid.value=struid;
    theForm.txt_loginpwd.value=strpwd;
  }
  
}
