<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html xmlns:v = "urn:schemas-microsoft-com:vml"><head>
<STYLE>
v\:* { BEHAVIOR: url(#default#VML) }
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
var currentMoveObj = null; //当前拖动对象
var relLeft; //鼠标按下位置相对对象位置
var relTop;
var tables_array=[];//表对象集合
var lines_array=[];//线条集合
var tables_lines=[];//表和线的关系
function init(flag)
{
if(flag==0)//两个表一条线的简单情况
{
tables_array=["tb1","tb2"];
lines_array=["line1"];
tables_lines[0]=[lines_array[0],tables_array[0],tables_array[1]];//line1 From tb1 to tb2
document.getElementById("tb3").style.display="none";
document.getElementById("tb4").style.display="none";
document.getElementById("line2").style.display="none";
document.getElementById("line3").style.display="none";
document.getElementById("line4").style.display="none";
}
else
{
tables_array=["tb1","tb2","tb3","tb4"];
lines_array=["line1","line2","line3","line4"];
tables_lines[0]=[lines_array[0],tables_array[0],tables_array[1]];//line1 From tb1 to tb2
tables_lines[1]=[lines_array[1],tables_array[1],tables_array[2]];//line2 From tb2 to tb3
tables_lines[2]=[lines_array[2],tables_array[0],tables_array[2]];//From, to
tables_lines[3]=[lines_array[3],tables_array[2],tables_array[3]];//From, to
}
}
function f_mdown(obj)
{
currentMoveObj = obj; //当对象被按下时,记录该对象
currentMoveObj.style.position = "absolute";
relLeft = event.x - currentMoveObj.style.pixelLeft;
relTop = event.y - currentMoveObj.style.pixelTop;