Bueno, creo que el problema esta en este bucle...
Código PHP:
<?php
$resultsubcat = mysql_query($sqlsubcat, $mysql);
$counterphp = 0;
$cat = "trash";
while($rows = mysql_fetch_object($resultsubcat)):
if ($cat != trim($rows->IdCategoria)){
$counterphp = 0;
$cat = $rows->IdCategoria;
echo "var option".$cat." = new Array();\n";
}
echo 'option'.$cat.'['.$counterphp.']=new _tupla("'.$rows->SubCategoria.'","'.$rows->IdSubCategoria.'");'."\n";
$counterphp ++;
endwhile;
?>
A ver si le encuentro la falla, porque en Javascript no soy muy bueno...

y tampoco en PHP...