Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ControlObjectsVisibility=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.ControlObjectsVisibility.prototype={None:0,CheckBoxes:1,RemoveButtons:2,ClearButtons:4,AddButton:8,DeleteSelectedButton:16,Default:(1|2|4|16),All:(1|2|4|8|16)};
Telerik.Web.UI.ControlObjectsVisibility.registerEnum("Telerik.Web.UI.ControlObjectsVisibility",false);
Type.registerNamespace("Telerik.Web.UI.RadUploadUtils");
Telerik.Web.UI.RadUploadUtils.Localization={"Remove":"Remove","Add":"Add","Clear":"Clear","Select":"Select","Delete":"Delete"};
Telerik.Web.UI.RadUploadItemEventArgs=function(_1,_2,_3){
Telerik.Web.UI.RadUploadItemEventArgs.initializeBase(this);
this._row=_1;
this._rowIndex=_2;
this._fileInputField=_3;
};
Telerik.Web.UI.RadUploadItemEventArgs.prototype={get_row:function(){
return this._row;
},get_rowIndex:function(){
return this._rowIndex;
},get_fileInputField:function(){
return this._fileInputField;
}};
Telerik.Web.UI.RadUploadItemEventArgs.registerClass("Telerik.Web.UI.RadUploadItemEventArgs",Sys.EventArgs);
Telerik.Web.UI.RadUploadItemCancelEventArgs=function(_4,_5,_6){
Telerik.Web.UI.RadUploadItemCancelEventArgs.initializeBase(this);
this._row=_4;
this._rowIndex=_5;
this._fileInputField=_6;
};
Telerik.Web.UI.RadUploadItemCancelEventArgs.prototype={get_row:function(){
return this._row;
},get_rowIndex:function(){
return this._rowIndex;
},get_fileInputField:function(){
return this._fileInputField;
}};
Telerik.Web.UI.RadUploadItemCancelEventArgs.registerClass("Telerik.Web.UI.RadUploadItemCancelEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadUploadAddingEventArgs=function(_7,_8){
Telerik.Web.UI.RadUploadAddingEventArgs.initializeBase(this);
this._row=_7;
this._rowIndex=_8;
};
Telerik.Web.UI.RadUploadAddingEventArgs.prototype={get_row:function(){
return this._row;
},get_rowIndex:function(){
return this._rowIndex;
}};
Telerik.Web.UI.RadUploadAddingEventArgs.registerClass("Telerik.Web.UI.RadUploadAddingEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadUploadDeletingSelectedEventArgs=function(_9,_a,_b){
Telerik.Web.UI.RadUploadDeletingSelectedEventArgs.initializeBase(this);
this._rows=_9;
this._rowIndexes=_a;
this._fileInputFields=_b;
};
Telerik.Web.UI.RadUploadDeletingSelectedEventArgs.prototype={get_rows:function(){
return this._rows;
},get_rowIndexes:function(){
return this._rowIndexes;
},get_fileInputFields:function(){
return this._fileInputFields;
}};
Telerik.Web.UI.RadUploadDeletingSelectedEventArgs.registerClass("Telerik.Web.UI.RadUploadDeletingSelectedEventArgs",Sys.CancelEventArgs);
function getRadUpload(_c){
return $find(_c);
}
Telerik.Web.UI.RadUpload=function(_d){
Telerik.Web.UI.RadUpload.initializeBase(this,[_d]);
this._height="";
this._formId="";
this._skin="";
this._enabled=true;
this._maxFileCount=0;
this._initialFileInputsCount=1;
this._inputSize=23;
this._controlObjectsVisibility=Telerik.Web.UI.ControlObjectsVisibility.Default;
this._showCheckboxes=true;
this._showRemoveButtons=true;
this._showClearButtons=true;
this._showAddButton=true;
this._showDeleteButton=true;
this._focusOnLoad=false;
this._enableFileInputSkinning=true;
this._readOnlyFileInputs=false;
this._allowedFileExtensions=[];
this._currentIndex=0;
this._localization=null;
this._rtlCalculated=false;
this._isRightToLeft=false;
this._enableMultipleSelect=false;
this._multipleSelect=null;
this._xapUrl="";
this._slElementHolder=null;
this._isSilverlightInstalledFlag=null;
};
Telerik.Web.UI.RadUpload.prototype={initialize:function(){
Telerik.Web.UI.RadUpload.callBaseMethod(this,"initialize");
var _e=this._getParentForm();
this._updateFormProperties(_e);
if(this._getIsRightToLeft()){
this._applyRightToLeft();
}
if(this._useSilverlight()){
this._multipleSelect=Sys.Serialization.JavaScriptSerializer.deserialize(this._multipleSelect);
}
this._addButton=this._initButton(this._findElement("AddButton"),"Add",this.addFileInput);
this._deleteButton=this._initButton(this._findElement("DeleteButton"),"Delete",this.deleteSelectedFileInputs);
var _f=this._maxFileCount==0?this._initialFileInputsCount:Math.min(this._initialFileInputsCount,this._maxFileCount);
for(var i=0;i<_f;i++){
this.addFileInput();
}
this._setAddDeleteButtonStates();
if(this._useSilverlight()){
this._createSLElement();
this._createSLObject();
}
if(this._displaySilverlightLink()){
this._addSLLink();
}
this._initialized=true;
},dispose:function(){
if(this._addButton){
$clearHandlers(this._addButton);
}
if(this._deleteButton){
$clearHandlers(this._deleteButton);
}
if(this._enableMultipleSelect){
this._slElementHolder=null;
}
var _11=this._getRowCount();
for(var i=0;i<_11;i++){
var _13=this._getRow(i);
if(_13){
$clearHandlers(_13);
var _14=this.getFileInputFrom(_13);
if(_14){
$clearHandlers(_14);
}
var _15=this._getChildSelectButton(_13);
if(_15){
$clearHandlers(_15);
}
var _16=this._getChildFileNameInputField(_13);
if(_16){
$clearHandlers(_16);
}
}
}
Telerik.Web.UI.RadUpload.callBaseMethod(this,"dispose");
},_getParentForm:function(){
var _17=this.get_element();
while(_17&&_17.tagName&&_17.tagName.toLowerCase()!="form"){
_17=_17.parentNode;
}
if(_17&&(!_17.tagName||_17.tagName.toLowerCase()!="form")){
_17=null;
}
return _17;
},_updateFormProperties:function(_18){
if(!_18){
alert("RadUpload requires to be in a form tag to operate properly!");
return;
}
_18.enctype=_18.encoding="multipart/form-data";
},_getChildInputElement:function(row,_1a){
var _1b=row.getElementsByTagName("input");
for(var i=0;i<_1b.length;i++){
if(_1b[i].type==_1a){
return _1b[i];
}
}
return null;
},_getChildInputElements:function(row,_1e){
var _1f=[];
var _20=row.getElementsByTagName("input");
var num=0;
for(var i=0;i<_20.length;i++){
if(_20[i].type==_1e){
_1f[num]=_20[i];
num++;
}
}
return _1f;
},_getChildUploadCheckbox:function(row){
var _24=new RegExp(this.get_id()+"checkbox\\d+$");
var _25=this._getChildInputElements(row,"checkbox");
for(var i=0;i<_25.length;i++){
if(_25[i].id.match(_24)){
return _25[i];
}
}
return null;
},_getChildSelectButton:function(row){
var _28=/ruBrowse/;
var _29=this._getChildInputElements(row,"button");
for(var i=0;i<_29.length;i++){
if(_28.test(_29[i].className)){
return _29[i];
}
}
return null;
},_getChildFileNameInputField:function(row){
var _2c=/ruFakeInput/;
var _2d=this._getChildInputElements(row,"text");
for(var i=0;i<_2d.length;i++){
if(_2c.test(_2d[i].className)){
return _2d[i];
}
}
return null;
},_getRowCount:function(){
var _2f=this._getListElement().getElementsByTagName("li").length;
if(this._showAddButton||this._showDeleteButton){
return _2f-1;
}else{
return _2f;
}
},_getParentRow:function(_30){
if(!_30){
return null;
}
var _31=_30.parentNode;
while(_31.tagName!="LI"){
_31=_31.parentNode;
if(null==_31){
break;
}
}
return _31;
},_getRowIndex:function(row){
var _33=this._getListElement();
var _34=_33.getElementsByTagName("li");
for(var i=0;i<_34.length;i++){
if(_34[i]==row){
return i;
}
}
return null;
},_getRow:function(_36){
var _37=this._getListElement();
var _38=_37.getElementsByTagName("li");
var _39=(_36<_38.length)?_38[_36]:null;
return _39;
},_addRow:function(_3a){
if(_3a<0){
_3a=0;
}
var row=document.createElement("LI");
var _3c=this._getRow(_3a);
var _3d=this._getListElement();
if(_3c){
_3d.insertBefore(row,_3c);
}else{
_3d.appendChild(row);
}
return row;
},getID:function(_3e){
return this.get_id()+_3e+this._currentIndex;
},_findElement:function(_3f){
var _40=this.get_id()+_3f;
return $get(_40);
},_isSilverlightInstalled:function(){
if(this._isSilverlightInstalledFlag==null){
this._isSilverlightInstalledFlag=Silverlight.isInstalled("2.0.30917.0");
}
return this._isSilverlightInstalledFlag;
},_displaySilverlightLink:function(){
return this._enableMultipleSelect&&!this._isSilverlightInstalled()&&this._multipleSelect.EnableSilverlightInstallLink;
},_useSilverlight:function(){
return this._enableMultipleSelect&&this._isSilverlightInstalled();
},_getSlLinkContainer:function(){
if(!this._slLinkContainer){
this._slLinkContainer=document.createElement("span");
this.get_element().appendChild(this._slLinkContainer);
}
return this._slLinkContainer;
},_addSLLink:function(){
this._getSlLinkContainer().innerHTML=this._getSLLinkHtml();
},_getSlElementParent:function(){
if(!this._slElementHolder){
this._slElementHolder=document.createElement("span");
this._slElementHolder.id=this.get_id()+"SLHolder";
document.body.appendChild(this._slElementHolder);
}
return this._slElementHolder;
},_getSlElementId:function(){
return String.format("{0}SLElement");
},_getSlObject:function(){
if(!this._slObject){
this._slObject=$find(this._getSlElementId());
}
return this._slObject;
},_getListElement:function(){
if(!this._listElement){
this._listElement=this._findElement("ListContainer");
if(!this._listElement){
this._listElement=this._createListElement();
}
}
return this._listElement;
},_getSLLinkHtml:function(){
return "<a href=\"http://go2.microsoft.com/fwlink/?LinkID=114576&amp;v=2.0\">"+"<img src=\"http://go2.microsoft.com/fwlink/?LinkID=108181\" alt=\"Get Microsoft Silverlight\" style=\"border-width:0;\" />"+"</a>\r\n";
},_getElementHtml:function(){
var _41=[];
_41[_41.length]="<object type=\"application/x-silverlight-2\"";
_41[_41.length]=" data=\"data:application/x-silverlight-2,\"";
_41[_41.length]=" id=\"";
_41[_41.length]=this._getSlElementId();
_41[_41.length]="\" style=\"height:150px;width:100px;\"";
_41[_41.length]=">\r\n\t";
_41[_41.length]="<param name=\"MinRuntimeVersion\" value=\"2.0.30917.0\">\r\n\r\n\t</param>";
_41[_41.length]=this._getSLLinkHtml();
_41[_41.length]="<a href=\"http://go2.microsoft.com/fwlink/?LinkID=114576&amp;v=2.0\">";
_41[_41.length]="<img src=\"http://go2.microsoft.com/fwlink/?LinkID=108181\" alt=\"Get Microsoft Silverlight\" style=\"border-width:0;\" />";
_41[_41.length]="</a>\r\n";
_41[_41.length]="</object>";
return _41.join("");
},_createSLElement:function(){
Sys.UI.Silverlight.Control.createObject(this._getSlElementParent().id,this._getElementHtml());
},_createSLObject:function(){
$create(Sys.UI.Silverlight.Control,{"source":this._xapUrl},null,null,this._getSlElementParent());
},_createListElement:function(){
var _42=document.createElement("ul");
_42.id=String.format("{0}ListContainer",this.get_id());
_42.className="ruInputs";
_42.style.height=this._height;
this.get_element().appendChild(_42);
return _42;
},_getIsRightToLeft:function(){
if(!this._rtlCalculated){
var _43=this.get_element();
this._isRightToLeft=$telerik.getCurrentStyle(_43,"direction","ltr")=="rtl";
return this._isRightToLeft;
this._rtlCalculated=true;
}
return this._isRightToLeft;
},_applyRightToLeft:function(){
var _44=this.get_element();
if(/radupload_rtl/.test(_44.className)){
return;
}
$telerik.addCssClasses(_44,["radupload_rtl",String.format("RadUpload_{0}_rtl",this._skin)]);
},_initButton:function(_45,_46,_47){
if(_45){
var loc=this.get_localization();
_45.value=loc[_46];
if(this._enabled){
if(_47){
$addHandlers(_45,{"click":_47},this);
}
}else{
_45.disabled=true;
}
}
return _45;
},addFileInput:function(_49){
var _4a=this.addFileInputAt(this._getRowCount());
if(this._initialized){
try{
_4a.focus();
}
catch(ex){
}
}
},addFileInputAt:function(_4b){
if(typeof (_4b)=="undefined"||_4b>this._getRowCount()){
_4b=this._getRowCount();
}
if(this._maxFileCount>0&&_4b>=this._maxFileCount){
return;
}
if(this._initialized){
var row=this._getRow(_4b);
var _4d=new Telerik.Web.UI.RadUploadAddingEventArgs(row,_4b);
this.raiseEvent("adding",_4d);
if(_4d.get_cancel()){
return;
}
}
this.addFileInputAtInternal(_4b);
},addFileInputAtInternal:function(_4e){
var row=this._addRow(_4e);
$addHandlers(row,{"click":this._rowClicked},this);
if(this._showCheckboxes){
this.appendCheckBox(row);
}
this.appendStyledFileInput(row);
if(this._showClearButtons){
this.appendClearButton(row);
}
if(this._showRemoveButtons){
this.appendRemoveButton(row);
}
this._setAddDeleteButtonStates();
var _50=new Telerik.Web.UI.RadUploadItemEventArgs(row,_4e,this.getFileInputFrom(row));
this.raiseEvent("added",_50);
this._currentIndex++;
return row;
},appendCheckBox:function(_51){
var _52=document.createElement("input");
_52.type="checkbox";
_52.id=_52.name=this.getID("checkbox");
_51.appendChild(_52);
_52.className="ruCheck";
_52.disabled=!this._enabled;
return _52;
},appendClearButton:function(_53){
var _54=document.createElement("input");
_54.type="button";
_54.id=this.getID("clear");
_53.appendChild(_54);
this._initButton(_54,"Clear");
_54.className="ruButton ruClear";
_54.name="ClearInput";
_54.disabled=!this._enabled;
return _54;
},appendRemoveButton:function(_55){
var _56=document.createElement("input");
_56.type="button";
_56.id=this.getID("remove");
_55.appendChild(_56);
var loc=this.get_localization();
_56.value=loc["Remove"];
_56.className="ruButton ruRemove";
_56.name="RemoveRow";
_56.disabled=!this._enabled;
return _56;
},appendStyledFileInput:function(_58){
if(!this._useSilverlight()){
var _59=this.createFileInput();
this._fileInput=_59;
$addHandlers(_59,{"change":this.uploadFileSelected},this);
}
var _5a=document.createElement("span");
_5a.className="ruFileWrap";
_58.appendChild(_5a);
if(!this._useSilverlight()){
_5a.appendChild(_59);
}
if(this._useSilverlight()||this._enableFileInputSkinning){
Sys.UI.DomElement.addCssClass(_5a,"ruStyled");
if(!this._useSilverlight()){
_59.className="ruFileInput";
}
this._appendFakeInput(_5a);
if(!this._useSilverlight()){
if(!this._readOnlyFileInputs){
$addHandlers(_59,{"keyup":this._syncFileInputContent},this);
}else{
$addHandlers(_59,{"keydown":this._cancelEvent},this);
}
}
if(!this._useSilverlight()&&$telerik.standardsMode){
this._hideFileInput(_59);
_5a.style.position="static";
var _5b={"mousemove":this._getFileInputMouseMoveHandler(),"mouseover":this._getFileInputMouseMoveHandler(),"mouseout":this._getFileInputMouseOutHandler()};
$addHandlers(_59,_5b,this);
}
return _5a;
}else{
_59.className="";
if(this._readOnlyFileInputs){
$addHandlers(_59,{"keydown":this._cancelEvent},this);
}
return _59;
}
},_selectButtonMouseOver:function(e){
var _5d=e.target||e.srcElement;
var row=this._getParentRow(_5d);
var _5f=this.getFileInputFrom(row);
this._positionFileInput(_5f,_5d,this._getChildFileNameInputField(row),e);
},_selectButtonMouseOut:function(e){
var _61=e.target||e.srcElement;
var row=this._getParentRow(_61);
var _63=this.getFileInputFrom(row);
this._hideFileInput(_63);
},_hideFileInput:function(_64){
var _65={x:0,y:-5000};
$telerik.setLocation(_64,_65);
},_getScrollBarWidth:function(){
var _66,_67=0;
var _68=document.createElement("div");
_68.style.position="absolute";
_68.style.top="-1000px";
_68.style.left="-1000px";
_68.style.width="100px";
_68.style.height="50px";
_68.style.overflow="hidden";
var _69=document.createElement("div");
_69.style.width="100%";
_69.style.height="200px";
_68.appendChild(_69);
document.body.appendChild(_68);
var _6a=_69.offsetWidth;
_68.style.overflow="auto";
var _6b=_69.offsetWidth;
this._scrollbarWidth=_6a-_6b;
if(this._scrollbarWidth<=0){
_69.style.width="300px";
_66=_68.offsetWidth;
_67=_68.clientWidth;
this._scrollbarWidth=_66-_67;
}
if(this._scrollbarWidth<=0){
this._scrollbarWidth=16;
}
document.body.removeChild(document.body.lastChild);
return this._scrollbarWidth;
},_positionFileInput:function(_6c,_6d,_6e,e){
var _70;
if($telerik.isMouseOverElement(_6d,e)){
var _71=$telerik.getDocumentRelativeCursorPosition(e);
_70={x:_71.left+10-_6c.offsetWidth,y:_71.top+10-_6c.offsetHeight};
_70=this._adjustLocationToNonStaticParent(_70,_6d);
if(this._getIsRightToLeft()&&!$telerik.isOpera){
_70.x+=_6e.offsetWidth;
}
_70=this._adjustLocationToScrollOffset(_70,_6d);
if($telerik.isIE){
_6c.blur();
}
}else{
if($telerik.isMouseOverElement(_6e,e)){
_70=$telerik.getLocation(_6e);
_70=this._adjustLocationToNonStaticParent(_70,_6e);
if(this._getIsRightToLeft()&&!$telerik.isOpera){
_70.x-=_6d.offsetWidth;
if($telerik.isIE&&document.body.dir=="rtl"){
_70.x-=this._getScrollBarWidth();
}
}
_70=this._adjustLocationToScrollOffset(_70,_6d);
}else{
this._hideFileInput(_6c);
return;
}
}
$telerik.setLocation(_6c,_70);
},_adjustLocationToNonStaticParent:function(_72,_73){
var _74=this._getFirstNonStaticParent();
if(_74){
var _75=$telerik.getLocation(_74);
_72.x-=_75.x;
_72.y-=_75.y;
if($telerik.isFirefox){
_72.y-=parseInt($telerik.getCurrentStyle(_73,"paddingTop",0));
_72.y-=parseInt($telerik.getCurrentStyle(_73,"paddingBottom",0));
_72.y-=parseInt($telerik.getCurrentStyle(_73,"borderTop",0));
_72.y-=parseInt($telerik.getCurrentStyle(_73,"borderBottom",0));
_72.y-=parseInt($telerik.getCurrentStyle(_73,"marginTop",0));
_72.y-=parseInt($telerik.getCurrentStyle(_73,"marginBottom",0));
if(_74.tagName.toLowerCase()=="fieldset"){
var _76=_74.getElementsByTagName("legend");
if(_76.length>0){
_72.y-=_76[0].offsetHeight;
}
if(_73.type=="text"){
_72.x-=parseInt($telerik.getCurrentStyle(_74,"marginLeft"))+2||2;
}
_72.y-=parseInt($telerik.getCurrentStyle(_74,"paddingTop",0));
_72.x-=parseInt($telerik.getCurrentStyle(_74,"paddingLeft",0));
}
}
}
return _72;
},_adjustLocationToScrollOffset:function(_77,_78){
if($telerik.isIE&&this._getIsRightToLeft()){
return _77;
}
var _79=this.get_element().parentNode;
if(_79.scrollTop){
_77.y+=_79.scrollTop;
}
if(_79.scrollLeft){
_77.x+=_79.scrollLeft;
}
return _77;
},_getLocation:function(_7a){
var l=$telerik.getLocation(_7a);
return l;
},_getFirstNonStaticParent:function(){
if(typeof (this._firstNonStaticParent)=="undefined"){
this._firstNonStaticParent=null;
var _7c=this.get_element();
while(_7c&&_7c.nodeType!=9&&this._isElementStatic(_7c)){
_7c=_7c.parentNode;
}
if(_7c&&_7c.nodeType!=9){
this._firstNonStaticParent=_7c;
}
}
return this._firstNonStaticParent;
},_isTableElement:function(_7d){
if(!_7d.tagName){
return false;
}
var _7e=_7d.tagName.toLowerCase();
return _7e=="table"||_7e=="tr"||_7e=="td"||_7e=="th"||_7e=="tbody";
},_isElementStatic:function(_7f){
if(this._isTableElement(_7f)&&!$telerik.isIE){
return true;
}
var _80=$telerik.getCurrentStyle(_7f,"position").toLowerCase();
if(_80!=""&&_80!="static"){
return false;
}
return true;
},_fileInputMouseMove:function(e){
var _82=e.target||e.srcElement;
if(_82.type!="file"){
return;
}
var row=this._getParentRow(_82);
if(!row){
return;
}
var _84=this._getChildSelectButton(row);
this._positionFileInput(_82,_84,this._getChildFileNameInputField(row),e);
},_fileInputMouseOut:function(e){
var _86=e.target||e.srcElement;
if(_86.type!="file"){
return;
}
var row=this._getParentRow(_86);
if(!row){
return;
}
var _88=this._getChildSelectButton(row);
this._positionFileInput(_86,_88,this._getChildFileNameInputField(row),e);
},_onFakeFileInputMouseEvent:function(e){
var _8a=e.target||e.srcElement;
var row=this._getParentRow(_8a);
var _8c=this.getFileInputFrom(row);
if($telerik.getLocation(_8a)==$telerik.getLocation(_8c)){
return;
}
this._positionFileInput(_8c,this._getChildSelectButton(row),_8a,e);
},_getFileInputMouseMoveHandler:function(){
if(this._fileInputMouseMoveHandler==null){
this._fileInputMouseMoveHandler=Function.createDelegate(this,this._fileInputMouseMove);
}
return this._fileInputMouseMoveHandler;
},_getFileInputMouseOutHandler:function(){
if(this._fileInputMouseOutHandler==null){
this._fileInputMouseOutHandler=Function.createDelegate(this,this._fileInputMouseOut);
}
return this._fileInputMouseOutHandler;
},_getSelectButtonMouseOverHandler:function(){
if(this._selectButtonMouseOverHandler==null){
this._selectButtonMouseOverHandler=Function.createDelegate(this,this._selectButtonMouseOver);
}
return this._selectButtonMouseOverHandler;
},_getSelectButtonMouseOutHandler:function(){
if(this._selectButtonMouseOutHandler==null){
this._selectButtonMouseOutHandler=Function.createDelegate(this,this._selectButtonMouseOut);
}
return this._selectButtonMouseOutHandler;
},_getFakeFileInputMouseHandler:function(){
if(this._fakeFileInputMouseHandler==null){
this._fakeFileInputMouseHandler=Function.createDelegate(this,this._onFakeFileInputMouseEvent);
}
return this._fakeFileInputMouseHandler;
},_initFakeInputSelectButton:function(_8d){
var _8e={"mouseover":this._getSelectButtonMouseOverHandler(),"mouseout":this._getSelectButtonMouseOutHandler()};
if($telerik.isIE){
_8e["mousemove"]=this._getSelectButtonMouseOverHandler();
}
$addHandlers(_8d,_8e,this);
},_appendFakeInput:function(_8f){
var _90=document.createElement("input");
_90.type="text";
_90.className="ruFakeInput";
_90.size=this._inputSize-1;
if($telerik.standardsMode){
var _91={"mouseover":this._getFakeFileInputMouseHandler(),"mousemove":this._getFakeFileInputMouseHandler(),"mouseout":this._getFakeFileInputMouseHandler()};
$addHandlers(_90,_91,this);
}
_8f.appendChild(_90);
var _92=document.createElement("input");
_92.type="button";
_8f.appendChild(_92);
this._initButton(_92,"Select");
this._initFakeInputSelectButton(_92);
_92.disabled=!this._enabled;
_92.className="ruButton ruBrowse";
if($telerik.isSafari){
var _93=$telerik.getBounds(_92).width;
var _94=$telerik.getBounds(_90).width;
var _95=this._fileInput;
if(_95){
_95.style.width=(_93+_94)+"px";
}
}
},createFileInput:function(){
var _96=document.createElement("input");
_96.type="file";
_96.name=this.getID("file");
_96.id=this.getID("file");
_96.disabled=!this._enabled;
_96.size=this._inputSize;
return _96;
},_setAddDeleteButtonStates:function(){
var _97=this._getRowCount();
this._setButtonState(this._deleteButton,_97>0);
this._setButtonState(this._addButton,(this._maxFileCount<=0)||(_97<this._maxFileCount));
},_setButtonState:function(_98,_99){
if(_98){
if(_99){
Sys.UI.DomElement.removeCssClass(_98,"ruButtonDisabled");
}else{
Sys.UI.DomElement.addCssClass(_98,"ruButtonDisabled");
}
}
},_cancelEvent:function(_9a){
return $telerik.cancelRawEvent(_9a);
},clearFileInputAt:function(_9b){
var row=this._getRow(_9b);
if(row){
var _9d=new Telerik.Web.UI.RadUploadItemCancelEventArgs(row,_9b,this.getFileInputFrom(row));
this.raiseEvent("clearing",_9d);
if(_9d.get_cancel()){
return false;
}
this.deleteFileInputAt(_9b,true);
this.addFileInputAtInternal(_9b,true);
}
},deleteSelectedFileInputs:function(_9e){
var _9f=[];
var _a0=[];
var _a1=[];
var _a2=this._getRowCount()-1;
for(var i=_a2;i>=0;i--){
var _a4=this._getRow(i);
var _a5=this._getChildUploadCheckbox(_a4);
if(_a5&&_a5.checked){
_9f[_9f.length]=_a4;
_a1[_a1.length]=i;
_a0[_a0.length]=this.getFileInputFrom(_a4);
}
}
var _a6=new Telerik.Web.UI.RadUploadDeletingSelectedEventArgs(_9f,_a1,_a0);
this.raiseEvent("deletingSelected",_a6);
if(_a6.get_cancel()){
return;
}
for(var i=0;i<_a1.length;i++){
this.deleteFileInputAt(_a1[i],true);
}
},deleteFileInputAt:function(_a7,_a8){
var row=this._getRow(_a7);
if(row){
if(!_a8){
var _aa=new Telerik.Web.UI.RadUploadItemCancelEventArgs(row,_a7,this.getFileInputFrom(row));
this.raiseEvent("deleting",_aa);
if(_aa.get_cancel()){
return false;
}
}
var _ab=this._getChildSelectButton(row);
if(_ab){
$clearHandlers(_ab);
}
$clearHandlers(row);
row.parentNode.removeChild(row);
this._setAddDeleteButtonStates();
}
},getFileInputFrom:function(row){
return this._getChildInputElement(row,"file");
},getFileInputs:function(){
var _ad=[];
var _ae=this._getRowCount();
for(var i=0;i<_ae;i++){
var _b0=this.getFileInputFrom(this._getRow(i));
if(_b0){
_ad[_ad.length]=_b0;
}
}
return _ad;
},uploadFileSelected:function(e){
if(this._enableFileInputSkinning){
this._syncFileInputContent(e);
}
var _b2=e.target;
_b2.alt=_b2.title=_b2.value;
var row=this._getParentRow(_b2);
var _b4=new Telerik.Web.UI.RadUploadItemEventArgs(row,this._getRowIndex(row),_b2);
this.raiseEvent("fileSelected",_b4);
},_syncFileInputContent:function(e){
var _b6=e.target;
var _b7=_b6.parentNode.getElementsByTagName("input");
var _b8=null;
for(var i=0;i<_b7.length;i++){
var _ba=_b7[i];
if(_ba.type=="text"){
_b8=_ba;
break;
}
}
if(_b6!==_b8){
_b8.value=_b6.value;
_b8.title=_b6.value;
}
},isExtensionValid:function(_bb){
if(_bb==""){
return true;
}
var _bc=this._allowedFileExtensions.length;
for(var i=0;i<_bc;i++){
var _be=this._allowedFileExtensions[i];
var _bf=_be.substring(1);
var _c0=new RegExp("."+_bf+"$","ig");
if(_bb.match(_c0)){
return true;
}
}
return false;
},validateExtensions:function(){
var _c1=this._getRowCount();
for(var i=0;i<_c1;i++){
var row=this._getRow(i);
var _c4=this.getFileInputFrom(row).value;
if(!this.isExtensionValid(_c4)){
return false;
}
}
return true;
},_rowClicked:function(e){
var _c6=e.target;
var _c7=this._getParentRow(_c6);
var _c8=this._getRowIndex(_c7);
if(_c6.name=="RemoveRow"){
this.deleteFileInputAt(_c8);
}else{
if(_c6.name=="ClearInput"){
this.clearFileInputAt(_c8);
}
}
},get_localization:function(){
return this._localization;
},set_localization:function(_c9){
this._localization=_c9;
},get_inputSize:function(){
return this._inputSize;
},set_inputSize:function(_ca){
this._inputSize=_ca;
},get_controlObjectsVisibility:function(){
return this._controlObjectsVisibility;
},set_controlObjectsVisibility:function(_cb){
this._controlObjectsVisibility=_cb;
var _cc=Telerik.Web.UI.ControlObjectsVisibility;
this._showCheckboxes=(_cb&_cc.CheckBoxes);
this._showRemoveButtons=(_cb&_cc.RemoveButtons);
this._showClearButtons=(_cb&_cc.ClearButtons);
this._showAddButton=(_cb&_cc.AddButton);
this._showDeleteButton=(_cb&_cc.DeleteSelectedButton);
},get_allowedFileExtensions:function(){
return this._allowedFileExtensions;
},set_allowedFileExtensions:function(_cd){
if(!_cd){
this._allowedFileExtensions=[];
}else{
this._allowedFileExtensions=eval(_cd);
}
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_ce){
this._enabled=_ce;
},get_maxFileCount:function(){
return this._maxFileCount;
},set_maxFileCount:function(_cf){
this._maxFileCount=_cf;
},get_initialFileInputsCount:function(){
return this._initialFileInputsCount;
},set_initialFileInputsCount:function(_d0){
this._initialFileInputsCount=_d0;
},get_enableFileInputSkinning:function(){
return this._enableFileInputSkinning;
},set_enableFileInputSkinning:function(_d1){
this._enableFileInputSkinning=_d1;
},get_focusOnLoad:function(){
return this._focusOnLoad;
},set_focusOnLoad:function(_d2){
this._focusOnLoad=_d2;
},get_formId:function(){
return this._formId;
},set_formId:function(_d3){
this._formId=_d3;
},get_readOnlyFileInputs:function(){
return this._readOnlyFileInputs;
},set_readOnlyFileInputs:function(_d4){
this._readOnlyFileInputs=_d4;
},add_adding:function(_d5){
this.get_events().addHandler("adding",_d5);
},remove_adding:function(_d6){
this.get_events().removeHandler("adding",_d6);
},add_added:function(_d7){
this.get_events().addHandler("added",_d7);
},remove_added:function(_d8){
this.get_events().removeHandler("added",_d8);
},add_fileSelected:function(_d9){
this.get_events().addHandler("fileSelected",_d9);
},remove_fileSelected:function(_da){
this.get_events().removeHandler("fileSelected",_da);
},add_deleting:function(_db){
this.get_events().addHandler("deleting",_db);
},remove_deleting:function(_dc){
this.get_events().removeHandler("deleting",_dc);
},add_clearing:function(_dd){
this.get_events().addHandler("clearing",_dd);
},remove_clearing:function(_de){
this.get_events().removeHandler("clearing",_de);
},add_deletingSelected:function(_df){
this.get_events().addHandler("deletingSelected",_df);
},remove_deletingSelected:function(_e0){
this.get_events().removeHandler("deletingSelected",_e0);
}};
Telerik.Web.UI.RadUpload.registerClass("Telerik.Web.UI.RadUpload",Telerik.Web.UI.RadWebControl);

