Questa è la parte Script dell'Head:
<SCRIPT LANGUAGE = "JavaScript">
function StatoChk (formname, checkid, thestate)
{
var el_collection=eval("document.forms."+formname+"."+checkid)
for (c=0;c<el_collection.length;c++)
{
el_collection[c].disabled = thestate;
}
}
function CtrChk(frm, CmpCnt, CmpAtt, c)
{
myString = CmpAtt;
ArrPar = myString.split(',');
for (i = 0; i < ArrPar.length; i++)
{
cmp = Trim(ArrPar[i]);
if (c.checked){
c.form.elements[cmp].disabled = false;
} else {
c.form.elements[cmp].checked = false;
c.form.elements[cmp].value = '';
c.form.elements[cmp].disabled = true;
}
}
}
function CheckAll(formname,checkid,thestate)
{
var el_collection=eval("document.forms."+formname+"."+checkid)
for (c=0;c<el_collection.length;c++)
{
el_collection[c].checked=thestate
}
}
function ChkData (Frm, CmpGG, CmpMM, CmpAA, GG, MM, AA, GGConf, MMConf, AAConf)
{
if (AA.length == 4)
{
if (MM.length != 2){ MM = "0"+MM;}
if (GG.length != 2){ GG = "0"+GG;}
DataRit = AA+MM+GG;
DataOgg = AAConf+MMConf+GGConf;
if (DataOgg > DataRit)
{
alert ('Data Errata');
document.forms[Frm].elements[CmpGG].value = GGConf;
document.forms[Frm].elements[CmpMM].value = MMConf;
document.forms[Frm].elements[CmpAA].value = AAConf;
document.forms[Frm].elements[CmpGG].focus();
}
}
else
{
if (AAData.length == 0)
{
document.forms[Frm].elements[CmpGG].value = GGConf;
document.forms[Frm].elements[CmpMM].value = MMConf;
document.forms[Frm].elements[CmpAA].value = AAConf;
}
else
{
alert ('Data Errata');
document.forms[Frm].elements[CmpGG].value = GGConf;
document.forms[Frm].elements[CmpMM].value = MMConf;
document.forms[Frm].elements[CmpAA].value = AAConf;
document.forms[Frm].elements[CmpGG].focus();
}
}
}
function CopiaCampo (Da, A, Frm)
{
if (isNav){
e.document.forms[Frm].elements[A].value=e.document.forms[Frm].elements[Da].value;
e.document.forms[Frm].elements[A].focus();
} else {
window.document.forms[Frm].elements[A].value=window.document.forms[Frm].elements[Da].value;
window.document.forms[Frm].elements[A].focus();
}
}
function Cnt(Val, theForm, cmp, Valmax)
{
if (Val > Valmax)
{
alert ('Valore Errato!');
if (isNav){
e.document.forms[theForm].elements[cmp].value='';
e.document.forms[theForm].elements[cmp].focus();
} else {
window.document.forms[theForm].elements[cmp].value='';
window.document.forms[theForm].elements[cmp].focus();
}
}
}
function onlynum(e, h)
{
if (h == 0){ Min = 46;}
else { Min = 48;}
if (e.which)
{
if(e.which!=Min && e.which!=8 && (e.which<48 || e.which>57))
return false;
}
else if(e.keyCode)
{
if(e.keyCode!=Min && e.keyCode!=8 && (e.keyCode<48 || e.keyCode>57))
return false;
}
return true;
}
function form_val(theForm, Campi)
{
myString = Campi;
ArrPar = myString.split(',');
for (i = 0; i < ArrPar.length; i++)
{
cmp = Trim(ArrPar[i]);
if (isNav){
Val = e.document.forms[theForm].elements[cmp].value;
} else {
Val = window.document.forms[theForm].elements[cmp].value;
}
if (Val == "")
{
alert ('Form non completo!');
if (isNav){
e.document.forms[theForm].elements[cmp].focus();
} else {
window.document.forms[theForm].elements[cmp].focus();
}
return false;
}
}
document.forms[theForm].submit();
return (true);
}
function WinPers(url, finestra, w, h)
{
w = parseInt(screen.width * w/100);
h = parseInt(screen.height * h/100);
lt = ((screen.width - w)/2) - 5;
tp = ((screen.height - h)/2) - 40;
popupWin = window.open(url,finestra,'left='+lt+', top='+tp+', scrollbars=yes, titlebar=yes, resizable=yes, status=yes, width='+w+',height = '+h)
}
function WinRight(url, finestra, w, h)
{
w = parseInt(screen.width * w/100);
h = parseInt(screen.height * h/100);
lt = screen.width - w - 13;
tp = 0;
popupWin = window.open(url,finestra,'left='+lt+', top='+tp+', scrollbars=yes,titlebar=yes, resizable=yes, width='+w+',height = '+h)
}
function c_prompt(indi, msg, indi2)
{
res = confirm (msg);
if (res){
document.location.href(indi);
}
else
{
if (indi2 != ''){
document.location.href(indi2);
}
}
}
function Trim(stringa)
{
reTrim=/\s+$|^\s+/g;
return stringa.replace(reTrim,"");
}
function IDGetCtrl(ID)
{
Car = ID.substr(0,2);
Car = Trim(Car);
return Car;
}
function IDGetRiff(ID)
{
Car = ID.substr(2,4);
return Car;
}
function IDGetW(ID)
{
Car = ID.substr(6,2);
return Car;
}
function IDGetH(ID)
{
Car = ID.substr(8,2);
return Car;
}
function IDGetTab(ID)
{
Car = ID.substr(30,25);
Car = Trim(Car);
return Car;
}
function IDGetCmpRit(ID)
{
Car = ID.substr(55,50);
Car = Trim(Car);
return Car;
}
function IDGetDesNor(ID)
{
Car = ID.substr(105,1);
Car = Trim(Car);
return Car;
}
function IDGetKeyPar(ID)
{
Car = ID.substr(106,50);
Car = Trim(Car);
return Car;
}
function IDGetDesEve(ID)
{
Car = ID.substr(156,1);
Car = Trim(Car);
return Car;
}
function RestValPar(KeyPar, frm)
{
VKeyPar = '';
A = KeyPar.length;
if (A > 0)
{
myString = KeyPar;
ArrPar = myString.split(',');
for (i = 0; i < ArrPar.length; i++)
{
cmp = Trim(ArrPar[i]);
if (isNav){
Val = e.document.forms[frm].elements[cmp].value;
} else {
Val = window.document.forms[frm].elements[cmp].value;
}
VKeyPar = VKeyPar+Val+',';
}
}
else
{
VKeyPar = '';
}
return VKeyPar;
}
var isNav=false
if (parseInt(navigator.appVersion)>=4){
if (navigator.appName == "Netscape"){
window.captureEvents(Event.ONKEYPRESS)
window.onkeypress = tasti
isNav = true
}
else
document.onkeydown = tasti
}
var pos=null
var variabili=null
var w=null
var h=null
var KeyC = null
var Id = null
var nm = null
var ctrl = null
var riff = null
var frm = null
var ValInp = null
var Tabella = null
var chiavedes = null
var chiave = null
var chiavesup = null
var CmpRit = null
var FlgDesNor = null
var KeyPar = null
var VKeyPar = null
var DesEve = null
function tasti(e)
{
if (isNav){
KeyC = e.keyCode;
Id = e.srcElement.id;
nm = e.srcElement.name;
ValInp = e.srcElement.value;
}
else {
KeyC = window.event.keyCode;
Id = window.event.srcElement.id;
nm = window.event.srcElement.name;
ValInp = window.event.srcElement.value;
}
KeyPar = Trim(IDGetKeyPar(Id));
VKeyPar = Trim(RestValPar(KeyPar, frm));
ctrl = IDGetCtrl(Id);
riff = IDGetRiff(Id);
w = IDGetW(Id);
h = IDGetH(Id);
Tab = Trim(IDGetTab(Id));
CmpRit = Trim(IDGetCmpRit(Id));
FlgDesNor = Trim(IDGetDesNor(Id));
DesEve = Trim(IDGetDesEve(Id));
if (Id != ''){
if (KeyC == 120){
WinPers('http://www.prova1.int/Ordini/help.php?ctrl='+ctrl+'&riff='+riff+'&nm='+nm+'&Tab='+Tab+'&
CmpRit='+CmpRit+'&FlgDesNor='+FlgDesNor+'&KeyPar='+KeyPar+'&DesEve='+DesEve+'&
VKeyPar='+VKeyPar+'&ValInp='+ValInp+'&ID=&CodTit=&CodSot=&Frm='+frm+'&nm='+nm,'hlp_win',w,h)
}
}
}
function HelpMouse(frm, campo)
{
if (isNav){
Id = e.document.forms[frm].elements[campo].id;
nm = e.document.forms[frm].elements[campo].name;
ValInp = e.document.forms[frm].elements[campo].value;
} else {
Id = window.document.forms[frm].elements[campo].id;
nm = window.document.forms[frm].elements[campo].name;
ValInp = window.document.forms[frm].elements[campo].value;
}
KeyPar = Trim(IDGetKeyPar(Id));
VKeyPar = Trim(RestValPar(KeyPar, frm));
ctrl = IDGetCtrl(Id);
riff = IDGetRiff(Id);
w = IDGetW(Id);
h = IDGetH(Id);
Tab = Trim(IDGetTab(Id));
CmpRit = Trim(IDGetCmpRit(Id));
FlgDesNor = Trim(IDGetDesNor(Id));
DesEve = Trim(IDGetDesEve(Id));
if (Id != ''){
WinPers('http://www.prova1.int/Ordini/help.php?ctrl='+ctrl+'&riff='+riff+'&nm='+nm+'&Tab='+Tab+'&
CmpRit='+CmpRit+'&FlgDesNor='+FlgDesNor+'&KeyPar='+KeyPar+'&DesEve='+DesEve+'&
VKeyPar='+VKeyPar+'&ValInp='+ValInp+'&ID=&CodTit=&CodSot=&Frm='+frm+'&nm='+nm,'hlp_win',w,h)
}
}
function CntCampo(ID)
{
if (isNav){
ValInp = e.srcElement.value;
Id = e.srcElement.id;
}
else {
ValInp = window.event.srcElement.value;
Id = window.event.srcElement.id;
}
ctrl = IDGetCtrl(Id);
riff = IDGetRiff(Id);
w = IDGetW(Id);
h = IDGetH(Id);
Tab = Trim(IDGetTab(Id));
CmpRit = Trim(IDGetCmpRit(Id));
FlgDesNor = Trim(IDGetDesNor(Id));
DesEve = Trim(IDGetDesEve(Id));
KeyPar = Trim(IDGetKeyPar(Id));
VKeyPar = Trim(RestValPar(CmpRit, frm));
switch (ctrl)
{
case 'a' :
if (ValInp == ''){
window.event.srcElement.focus();
}
else {
WinPers('http://www.prova1.int/Ordini/controllo.php?ctrl='+ctrl+'&riff='+riff+'&nm='+nm+'&Tab='+Tab+'&
ID=&CodTit=&CodSot=&Chiave='+ValInp+'&Frm='+frm+'&chiavedes='+chiavedes+'&
chiavesup='+chiavesup+'&CmpRit='+CmpRit+'&FlgDesNor='+FlgDesNor+'&KeyPar='+KeyPar+'&
DesEve='+DesEve+'&VKeyPar='+VKeyPar,'cnt_win',w,h)
}
break;
case 'b' :
if (ValInp == ''){
}
else {
WinPers('http://www.prova1.int/Ordini/controllo.php?ctrl='+ctrl+'&riff='+riff+'&nm='+nm+'&Tab='+Tab+'&
ID=&CodTit=&CodSot=&Chiave='+ValInp+'&Frm='+frm+'&chiavedes='+chiavedes+'&
chiavesup='+chiavesup+'&CmpRit='+CmpRit+'&FlgDesNor='+FlgDesNor+'&KeyPar='+KeyPar+'&
DesEve='+DesEve+'&VKeyPar='+VKeyPar,'cnt_win',w,h)
}
break;
case 'k' :
if (ValInp == ''){
}
else {
WinPers('http://www.prova1.int/Ordini/k_controllo.php?ctrl='+ctrl+'&riff='+riff+'&nm='+nm+'&Tab='+Tab+'&
ID=&CodTit=&CodSot=&Chiave='+ValInp+'&Frm='+frm+'&chiavedes='+chiavedes+'&
chiavesup='+chiavesup+'&CmpRit='+CmpRit+'&FlgDesNor='+FlgDesNor+'&KeyPar='+KeyPar+'&
DesEve='+DesEve+'&VKeyPar='+VKeyPar,'cnt_win',w,h)
}
break;
}
}
</SCRIPT>