Non funziona con elements
allego tutto il codice della pagina

code
-------------------------
<script language="JavaScript">
<!--
function Timer() {
alert ("Il tempo a tua disposizione per muovere la webcam è terminato");
}

function Connect()
{
CominsCamX.SetCamData(form1.txtCamName.value, form1.txtIP.value, form1.txtPort.value,
form1.txtID.value, form1.txtPass.value);
CominsCamX.ConnectVideo();
setTimeout('Timer()',30000)
}

// -->

function _valori(){
this.user=""
this.pwd=""
this.stato=""
}

var dati = new Array()
dati[0] = new _valori()
dati[0].user = "fra"
dati[0].pwd = "fra"
dati[0].stato = "libero"
dati[1] = new _valori()
dati[1].user = "rossano"
dati[1].pwd = "rossano"
dati[1].stato = "libero"
dati[2] = new _valori()
dati[2].user = "angela"
dati[2].pwd = "angela"
dati[2].stato = "libero"
dati[3] = new _valori()
dati[3].user = "max"
dati[3].pwd = "max"
dati[3].stato = "libero"

for (var i=0; i<dati.length; i++) {
if (dati[i].stato=="libero") {
dati[i].stato="occupato";
var theUser=dati[i].user;
var thePwd=dati[i].pwd;
form1.txtID.value = theUser;
document.forms['form1'].elements['txtID'].value=theUser;
document.forms['form1'].elements['txtPass'].value=thePwd;
window.alert("utente "+theUser+" password "+thePwd+": modificato stato da libero a occupato");
break;
}
}


</script>
<%
Response.Write (theUser)
'CONNESSIONE ALLA WEBCAM
S = S & "<BODY onload=Connect()>"
S = S & "<p align=center>OPZIONI</font></p>"
S = S & "<TABLE cellSpacing=1 cellPadding=1 width=100% border=0>"
S = S & "<TR>"
S = S & "<TD>"
'OBJECT WEBCAM
S = S & "<TABLE id=TABLE1 style=WIDTH: 400px; HEIGHT: 400px height=250 cellSpacing=1 cellPadding=1 width=200 align=center border=0>"
S = S & "<TR>"
S = S & "<TD>"
S = S & "<OBJECT ID='CominsCamX' width=320 height=240 CLASSID='CLSID:A1D73A93-3CFA-4047-8256-9B704AEF0F74' codebase='CominsCamX.cab#Version=1,0,1,3'>"
S = S & "</OBJECT>"
S = S & "<form name=form1>"
S = S & "<input type=text value=WebCam View1 name=txtCamName size=8>"
S = S & "<input type=text value=10.0.0.239 name=txtIP size=10>"
S = S & "<input type=text value=700 name=txtPort size=3>"
S = S & "<input type=text value='aaa' name=txtID size=4>"
S = S & "<input type=text value='aaa' name=txtPass size=4>"
S = S & "<input type=button value=Connect onclick=Connect()>"
S = S & "</form>"
S = S & "</TD>"
S = S & "</TR>"
S = S & "</TABLE>"
S = S & "</TD>"
S = S & "<TD>"
'TOOL DI GESTIONE WEBCAM
S = S & "<TABLE id=TABLE1 cellSpacing=1 cellPadding=1 width=200 align=center border=0>"
S = S & "<TR>"
S = S & "<TD colspan=3>"
S = S & "<p align=center><FONT face=Verdana size=1>Tool Webcam</FONT></P>"
S = S & "<tr>"
S = S & "<td width=56 height=28 align=middle>"
S = S & "<p align=center><input onmouseup=ptzstop() onmousedown=ptzLU() type=button value=' Left up ' name=leftup>"
S = S & "</P>"
S = S & "</TD>"
S = S & "<p align=center>"
S = S & "<td width=61 height=28>"
S = S & "<p align=center><input onmouseup=ptzstop() onmousedown=ptzU() type=button value=' UP ' name=up>"
S = S & "</P>"
S = S & "</TD>"
S = S & "<td width=57 height=28>"
S = S & "<p align=center><input onmouseup=ptzstop() onmousedown=ptzRU() type=button value=' Right up ' name=rightup>"
S = S & "</P>"
S = S & "</TD>"
S = S & "</TR>"
S = S & "<tr>"
S = S & "<td width=56 height=28>"
S = S & "<p align=center><input onmouseup=ptzstop() onmousedown=ptzL() type=button value=' Left ' name=left>"
S = S & "</P>"
S = S & "</TD>"
S = S & "<td width=61 height=28>"
S = S & "<p align=center><FONT face=Verdana size=1></FONT>"
S = S & "</P>"
S = S & "</TD>"
S = S & "<td width=57 height=28>"
S = S & "<p align=center><input onmouseup=ptzstop() onmousedown=ptzR() type=button value=' Right ' name=right>"
S = S & "</P>"
S = S & "</TD>"
S = S & "</TR>"
S = S & "<tr>"
S = S & "<td width=56 height=28>"
S = S & "<p align=center><input onmouseup=ptzstop() onmousedown=ptzLD() type=button value='Left Down' name=leftdown>"
S = S & "</P>"
S = S & "</TD>"
S = S & "<td width=61 height=28>"
S = S & "<p align=center><input onmouseup=ptzstop() onmousedown=ptzD() type=button value=' Down ' name=down>"
S = S & "</P>"
S = S & "</TD>"
S = S & "<td width=57 height=28>"
S = S & "<p align=center><input onmouseup=ptzstop() onmousedown=ptzRD() type=button value='Right Down' name=rightdown>"
S = S & "</P>"
S = S & "</TD>"
S = S & "</TR>"
S = S & "<tr>"
S = S & "<td colSpan=3>
"
'ZOOM WEBCAM
S = S & "<TABLE cellSpacing=1 cellPadding=1 width=100% border=0>"
S = S & "<TR>"
S = S & "<TD align=middle><FONT face=Verdana size=1>Zoom</FONT>"
S = S & "<p align=center>"
S = S & "<input onmouseup=zoom_stop() onmousedown=zoom_in() type=button value=' + ' name=zoomin>"
S = S & "<input onmouseup=zoom_stop() onmousedown=zoom_out() type=button value=' - ' name=zoomout>"
S = S & "</P>"
S = S & "</TD>"
S = S & "</TABLE>"
S = S & "</TD>"
S = S & "</TR>"
S = S & "</TABLE>"
S = S & "</TD>"
S = S & "</TR>"
S = S & "<TR>"
S = S & "<TD colspan=2>"
'CHAT
S = S & "<TABLE cellSpacing=1 cellPadding=1 align=center border=0 id=TABLE1>"
S = S & "<TR>"
S = S & "<TD>"
S = S & "<P align=center><img src=chat.gif></P>"
S = S & "</TD>"
S = S & "</TR>"
S = S & "</TABLE>"
S = S & "</TD>"
S = S & "</TR>"
S = S & "</TABLE>"
Response.Write S
%>
--------------------------