la casella di input è così :
echo "<input type = \"Text\" Name = \"OrOr[$giorni]\" id = \"txt".$pos."\" Value = \"".CntPDF($VetOre[$giorni][0],$False,"")."\" Size = \"3\" MAXLENGTH = \"4\" onfocus = \"pos=this.id\" style=\"background=$col_set[$indice_colori];color=$color;\">";
adesso dopo l'onfocus, metterei onblur.