function addToSelect(obj){
   // Zawiera nazwy stanw USA.
   var _select = document.getElementById("sts");
   var el;
   // W pierwszej kolejnoci usunicie wszystkich opcji, poniewa element select 
   // mg doczy nowo dodane kraje z poprzednich klikni.
   while(_select.hasChildNodes()){
      for(var i = 0; i < _select.childNodes.length; i++){
         _select.removeChild(_select.firstChild);
      }
   }
   // Dodanie po prostu oryginalnych opcji  52 stany USA.
   for(var h=0; h < origOptions.length;h++) {
      _select.appendChild(origOptions[h]);
   }
   // obj jest tablic wartoci nowych opcji.
   for(var i=0; i < obj.length;i++) {
      el = document.createElement("option");
      el.appendChild(document.createTextNode(obj[i]));
      _select.insertBefore(el,_select.firstChild);
   }
}
