﻿Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ProgressAreaContainerName="Panel";
function getRadProgressArea(_1){
return $find(_1);
}
Telerik.Web.UI.RadProgressArea=function(_2){
Telerik.Web.UI.RadProgressArea.initializeBase(this,[_2]);
this._progressManagerFound=false;
this._popupVisible=false;
this._bodyElement=($telerik.standardsMode)?document.documentElement:document.body;
};
Telerik.Web.UI.RadProgressArea.prototype={initialize:function(){
Telerik.Web.UI.RadProgressArea.callBaseMethod(this,"initialize");
if(!this._progressManagerFound){
alert("Could not find an instance of RadProgressManager on the page. Are you missing the control declaration?");
}
this._setupControls();
this.cancelClicked=false;
if(this._cancelButtonElement){
$addHandlers(this._cancelButtonElement,{"click":this.cancelRequest},this);
}
if(typeof (Telerik.Web.UI.ProgressAreas)=="undefined"){
Telerik.Web.UI.ProgressAreas=[];
}
Telerik.Web.UI.ProgressAreas[Telerik.Web.UI.ProgressAreas.length]=this;
},dispose:function(){
if(this._cancelButtonElement){
$clearHandlers(this._cancelButtonElement);
}
Telerik.Web.UI.RadProgressArea.callBaseMethod(this,"dispose");
},_setupControls:function(){
this._clientId=this.get_id();
this._element=$get(this._clientId);
this._primaryProgressBarElement=this._findElement("PrimaryProgressBarInnerDiv");
this._primaryTotalElement=this._findElement("PrimaryTotal");
this._primaryValueElement=this._findElement("PrimaryValue");
this._primaryPercentElement=this._findElement("PrimaryPercent");
this._secondaryProgressBarElement=this._findElement("SecondaryProgressBarInnerDiv");
this._secondaryTotalElement=this._findElement("SecondaryTotal");
this._secondaryValueElement=this._findElement("SecondaryValue");
this._secondaryPercentElement=this._findElement("SecondaryPercent");
this._currentOperationElement=this._findElement("CurrentOperation");
this._timeElapsedElement=this._findElement("TimeElapsed");
this._timeEstimatedElement=this._findElement("TimeEstimated");
this._speedElement=this._findElement("Speed");
this._cancelButtonElement=this._findElement("CancelButton");
},_findElement:function(_3){
var _4=this._clientId+"_"+Telerik.Web.UI.ProgressAreaContainerName+"_"+_3;
return $get(_4);
},cancelRequest:function(){
this.cancelClicked=true;
},update:function(_5){
var _6=new Sys.CancelEventArgs();
_6._progressData=_5;
_6.get_progressData=function(){
return this._progressData;
};
this.raiseEvent("progressUpdating",_6);
if(_6.get_cancel()){
return;
}
this.show();
_6._progressValue=_5.PrimaryPercent;
_6._progressBarElementName="PrimaryProgressBar";
_6._progressBarElement=this._primaryProgressBarElement;
_6.get_progressValue=function(){
return this._progressValue;
};
_6.get_progressBarElementName=function(){
return this._progressBarElementName;
};
_6.get_progressBarElement=function(){
return this._progressBarElement;
};
this.raiseEvent("progressBarUpdating",_6);
if(!_6.get_cancel()){
this.updateHorizontalProgressBar(this._primaryProgressBarElement,_5.PrimaryPercent);
}
_6._progressValue=_5.SecondaryPercent;
_6._progressBarElementName="SecondaryProgressBar";
_6._progressBarElement=this._secondaryProgressBarElement;
this.raiseEvent("progressBarUpdating",_6);
if(!_6.get_cancel()){
this.updateHorizontalProgressBar(this._secondaryProgressBarElement,_5.SecondaryPercent);
}
this.updateTextIndicator(this._primaryTotalElement,_5.PrimaryTotal);
this.updateTextIndicator(this._primaryValueElement,_5.PrimaryValue);
this.updateTextIndicator(this._primaryPercentElement,_5.PrimaryPercent);
this.updateTextIndicator(this._secondaryTotalElement,_5.SecondaryTotal);
this.updateTextIndicator(this._secondaryValueElement,_5.SecondaryValue);
this.updateTextIndicator(this._secondaryPercentElement,_5.SecondaryPercent);
this.updateTextIndicator(this._currentOperationElement,_5.CurrentOperationText);
this.updateTextIndicator(this._timeElapsedElement,_5.TimeElapsed);
this.updateTextIndicator(this._timeEstimatedElement,_5.TimeEstimated);
this.updateTextIndicator(this._speedElement,_5.Speed);
},show:function(){
if(!this._element){
this._element=$get(this._clientId);
}
this._element.style.display="";
if(this._element.style.position=="absolute"){
if(!this._popupBehavior){
this._popupBehavior=$create(Telerik.Web.PopupBehavior,{"id":(new Date()-100)+"PopupBehavior","parentElement":this._bodyElement},null,null,this._element);
}
if(this._popupVisible==false){
this._popupVisible=true;
var _7=$telerik.getBounds(this._element);
var _8=this._element.style;
var x=_8.left?parseInt(_8.left):_7.x;
var y=_8.top?parseInt(_8.top):_7.y;
this._popupBehavior.set_x(x);
this._popupBehavior.set_y(y);
this._popupBehavior.show();
}
}
},hide:function(){
this._element.style.display="none";
if(this._popupBehavior){
this._popupBehavior.hide(true);
}
},updateTextIndicator:function(_b,_c){
if(_b&&typeof (_c)!="undefined"){
if(typeof (_b.value)=="string"){
_b.value=_c;
}else{
if(typeof (_b.innerHTML)=="string"){
_b.innerHTML=_c;
}
}
}
},updateHorizontalProgressBar:function(_d,_e){
if(_d&&typeof (_e)!="undefined"){
_d.style.width=_e+"%";
}
},updateVerticalProgressBar:function(_f,_10){
if(_f&&typeof (_10)!="undefined"){
_f.style.height=_10+"%";
}
},get_progressManagerFound:function(){
return this._progressManagerFound;
},set_progressManagerFound:function(_11){
this._progressManagerFound=_11;
},add_progressUpdating:function(_12){
this.get_events().addHandler("progressUpdating",_12);
},remove_progressUpdating:function(_13){
this.get_events().removeHandler("progressUpdating",_13);
},add_progressBarUpdating:function(_14){
this.get_events().addHandler("progressBarUpdating",_14);
},remove_progressBarUpdating:function(_15){
this.get_events().removeHandler("progressBarUpdating",_15);
}};
Telerik.Web.UI.RadProgressArea.registerClass("Telerik.Web.UI.RadProgressArea",Telerik.Web.UI.RadWebControl);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();