﻿/*                                                                                                                                                      
Copyright (c) 2008 v0rbis @ infocom
version: 0.0.1                                                                                                                                        
*/ 

<!--

var _steps,_count;
var _handle,_handle2;

function progress_init(step)
{
   var html='<div id="progress_layer"></div><div id="progress_counter">0%</div>';

   popup('',html);
   
   _steps=0;
   _count=0;

   clearInterval(_handle);
   clearInterval(_handle2);
   
   _handle=setInterval("progress_step()", step);
   _handle2=setInterval("progress_counter()", step/3.3);
   
}

function progress_step()
{
   $("#progress_layer").append('<div class="progress_bar"></div>');
   _steps++;
   if(_steps>=28) progress_stop()

}

function progress_counter()
{
   _count++;
   $("#progress_counter").text(parseInt(_count)+"%");

   if(_count>=90) progress_stop();

}


function progress_stop()
{
  clearInterval(_handle);
  clearInterval(_handle2);   
}


function progress_finish()
{
  clearInterval(_handle);
  clearInterval(_handle2);  
  
  $("#progress_counter").text("100%");
  
}

function progress_fast_finish()
{
  clearInterval(_handle);
  clearInterval(_handle2);  
  
  $("#progress_counter").text("100%");
  $("#progress_layer").css({"background-color":"#9c3"});
  
}




//-->

