Cercando in internet avrei trovato questo js ma che non riesco a capire bene:

Codice PHP:
function globaltypes(){
    var 
globaltype document.getElementById('alltypes').value;
    var 
dltypes document.getElementsByName('type[]');
    for(var 
i=0i<dltypes.lengthi++){
        
dltypes[i].value globaltype;
    }
}


function 
adddls(option){
    var 
dltable document.getElementById('dltable');
    var 
idz document.getElementById('idz').value;
    var 
downloads idz.split(",");
    if(
option == "clear"){
        while (
dltable.firstChild) {
              
dltable.removeChild(dltable.firstChild);
        }
        for(var 
i=0i<downloads.lengthi++){
            var 
thename document.getElementById('lol-'+downloads[i]);
            
thename.style.color "Black";
        }
    }else if(
option == "all"){ 
        for(var 
i=0i<downloads.lengthi++){
            if(
downloads[i] != ""){
                var 
dlnamess document.getElementById('lol-'+downloads[i]).innerHTML
                var 
dllink document.getElementById('sitepath').value+"?p="+downloads[i];
                var 
thename document.getElementById('lol-'+downloads[i]);
                
thename.style.color "Green";
                
                var 
tr document.createElement('tr');
                
                var 
emptytd document.createElement('td');
                var 
titletd document.createElement('td');
    
                var 
inputtitle document.createElement('input');
                
inputtitle.type "text";
                
inputtitle.name "title[]";
                
inputtitle.value dlnamess;
                
inputtitle.size 35;
                
                var 
urltd document.createElement('td');
                
urltd.innerHTML="Url:";
                
                var 
linktd document.createElement('td');
                var 
inputlink document.createElement('input');
                
inputlink.type "text";
                
inputlink.name "url[]";
                
inputlink.value dllink;
                
inputlink.size 25;
                
inputlink.className="input";
                
                var 
typetd document.createElement('td');
                var 
selectt document.createElement('select');
                
selectt.name="type[]";
                
selectt.className="select";
                
                
//Types
                
var app document.createElement('option');
                
app.innerHTML "1";
                var 
game document.createElement('option');
                
game.innerHTML "2";
                var 
movie document.createElement('option');
                
movie.innerHTML "3";
                var 
music document.createElement('option');
                
music.innerHTML "4";
                var 
xxx document.createElement('option');
                
xxx.innerHTML "5";
                var 
ebook document.createElement('option');
                
ebook.innerHTML "6";
                var 
tv document.createElement('option');
                
tv.innerHTML "7";
                var 
other document.createElement('option');
                
other.innerHTML "8";
                            
                
                
selectt.appendChild(1);
                
selectt.appendChild(2);
                
selectt.appendChild(3);
                
selectt.appendChild(4);
                
selectt.appendChild(5);
                
selectt.appendChild(6);
                
selectt.appendChild(7);
                
selectt.appendChild(8);
                
                
typetd.appendChild(selectt);
                
titletd.appendChild(inputtitle);
                
linktd.appendChild(inputlink);
                
                
tr.appendChild(emptytd);
                
tr.appendChild(titletd);
                
tr.appendChild(urltd);
                
tr.appendChild(linktd);
                
tr.appendChild(typetd);
                
                
dltable.appendChild(tr);
            }
        } 
Il problema è che non riesco a cambiare le variabili da associare alla mia pagina...