title: How to get result of this script?
body: <p>This is simple countdown script, but I can't get result of this, you definitely see answer as soon you look on it. please safe my time and help me masters.</p>
  
  <p>This is Javascript of making all this happen</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function eventstime(lasttime, repeattime, showid, opentime) {
      if (lasttime &lt; 0) lasttime = repeattime-1;
      if (lasttime &lt;= opentime) {
          document.getElementById(showid).innerHTML = "is Open";
          setTimeout('eventstime('+(lasttime-1)+', '+repeattime+', \''+showid+'\', '+opentime+');', 999);
      } else {
          var secs = lasttime % 60;
          if (secs &lt; 10) secs = '0'+secs;
          var lasttime1 = (lasttime - secs) / 60;
          var mins = lasttime1 % 60;
          if (mins &lt; 10) mins = '0'+mins;
          lasttime1 = (lasttime1 - mins) / 60;
          var hours = lasttime1 % 24;
          var days = (lasttime1 - hours) / 24;
          if (days &gt; 1) days = days+' days + ';
          else if (days &gt; 0) days = days+' day + ';
          document.getElementById(showid).innerHTML = days+hours+':'+mins+':'+secs;
          setTimeout('eventstime('+(lasttime-1)+', '+repeattime+', \''+showid+'\', '+opentime+');', 999);
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>This is unfinished result of event.</p>
  
  <pre><code>  $i = 0;
      echo '';
      foreach ($eventtime as $value) {
          $i++;
          $bc_remain = $value['repeattime'] - ((WEBSITE_REAL_TIME - strtotime($value['start'])) % $value['repeattime']);
          $startevents .= 'eventstime('.$bc_remain.', '.$value['repeattime'].', \'event'.$i.'\', '.$value['opentime'].'); ';
          echo '&lt;tr&gt;&lt;td align="right"&gt;'.$value['name'].':&lt;/td&gt;&lt;td id="event'.$i.'"&gt;&lt;/td&gt;&lt;/tr&gt;';
      }
      echo '&lt;script type="text/javascript"&gt;'.$startevents.'&lt;/script&gt;';
  </code></pre>
  
  <p>And finally this you can call configure </p>
  
  <pre><code>&lt;?php
  $eventtime[1]['name']   = 'Blood Castle';
  $eventtime[1]['start']      = 'Jan 01,  2011 00:19:00';
  $eventtime[1]['repeattime'] = '3600';
  $eventtime[1]['opentime']   = '300';
  
  $eventtime[2]['name']   = 'Devil Square';
  $eventtime[2]['start']      = 'Jan 01,  2011 01:00:00';
  $eventtime[2]['repeattime'] = '7200';
  $eventtime[2]['opentime']   = '300';
  
  $eventtime[3]['name']   = 'Castle Siage';
  $eventtime[3]['start']      = 'Jan 01,  2011 00:00:00';
  $eventtime[3]['repeattime'] = '7200';
  $eventtime[3]['opentime']   = '300';
  
  $eventtime[4]['name']   = 'Shadow';
  $eventtime[4]['start']      = 'Jan 01,  2011 01:00:00';
  $eventtime[4]['repeattime'] = '500';
  $eventtime[4]['opentime']   = '300';
  
  $eventtime[5]['name']   = 'Lucky Hour';
  $eventtime[5]['start']      = 'Jan 01,  2011 01:05:00';
  $eventtime[5]['repeattime'] = '800';
  $eventtime[5]['opentime']   = '300';
  
  $eventtime[6]['name']   = 'Blue';
  $eventtime[6]['start']      = 'Jan 01,  2011 01:00:00';
  $eventtime[6]['repeattime'] = '3900';
  $eventtime[6]['opentime']   = '300';
  
  define('WEBSITE_REAL_TIME', time());
  </code></pre>
  
  <p>I know its simple, but please give quick hand.</p>