salve mi serve un vostro aiuto.

devo riprendere una variabile da più di una funzione ho fatto così:

codice:
var category;

// dato proviena da un select "onchange='categoria(this.value)
function categoria(dato)
if(dato=="") return;
document.location.href="index.php?cat=+dato;
category=dato;
}

// anche questo dato viene preso da un select "onchange?subcategoria(this.value)"
function subcategoria(dato){
if(dato=="") return;
document.location.href="index.php?cat=+
category+"&subcat="+dato;
}
[/CODE]

ora la variabile category non me la vede in subcategoria come posso risolvere?