// ***********************************************************************************
// SIMPLY PLACE THIS DIV ON THE PAGE:		<div id='js_status_bar'></div>
//
// TO START THE STATUS BAR, CALL FUNCTION:	js_status_bar("START");
// TO STOP THE STATUS BAR, CALL FUNCTION:	js_status_bar("STOP");
// ***********************************************************************************

var js_timeout_status_bar;

function js_status_bar(index) {

   if(index == "STOP") {
      clearTimeout(js_timeout_status_bar);
      js_timeout_status_bar = null;
      document.getElementById("js_status_bar").innerHTML = "";
   }
   else if((!js_timeout_status_bar && index == "START") || (js_timeout_status_bar && typeof(index) == "number")){
      var total_width = 300;
      var total_height = 25;
      var bar_width = 25;
      var bar_color = "#dbfb05";
      var bgcolor_color = "#cbcbcb";
      var border_color = "#808080";

      var bar_margin = index * 2 * bar_width;
      if(index == "START")	index = 0;
      index = index + 1;
      if((bar_margin + bar_width) > total_width) {
         index = 1;
         bar_margin = 0;
      }

      var the_div = "<div style='margin-bottom:20px;  width:"+total_width+"px;  height:"+total_height+"px;  padding:0;  background:"+bgcolor_color+";  border:solid 1px "+border_color+";'>";
      the_div = the_div + "<div style='margin-left:"+bar_margin+"px;  width:"+bar_width+"px;  height:"+total_height+"px;  background:"+bar_color+";'></div>";
      the_div = the_div + "</div>";
      document.getElementById("js_status_bar").innerHTML = the_div;

      js_timeout_status_bar = setTimeout("js_status_bar("+index+")", 200);
   }
}


