/************************************************************************************************************
(C) www.dhtmlgoodies.com, October 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/
var progressbar_steps = 100;	// Total number of progress bar steps.

var wdns__progressPane = false;
var wdns__progressBar_bg = false;
var wdns__progressBar_outer = false;
var wdns__progressBar_txt = false;
var progressbarWidth;
var currentStep = 0;
function moveProgressBar(steps){
	if(!wdns__progressBar_bg){
		wdns__progressPane = document.getElementById('wdns__progressPane');
		wdns__progressBar_bg = document.getElementById('wdns__progressBar_bg');
		wdns__progressBar_outer = document.getElementById('wdns__progressBar_outer');
		wdns__progressBar_txt = document.getElementById('wdns__progressBar_txt');
		progressbarWidth = wdns__progressBar_bg.clientWidth;
	}
	if(!steps){
		wdns__progressBar_outer.style.width = progressbarWidth + 'px';
		wdns__progressBar_txt.innerHTML = '100%';
		setTimeout('document.getElementById("wdns__progressPane").style.display="none"',50);
	}else{
		currentStep+=steps;
		if(currentStep>progressbar_steps)currentStep = progressbar_steps;
		var width = Math.ceil(progressbarWidth * (currentStep / progressbar_steps));
		wdns__progressBar_outer.style.width = width + 'px';
		var percent = Math.ceil((currentStep / progressbar_steps)*100);
		wdns__progressBar_txt.innerHTML = percent + '%';
		if(currentStep==progressbar_steps){
			setTimeout('document.getElementById("wdns__progressPane").style.display="none"',50);
		}
	}




}

function demoProgressBar()
{
	if(currentStep<progressbar_steps){
		moveProgressBar(1);
		setTimeout('demoProgressBar()',25);
	}
}


