function onlyNumber()	{
	if((event.keyCode<48)||(event.keyCode>57))
	event.returnValue=false;
}

function showtip(text)  //显示链接的说明
{
	if (document.all&&document.readyState=="complete")//针对IE
	{
		 //显示跑马灯,内容就是提示框的内容
		document.all.tooltip.innerHTML="<div vAlign=center><font SIZE=2>"+text+"</font></div>";
		document.all.tooltip.style.pixelLeft=event.clientX+document.body.scrollLeft+2;
		document.all.tooltip.style.pixelTop=event.clientY+document.body.scrollTop+5;
//		document.all.tooltip.style.pixelLeft=event.clientX+5;
//		document.all.tooltip.style.pixelTop=event.clientY+5;
		 if (event.clientX>800)
		{
			//document.all.tooltip.style.pixelLeft=680;
			//document.all.tooltip.style.pixelTop=event.clientY+document.body.scrollTop+5;
		}
			//document.all.tooltip.style.visibility="visible";
	}
			document.all.tooltip.style.visibility="visible";
}

document.write(
	"<div id=\"tooltip\" style=\"position:absolute;visibility:hidden; padding:2px;border:0px solid #C0C0C0;\
	;background-color:#FFFFFF; height: 19px; left:77;top: 96px;z-index:10;\"></div>");

function hidetip()  //隐藏链接的说明
{
	if (document.all)
	document.all.tooltip.style.visibility="hidden";
}

function setcolor(fntcolor,bgcolor)
{
	document.all.tooltip.style.bgcolor=bgcolor;
	document.all.tooltip.innerHTML.Color = fntcolor;
}

function showhint(text)
{
	onmousemove=showtip(text);
	onmouseover=showtip(text);
	onmouseout=hidetip();
}

function view(id) {
	var viewurl="/profile1.jsp?user="+id;
	window.open(viewurl,'viewurl','left=70,top=20,width=450,height=320,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');

}

function Text(){
  var berr=false;
  if (!(event.keyCode==45 || event.keyCode==95 || (event.keyCode>=48 && event.keyCode<=57) || (event.keyCode>=65 && event.keyCode<=90) || (event.keyCode>=97 && event.keyCode<=122))) berr=true;
  return !berr;
}

function Pass(){
  var berr=false;
  if (!((event.keyCode>=35 && event.keyCode<=37) || event.keyCode==40 || event.keyCode==42 || (event.keyCode>=44 && event.keyCode<=60) || event.keyCode==62 || (event.keyCode>=64 && event.keyCode<=95) || (event.keyCode>=97 && event.keyCode<=123) || event.keyCode==125 || event.keyCode==126)) berr=true;
  return !berr;
}

function IsNum(){
  var berr=false;
  if (!(event.keyCode>=48 && event.keyCode<=57)) berr=true;
  return !berr;
}

function TreeBar(){
  if (Point.innerText==3){
    Point.innerText=4
    document.all("frmTitle").style.display="none"
  } else {
    Point.innerText=3
    document.all("frmTitle").style.display=""
  }
}
/*

function openwin(theU,theN,W,H,X,Y){
  if (theU==null) theU="about:blank";
  if (theN==null) var Win = window.open(theU,'_top');
  else {
    if (X==null||X==0) X=Math.ceil( (window.screen.width  - W) / 2 ) ;
    if (Y==null||Y==0) Y=Math.ceil( (window.screen.height - H) / 2 );
    var Win = window.open(theU,theN,'status=0,scrollbars=1,resizable=1,fullscreen=0');
    Win.resizeTo( Math.ceil( W ) , Math.ceil( H ) )
    Win.moveTo  ( Math.ceil( X ) , Math.ceil( Y ) );
   }
  Win.focus();
}
*/

function openwin(theU,theN,W,H,X,Y){
	
	//X=Math.ceil( (window.screen.width  - W) / 2 ) ;
    //Y=Math.ceil( (window.screen.height - H) / 2 );
    //window.open(theU,theN,'status=0,scrollbars=1,resizable=1');
    window.open(theU,theN,'width='+W+',height='+H+',left='+X+',top='+Y);
    //Win.focus();
}

function del(FilePath){
  if (confirm('您真的要删除这条记录吗?')){
      window.location.href=FilePath;
  }
}

function chgstyle(idname) {
 
  if (idname.className == "show") 
     {idname.className = "hide";} // change class    
   else   
	{idname.className="show";}
}

function largeimage(ImgSrc) {
  window.open('ImageView.asp?Img='+ImgSrc, "LargeImage", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=488,height=506,center="+(screen.width-498)+",top=10");
}

//------------------------------------------------------------------------------------------------------------------------------------------------------
function getCookieVal (offset) 
   {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
      endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
   }
function GetCookie (name) 
   {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) 
      {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
         return getCookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) 
         break; 
      }
   return null;
   }
function SetCookie (name, value) 
   {
   var argv = SetCookie.arguments;
   var argc = SetCookie.arguments.length;
   var expires = (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;
   document.cookie = name + "=" + escape (value) +
     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
     ((path == null) ? "" : ("; path=" + path)) +
     ((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
   }