function ProgressbarMapControl(B,A){this.map_=B;
this.width_=A
}ProgressbarMapControl.prototype=new GControl(true,false);
ProgressbarMapControl.prototype.initialize=function(){var A=document.createElement("div");
A.innerHTML='<div style="position:absolute;width:100%;border:5px;text-align:center;vertical-align:bottom;" id="geo_progress_text"></div><div style="background-color:green;height:100%;" id="geo_progress"></div>';
A.id="geo_progress_container";
A.style.display="none";
A.style.width=this.width_+"px";
A.style.fontSize="0.8em";
A.style.height="1.3em";
A.style.border="1px solid #555";
A.style.backgroundColor="white";
A.style.textAlign="left";
this.map_.getContainer().appendChild(A);
return A
};
ProgressbarMapControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(30,56))
};
function ProgressbarControl(A,B){this.options_=B||{};
this.width_=this.options_.width||176;
this.loadstring_=this.options_.loadstring||"Loading...";
this.control_=new ProgressbarMapControl(A,this.width_);
this.map_=A;
this.map_.addControl(this.control_);
this.div_=document.getElementById("geo_progress");
this.text_=document.getElementById("geo_progress_text");
this.container_=document.getElementById("geo_progress_container");
this.operations_=0;
this.current_=0
}ProgressbarControl.prototype.start=function(A){this.div_.style.width="0%";
this.operations_=A||0;
this.current_=0;
this.text_.style.color="#111";
this.text_.innerHTML=this.loadstring_;
this.container_.style.display="block"
};
ProgressbarControl.prototype.updateLoader=function(B){this.current_+=B;
if(this.current_>0){var A=Math.ceil((this.current_/this.operations_)*100);
if(A>100){A=100
}this.div_.style.width=A+"%";
this.text_.innerHTML=this.current_+" / "+this.operations_
}};
ProgressbarControl.prototype.remove=function(){this.container_.style.display="none"
};