
// Copyright (c) metaio GmbH 2006

/** page load percentage bar for the Online AFC
    * \
    * \ author Ben Blachnitzky
    * \
    */


   /* set start percentage to 70, as by the time this .js script is loaded most of the page will already be loaded */
   var  m_percentage = 70;

   /* set the delay between drawing the progress bar units */
   var  m_timePeriod = 1;


  /** returns the visual status of the progress bar **/
  function getBarStatus()
  {
           var retBarStatus = '';

           for(i = 0; i < m_percentage; i++)
           {
                     retBarStatus += "|";
           }

           return retBarStatus;
  }

   /** counts up and draws progress bar to simulate progress **/
   function progressBar()
   {
     	if(m_percentage < 100)
         {
             m_percentage = m_percentage + 1;

             /* write progress bar to browser status field, as this is updated while the page is loading */
             window.status = "Loading : " + m_percentage + "%" + " " + getBarStatus();

             /* set timeout so that the progress can be seen */
             setTimeout ("progressBar()", m_timePeriod);
        }
        else
        {
        	    window.status = "Augmented Furniture Client by metaio GmbH";
        }
   }

 /* start progress bar */
 progressBar();