<SCRIPT language=javascript>
var startL=1 //隨傳進的數組而不同
var allCount=1
var modified=0
var currentLine=-1
var line=-1;
function lightOn(ln){
if (ln==null)
ln=parseInt(event.srcElement.ln,10)
for (i=startL;i<PLList.rows.length;i++)
if (tdt[i].ln==ln)
line=i
cln=currentLine
oldLine=-1
for (i=startL;i<PLList.rows.length;i++)
if (tdt[i].ln==cln)
oldLine=i
if (line==oldLine)
return
if (line>0)
{
currentLine=ln
}
}
function delIt()
{
line=parseInt(event.srcElement.ln,10)
if (line>0)
for (i=startL;i<PLList.rows.length;i++)
if (tdt[i].ln==line)
{
PLList.deleteRow(i)
}
}
function newHospitalVisit()
{
newRow=PLList.insertRow(PLList.rows.length);
newRow.id="tdt";
newRow.ln=allCount;
newRow.className="table-content";
newRow.onclick=lightOn;
c1=newRow.insertCell(0);
c1.id="delItem";
c1.ln=allCount;
c1.width="77%";
c1.align='center';
c1.innerHTML='name1 <input type="txt" name="name1" size="60"> name2 <input type="txt" name="name2">';
c2=newRow.insertCell(1);
c2.ln=allCount;
c2.onclick=delIt;
c2.width="23%";
c2.align='center';
c2.innerHTML='<input type="button" name="Button" value=" 刪除 " ln='+allCount+'>';
allCount++
}
function mouseOver()
{
event.srcElement.className="delMouseOver"
}
function mouseOut()
{
event.srcElement.className="scheduleButtonVisible"
}
function checkbox(cb)
{
cb.checked=!cb.checked
}
</SCRIPT>
<form name=frm>
<table align=center class="table-border" cellspacing=0 cellpadding=0 width="100%" id='PLList'>
<TBODY>
<tr class="table-title" align=center id=tdt>
<td colspan="2">
<table align=center cellspacing=0 cellpadding=0 width="100%" class="table-title">
<tr align=center>
<td width="23%">
<INPUT name="name1" type=hidden>
<INPUT name="name2" type=hidden>
<input type="button" name="Button2" value="新加" class="functionButton" onclick=newHospitalVisit()>
</td>
</tr>
</table>
</td>
</tr>
</TBODY>
</table>
</form>