javascript function not displaying correct page
<p>i want to open a specific window according to a drop down selection, the function works fine on the first row of a set of data (pulling it from a database)
Since i don't know how many rows are going to come each time the script is running, i've created a loop and writting the function as many times as rows there are coming, having them named different.
The thing is that when i change the drop down from the first row, the correct window opens, for instance custom.php?id=1, but when i open the second one, if i select comunicarse from the list, it opens custom.php?id=2 (id=2 is the user's id)
Here is the code, and i really hope you can understand me....</p>

<pre><code> &lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style&gt;
table {
border-style:ridge;
border-width:1px solid;
border-collapse:collapse;
font-family:sans-serif;
font-size:12px;
width:100%;
}
table thead th, table.excel tbody th {
background:#CCCCCC;
border-style:ridge;
border-width:1;
text-align: center;
vertical-align:bottom;
}
table tbody th {
text-align:center;

}
table tbody td {
vertical-align:bottom;
}
table tbody td {
padding: 0 3px;
border: 1px solid 0000000;
}

table  td {
padding: 0 3px;
border: 1px solid 0000000;

}

&lt;/style&gt;


&lt;link rel="stylesheet" href="../css/style.css" type="text/css"&gt;



&lt;?php 
include("../../cons/dbinfo.php");

$busco_react = "SELECT * 
FROM  `envios_mercadolibre` 
WHERE status != 'ENTREGADA'  AND status != 'CANCELADA' AND aviso != 1";
$bus1 = mysql_query($busco_react);
while ($b1 = mysql_fetch_array($bus1)){
$para = $b1['id'];

echo '&lt;script language="Javascript" type="text/javascript"&gt;
function ReactToChange'.$para.'()
{
if (document.getElementById("DropDownList").value === "custom")
{
    window.open("custom.php?id='.$para.'")
}
else if (document.getElementById("DropDownList").value === "comunicarse")
{
    window.open("comunicarse.php?id='.$para.'")
}
else if (document.getElementById("DropDownList").value === "esperando")
{
    window.open("esperando.php?id='.$para.'")
}
else if (document.getElementById("DropDownList").value === "compro")
{
    window.open("compro.php?id='.$para.'")
}
else {}
}
&lt;/script&gt;';

 }
?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table width = "2200px"&gt;
&lt;tr&gt;&lt;td colspan="3" align="center"&gt;&lt;a href="../index.php"&gt;Back to index&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;?php 

echo "&lt;form method='post' action='sendemails.php'&gt;";
echo "&lt;table  border='1' cellpading ='0' cellspacing ='0'&gt;";
echo "&lt;thead&gt;&lt;tr&gt;&lt;th&gt;MAIL&lt;/th&gt;&lt;th&gt;Email Address&lt;/th&gt;&lt;th&gt;Content&lt;/th&gt;
&lt;th&gt;Extra 1&lt;/th&gt;&lt;th&gt;Extra 2&lt;/th&gt;&lt;th&gt;Full Address&lt;/th&gt;&lt;th&gt;Full Name&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody&gt;";

$bus = "SELECT * FROM  `envios_mercadolibre` WHERE status != 'ENTREGADA'  AND status   !=    'CANCELADA' AND aviso != 1";
$bu = mysql_query($bus) or die("este");
while ($b = mysql_fetch_array($bu)){
$contenido = $b['contenido'];
$extra1 = $b['extra1'];
$extra2 = $b['extra2'];
$usuario_id = $b['usuario_id'];
$para1 = $b['id'];

$datosUsuario = "SELECT nombre, apellido, email from usuarios WHERE id = $usuario_id";
$datosU = mysql_query($datosUsuario) or die("foo");
while ($c = mysql_fetch_array($datosU)){
$nombre = $c['nombre'];
$apellido = $c['apellido'];
$email = $c['email'];


$todoelnombre = $nombre.", ".$apellido;

echo "&lt;tr&gt;
&lt;td&gt;&lt;select id='DropDownList' onchange='ReactToChange$para1()'&gt;
&lt;option value='later'&gt;LATER&lt;/option&gt;
&lt;option value='comunicarse'&gt;COMUNICARSE CON NOSOTROS&lt;/option&gt;
&lt;option value='esperando'&gt;ESPERANDO CALIFICACION EN MERCADO LIBRE&lt;/option&gt;
&lt;option value='compro'&gt;NO COMPRO&lt;/option&gt;
&lt;option value='custom'&gt;CUSTOM&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;td&gt;$email&lt;/td&gt;
&lt;td&gt;$contenido&lt;/td&gt;
&lt;td&gt;$extra1&lt;/td&gt;
&lt;td&gt;$extra2&lt;/td&gt;
&lt;td&gt;$todaladire&lt;/td&gt;
&lt;td&gt;$todoelnombre
&lt;input type='hidden' name ='datos-$para1' value ='$email' /&gt;
&lt;/td&gt;
&lt;/tr&gt;
";



}

}

echo "&lt;tr&gt;&lt;TD colspan ='7' align='center'&gt;&lt;input type='submit' /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;";




?&gt;


&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
