function SondaWyniki($id,$height,$miejsce)
{
  window.open("http://rozmowy.onet.pl/_loinc/sonda/wyniki.html?ITEM="+ $id +"&MIEJSCE="+ $miejsce +"","","toolbar=no,directories=no,width=495,height="+ $height +",status=no,scrollbars=no,resizable=yes,menubar=no");
}

function SondaZatwierdz($id,$pokaz_wyniki,$height,$miejsce) 
{
   var OK = false;
   var v = '';
   
   for ($i = 0; $i < eval("document.oid"+ $id +".v.length"); $i++){
      if (eval("document.oid"+ $id +".v["+ $i +"].checked")) 
      {
         v = v+($i+1)+',';
         OK = true;
      }
   }

   if(OK)
   {
      if($pokaz_wyniki)
      {
           SondaWyniki($id,$height,$miejsce)
      }
      v=v.slice(0,-1);
      eval("document.oid"+$id+".wart.value='"+v+"';");
      
       return true;
   }
   else
   {
      alert ("Nie zaznaczono odpowiedzi!");
      return false;
   }
}



function Sonda ($curr, $common, $enabled, $disabled, $cookie_name)
{
   var $dlist = "";
   var aCo = document.cookie.split('; ');

for (var i=0; i < aCo.length; i++)
   {
      var aC = aCo[i].split('=');

      if (aC[0] == $cookie_name)
      {
         $dlist = unescape(aC[1]);
         
      }
   }
   $dlist = ','+$dlist+',';

   var $body = $common + (($dlist.indexOf (","+ $curr +",") >= 0) ? $disabled : $enabled);

   for (var $i = 0; $i < $body.length; ++ $i)
   {
      if ("%" == $body.substr ($i, 1))
      {
         $body = $body.substr (0, $i) + unescape ($body.substr ($i, 3)) + $body.substr ($i + 3);
      }
   }   
   
   var re = /Remoting\.addDOMContentLoadedEventListener\((.+?\.init)\)/i;
   var matches = $body.match(re);
   if (matches)
   {
      $body = $body.replace(re, '');
   }
   $body = $body.replace(/####/g, "\r\n");
   document.write (unescape($body));
   if (matches)
   {
      if (window.attachEvent)
      {
         window.attachEvent('onload', function() { eval(matches[1] + '();'); });
      }
      else if (window.addEventListener)
      {
         window.addEventListener('load', function() { eval(matches[1] + '();'); }, false);
      }
   }
}

