function handleCountdownResponse(request)
{
//  alert('handleCountdownResponse response:'+request.request.responseText); //


  if(request.request.responseText == "ended")
  {
    if ( request.page == "call" )
    {
      //window.location = 'index.php?page=agenda';
      if(myGetElementById('infoBoxEndCall'))
        myGetElementById('infoBoxEndCall').style.display = 'block';
      if(myGetElementById('buttonStop'))
      	myGetElementById('buttonStop').style.display = 'none';
      if(myGetElementById('invitationListWrapper'))
        myGetElementById('invitationListWrapper').style.display = 'none';  
      if(myGetElementById('invitationWrapper'))
        myGetElementById('invitationWrapper').style.display = 'none';  
      if(myGetElementById('conferenceControls'))
        myGetElementById('conferenceControls').style.display = 'none';    			    			  
      if(myGetElementById('extendCall'))
        myGetElementById('extendCall').style.display = 'none'; 
      if(myGetElementById('cCountDown'))
        myGetElementById('cCountDown').style.display = 'none'; 
      DoStopCall( conf_id , false, '' );//
      obj.innerHTML = '';
    }
    else if ( request.page == "conf_detail" )
      window.location = 'index.php?page=agenda';
  }
  else
    request.writeHTML();
}

function loopCountDown( interval )
{
  httpCountDown.handle('ajax/countdown.php');
  if (interval>0)
    setTimeout( "loopCountDown("+interval+");", interval);
}

function countDown ( page, tag, interval )
{
  httpCountDown = new HttpRequest();
  
  httpCountDown.response = handleCountdownResponse;
  httpCountDown.tag      = tag;
  httpCountDown.page     = page;
  loopCountDown( interval );
}

/*
function loopCountDown( view, interval )
{
  httpCountDown.handle('ajax/countdown.php?view='+view);
  if (interval>0)
    setTimeout( "loopCountDown('"+view+"',"+interval+");", interval);
}

function countDown ( view, page, tag, interval )
{
  httpCountDown = new HttpRequest();
  
  httpCountDown.response = handleCountdownResponse;
  httpCountDown.tag      = tag;
  httpCountDown.page     = page;
  loopCountDown( view, interval );
}*/
