function CrocProgressBar(root, value) {
	CrocBase.call(this, root);
	
	this.value = value || 0;
	this.minValue = 0;
	this.maxValue = 100;
	
	this.border = new CrocPanelBorder(
		root,
		"theme/CrocProgressBar/groove-topright.png",
		"theme/CrocProgressBar/groove-top.png",
		"theme/CrocProgressBar/groove-topleft.png",
		"theme/CrocProgressBar/groove-left.png",
		"theme/CrocProgressBar/groove-right.png",
		"theme/CrocProgressBar/groove-bottomleft.png",
		"theme/CrocProgressBar/groove-bottom.png",
		"theme/CrocProgressBar/groove-bottomright.png",
		"theme/CrocProgressBar/groove-center.png"
	);
	
	this.center = new CrocImageSimple(root, "theme/CrocProgressBar/progress-center.png");
	this.center.setScaling('target');
	
	this.left = new CrocImageSimple(root, "theme/CrocProgressBar/progress-left.png");
	this.left.setScaling('none');
	
	this.right = new CrocImageSimple(root, "theme/CrocProgressBar/progress-right.png");
	this.right.setScaling('none');
	
	this.border.addChild(this.center);
	this.border.addChild(this.left);
	this.border.addChild(this.right);
	
	this.border.setTargetHeight("100%");
	this.border.setTargetWidth("100%");
	
};

//We inherit everything from CrocBase
CrocProgressBar.prototype = Object.create(CrocBase.prototype);

CrocProgressBar.prototype.setValue = function(value) {
	
// 	if(value < this.minValue) {
// 		value = this.minValue;
// 	}
// 	
// 	if(value > this.maxValue) {
// 		value = this.maxValue;
// 	}
	
	this.value = value;
	this.getRoot().repaint();
	
};

CrocProgressBar.prototype.paint = function(context, width, height) {
	CrocBase.prototype.paint.call(this, context, width, height);
	
	var currentBorder = this.border;
	
	var lh = this.left.getHeight();
	
	this.center.setTargetHeight(this.left.getHeight());

	interiorWidth = currentBorder.getWidth() - currentBorder.topLeftImage.getWidth() - currentBorder.bottomRightImage.getWidth();	
	
	var currentWidth = (interiorWidth * ((this.value - this.minValue)/(this.maxValue - this.minValue))) - (this.left.getWidth() / 2);
	
	if(currentWidth <= 0) {
		this.center.setVisible(false);
		currentWidth = 0;
	}
	
	else {
		this.center.setVisible(true);
		this.center.setTargetWidth(currentWidth);
	}
	
	currentBorder.setChildOrientation(this.left, 0, 0);
	currentBorder.setChildOrientation(this.center, this.left.getWidth(), 0);
	currentBorder.setChildOrientation(this.right, currentWidth + this.left.getWidth(), 0);
	
	var tlh = currentBorder.topLeftImage.getHeight();
	var brh = currentBorder.bottomLeftImage.getHeight();
	
	var currentHeight = tlh + brh + this.left.getHeight();
	
	currentBorder.paint(context, this.getWidth(), currentHeight);
	
	return;
}
@@ -1271,16 +1271,19 @@
 type.set
+Max
 Value = 
@@ -1291,16 +1291,261 @@
 unction(
+maxValue) %7B%0A%09%0A%09this.maxValue = maxValue;%0A%09%0A%09this.setValue(this.value);%0A%09%0A%7D;%0A%0ACrocProgressBar.prototype.setMinValue = function(minValue) %7B%0A%09this.minValue = minValue;%0A%09%0A%09this.setValue(this.value);%0A%7D;%0A%0ACrocProgressBar.prototype.setValue = function(
 value) %7B
@@ -1547,19 +1547,16 @@
 ue) %7B%0A%09%0A
-// 
 %09if(valu
@@ -1568,35 +1568,32 @@
 his.minValue) %7B%0A
-// 
 %09%09value = this.m
@@ -1605,22 +1605,13 @@
 ue;%0A
-// %09%7D%0A// %09%0A// 
+%09%7D%0A%09%0A
 %09if(
@@ -1635,19 +1635,16 @@
 alue) %7B%0A
-// 
 %09%09value 
@@ -1664,11 +1664,8 @@
 ue;%0A
-// 
 %09%7D%0A%09

add set min and set max for the progress bar