var progressBar = new Class({
		initialize: function(id,opt){
			this.id = $(id);
			this.options=new $H({
				width:100,
				background: '#eee',
				border:'1px solid #999',
				barBackground:'#0f0',
				barInc:1
			});

			this.options.extend(opt);
			this.options=this.options.obj;
			this.setBeauty();
			this.go(0);
		},
		setBeauty: function(){
			this.divBar=new Element('div',{
				'styles':{
					width:0,
					background:this.options.barBackground,
					position:'absolute',
					top:0
				}
			}).setHTML('&nbsp;')
			this.id.adopt(this.divBar);
			this.id.setStyles({
				width: this.options.width,
				background: this.options.background,
				border: this.options.border,
				position:'relative'
			});
		},
		go: function(w){
			this.divBar.setStyle('width',w);
			if(w<this.options.width)
				this.go.pass(w+this.options.barInc,this).delay(10);
			else
				this.divBar.setHTML('Listo!!!');
				
		}
	});
	Site={
		start:function(){
			$('btnBegin').addEvent('click',function(){ 
				new progressBar('divProgressBar');
			});
			$('btnBegin1').addEvent('click',function(){ 
				new progressBar('divProgressBar1',{width:400, barBackground:'#7394B8', barInc:10, border:'2px outset #23405F'});
			});
			$('btnBegin2').addEvent('click',function(){ 
				new progressBar('divProgressBar2',{width:200, barBackground:'#ccc url(http://techniq.softr.net/assets/bgProgressBar.png) repeat-x', barInc:5});
			});
			var images = [
				'http://techniq.softr.net/assets/bgProgressBar.png'
			];
			new Asset.images(images);
		}
	}
	window.addEvent("domready", Site.start);