//表单提交等待注释程序，TL编制 ,[TL网点] http://www.tlweb.net
//参数：表单对象
function wait_(theform)
{ remtext("请等待...","",true,0);
  theform.submit();
}

//鼠标点击进入注释程序，TL编制 ,[TL网点] http://www.tlweb.net
//参数：注释标题,注释内容是否在下方(true在下方),注释位置(0中,-1左,1右)

function onclickrem(title,y_down,align0)
{ remnone();
}

//鼠标位置注释程序，TL改进 ,[TL网点] http://www.tlweb.net
//参数：注释标题,注释内容,注释内容是否在下方(true在下方),注释位置(0中,-1左,1右)

function remtext(title,text,y_down,align0)
{ var w=9;
  var n=20;
  if(typeof(align0)=='undefined') align0=0;
  if(typeof(y_down)=='undefined') y_down=true;
  width = (w*n).toString();
  if(y_down)
   { 
     offsety = 2*w;
   }
   else
   { width = (2*parseInt(width)).toString();
     offsety =-(((title!=""?Math.floor(title.length/n)+1:0)+(text!=""?Math.floor(text.length/n)+1:0))*w*120/100+w+10);
   }
  switch (align0)
  {
   case 0:
     if(title!="") dcc(text,title); else dcs(text);
     break;
   case 1:
     if(title!="") dlc(text,title); else dls(text);
     break;
   case -1:
     if(title!="") drc(text,title); else drs(text);
     break;
   }
}

//菜单弹出程序，TL改进 ,[TL网点] http://www.tlweb.net
//参数：菜单标题,菜单内容,菜单内容是否在下方(true在下方),菜单位置(0中,-1左,1右)

function menutext(title,text,y_down,align0)
{ var w=9;
  var n=20;
  if(typeof(align0)=='undefined') align0=0;
  if(typeof(y_down)=='undefined') y_down=true;
  width = (w*n).toString();
  if(y_down)
   { 
     offsety = 2*w;
   }
   else
   { width = (2*parseInt(width)).toString();
     offsety =-(((title!=""?Math.floor(title.length/n)+1:0)+(text!=""?Math.floor(text.length/n)+1:0))*w*120/100+w+10);
   }
  switch (align0)
  {
   case 0:
     scc(text,title);
     break;
   case 1:
     slc(text,title);
     break;
   case -1:
     src(text,title);
     break;
   }
}

//取消鼠标位置注释程序，TL编程

function remnone()
{
  nd();
}

document.write('<DIV id=overDiv style="POSITION:absolute;LEFT:0px;TOP:0px;"></DIV>');


// 主背景色（大区域）
// 通常使用明快的颜色
	if (typeof fcolor == 'undefined') { var fcolor = "#99aaff";}
	
// Border的颜色和标题栏的颜色；
// 通常的颜色深
	if (typeof backcolor == 'undefined') { var backcolor = "#7788ff";}
	
	
// 文字的颜色
// 通常是比较深的颜色；
	if (typeof textcolor == 'undefined') { var textcolor = "#000000";}
	
// 标题的颜色
// 通常是明快的颜色；
	if (typeof capcolor == 'undefined') { var capcolor = "#FFFFFF";}
	
// "Close"的颜色
// 通常是明快的颜色；
	if (typeof closecolor == 'undefined') { var closecolor = "#ffff00";}
	
	
// 弹出的窗口的宽度；
// 100-300 pixels 合适
	if (typeof width == 'undefined') { var width = "160";}
	
// 边缘的宽度，象素。
// 1-3 pixels 合适
	if (typeof border == 'undefined') { var border = "0";}
	
	
// 弹出窗口位于鼠标左侧或者右侧的距离，象素。
	if (typeof offsetx == 'undefined') { var offsetx = 0;}
	
// 弹出窗口位于鼠标下方的距离；
	if (typeof offsety == 'undefined') { var offsety = 18;}
	
var x_remtext = 0;
var y_remtext = 0;
var snow_remtext = 0;
var sw_remtext = 0;
var cnt_remtext = 0;
var dir_remtext = 1;
var tr_remtext = 1;
if ( (document.layers) || (document.all) )
 {
	if (document.layers) over = document.overDiv;
	if (document.all) over = overDiv.style;
	document.onmousemove = mouseMove;
	if (document.layers) document.captureEvents(Event.MOUSEMOVE);
 }

// 以下是页面中使用的公共函数；

// Simple popup right 右下方弹出文本
function drs(text)
{
	dts(1,text);
}

// Caption popup right 右下方弹出带标题文本
function drc(text, title)
{
	dtc(1,text,title);
}

// Sticky caption right 右下方弹出带标题文本(CLOSE)
function src(text,title)
{
	stc(1,text,title);
}

// Simple popup left 左下方弹出文本 
function dls(text) {
	dts(0,text);
}

// Caption popup left 左下方弹出带标题文本
function dlc(text, title)
{
	dtc(0,text,title);
}

// Sticky caption left 左下方弹出带标题文本(CLOSE) 
function slc(text,title)
{
	stc(0,text,title);
}

// Simple popup center 中下方弹出文本
function dcs(text)
{
	dts(2,text);
}

// Caption popup center 中下方弹出带标题文本
function dcc(text, title)
{
	dtc(2,text,title);
}

// Sticky caption center 中下方弹出带标题文本(CLOSE)
function scc(text,title)
{
	stc(2,text,title);
}

// Clears popups if appropriate 清除弹出框
function nd()
{
	if ( cnt_remtext >= 1 ) { sw_remtext = 0 };
	if ( (document.layers) || (document.all) ) {
		if ( sw_remtext == 0 ) {
		snow_remtext	 = 0;
			hideObject(over);
		} else {
		cnt_remtext	++;
		}
	}
}


// 非公共函数，被其它的函数调用；

// Simple popup
function dts(d,text)
{
	txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT style=\"line-height:120%;font-size:12px\" FACE=\"宋体\" COLOR=\""+textcolor+"\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
	layerWrite(txt);
    dir_remtext	 = d;
	disp();
}

// Caption popup
function dtc(d,text, title)
{
	txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD align=center ><SPAN ID=\"PTT\" style=\"line-height:120%;font-size:12px\"><FONT COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\" style=\"line-height:120%;font-size:12px\"><FONT COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>";
	layerWrite(txt);
    dir_remtext	 = d;
	disp();
}

// Sticky
function stc(d,text, title)
{
sw_remtext	 = 1;
cnt_remtext	 = 0;
	txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><FONT style=\"line-height:120%;font-size:12px\" COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD><TD ALIGN=RIGHT><A HREF=\"/\" onMouseOver=\"cClick();\" ID=\"PCL\"><FONT style=\"line-height:120%;font-size:12px\" COLOR=\""+closecolor+"\">Close</FONT></A></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT style=\"line-height:120%;font-size:12px\" COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>";
	layerWrite(txt);
    dir_remtext	 = d;
	disp();
    snow_remtext= 0;
}

// Common calls
function disp()
{
	if ( (document.layers) || (document.all) ) {
		if (snow_remtext == 0) 	{
			if (dir_remtext == 2) { // Center
				moveTo(over,x_remtext+offsetx-(width/2),y_remtext+offsety);
			}
			if (dir_remtext == 1) { // Right
				moveTo(over,x_remtext+offsetx,y_remtext+offsety);
			}
			if (dir_remtext == 0) { // Left
				moveTo(over,x_remtext-offsetx-width,y_remtext+offsety);
			}
			showObject(over);
		snow_remtext	 = 1;
		}
	}
// Here you can make the text goto the statusbar.
}

// Moves the layer
function mouseMove(e)
{
	if (document.layers) {x_remtext=e.pageX; y_remtext=e.pageY;}
         else if (document.all) {x_remtext=event.x+document.body.scrollLeft; y_remtext=event.y+document.body.scrollTop;}
	if (snow_remtext) {
		if (dir_remtext == 2) { // Center
			moveTo(over,x_remtext+offsetx-(width/2),y_remtext+offsety);
		}
		if (dir_remtext == 1) { // Right
			moveTo(over,x_remtext+offsetx,y_remtext+offsety);
		}
		if (dir_remtext == 0) { // Left
			moveTo(over,x_remtext-offsetx-width,y_remtext+offsety);
		}
	}
}

// The Close onMouseOver function for Sticky
function cClick() {
	hideObject(over);
    sw_remtext	=0;
}

// Writes to a layer
function layerWrite(txt)
{
        if (document.layers) {
                var lyr = document.overDiv.document;
                lyr.write(txt);
                lyr.close()
        }
        else if (document.all) document.all["overDiv"].innerHTML = txt;
		if (tr_remtext) { trk(); }
}

// Make an object visible
function showObject(obj)
{
        if (document.layers) obj.visibility = "show";
        else if (document.all) obj.visibility = "visible";
}

// Hides an object
function hideObject(obj) {
        if (document.layers) obj.visibility = "hide";
        else if (document.all) obj.visibility = "hidden";
}

// Move a layer
function moveTo(obj,xL,yL) {
        obj.left = xL;
        obj.top = yL;
}

function trk()
{
tr_remtext	 = 0;
}


