﻿Type.registerNamespace("Telerik.Web");
Telerik.Web.UI.PaletteModes=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.PaletteModes.prototype={WebPalette:1,RGBSliders:2,All:(1+2)};
Telerik.Web.UI.PaletteModes.registerEnum("Telerik.Web.UI.PaletteModes",false);
Telerik.Web.UI.ColorPickerColorChangeEventArgs=function(_1){
Telerik.Web.UI.ColorPickerColorChangeEventArgs.initializeBase(this);
this._oldColor=_1;
};
Telerik.Web.UI.ColorPickerColorChangeEventArgs.prototype={get_oldColor:function(){
return this._oldColor;
}};
Telerik.Web.UI.ColorPickerColorChangeEventArgs.registerClass("Telerik.Web.UI.ColorPickerColorChangeEventArgs",Sys.EventArgs);
Telerik.Web.UI.ColorPickerColorSelectingEventArgs=function(_2){
Telerik.Web.UI.ColorPickerColorSelectingEventArgs.initializeBase(this);
this._color=_2;
};
Telerik.Web.UI.ColorPickerColorSelectingEventArgs.prototype={get_color:function(){
return this._color;
}};
Telerik.Web.UI.ColorPickerColorSelectingEventArgs.registerClass("Telerik.Web.UI.ColorPickerColorSelectingEventArgs",Sys.EventArgs);
Telerik.Web.UI.RadColorPicker=function(_3){
Telerik.Web.UI.RadColorPicker.initializeBase(this,[_3]);
this._selectedColor=null;
this._selectedColorName="";
this._autoPostBack=false;
this._enabled=true;
this._previewColor=true;
this._showIcon=false;
this._showEmptyColor=true;
this._lastPreviewColor="";
this._elementsByColor=[];
this._mouseUpHandler=null;
this._pickColorText="";
this._currentColorText="";
this._noColorText="";
this._popupBehavior=null;
this._paletteDisplayed=false;
this._uniqueID=null;
this._columns=18;
this._items=null;
this._width=0;
this._skin="";
this._overlay=false;
this._paletteModes=Telerik.Web.UI.PaletteModes.WebPalette;
this._selectedTab=null;
this._selectedContainer=null;
this._tabStrip=null;
this._multiPage=null;
this._webPalettePageView=null;
this._rgbPageView=null;
this._rgbSlidersDefaultValue=255;
this._rgbSlidersDefaultSize=249;
this._redSlider=null;
this._redInput=null;
this._greenSlider=null;
this._greenInput=null;
this._blueSlider=null;
this._blueInput=null;
this._hexColorInput=null;
this._applyButton=null;
this._defaultRGBWidth=300;
this._hiddenSlider=null;
this._eventStartedInControl=false;
this._inputAvoidRecursion=false;
this._sliderAvoidRecursion=false;
this._footer=null;
this.ShowPalette=this.showPalette;
this.HidePalette=this.hidePalette;
this.GetIconContainer=this.getIconContainer;
this.GetPaletteContainer=this.getPaletteContainer;
};
Telerik.Web.UI.RadColorPicker.prototype={initialize:function(){
Telerik.Web.UI.RadColorPicker.callBaseMethod(this,"initialize");
this._initializeFields();
if(!this._showIcon){
this._paletteDisplayed=true;
this._initializeColorElementsArray();
this._setElementsSize();
}
if(this._enabled){
this._initializeEventHandlers();
}
this.set_selectedColor(this._selectedColor);
if(this._items){
this._items=eval(this._items);
}
this.raiseEvent("loaded");
},_initializeFields:function(){
var _4=this.get_id();
this._wrapperElement=$get(_4);
this._previewElement=$get(_4+"_preview");
this._emptyColorElement=$get(_4+"_emptycolor");
this._iconElement=$get(_4+"_icon");
this._iconWrapperElement=$get(_4+"_label");
var _5=this._paletteWrapperElement=$get(_4+"_palette");
if(_5){
var _6=this._tabStrip=$telerik.getChildByClassName(_5,"rcpTabs");
this._multiPage=$telerik.getChildByClassName(_5,"rcpViews");
var _7=this._footer=$telerik.getChildByClassName(_5,"rcpFooter");
var _8=this._webPalettePageView=$get(_4+"_webPalette");
this._webPaletteWrapper=(_8)?$telerik.getChildByClassName(_8,"rcpWebPalette"):null;
this._rgbPageView=$get(_4+"_rgbSliders");
this._selectedContainer=(_8)?_8:this._rgbPageView;
if(_6){
var _9=_6.getElementsByTagName("a");
for(var i=0,_b=_9.length;i<_b;i++){
this._initializeTabHandler(_9[i]);
}
this._selectedTab=$telerik.getElementByClassName(_6,"rcpSelectedTab","li");
}
if(_7){
var _c=this._applyButton=$telerik.getChildByClassName(_7,"rcpApplyButton");
this._initializeApplyHandler(_c);
}
}
this._redInput=$get(_4+"_redInput");
this._greenInput=$get(_4+"_greenInput");
this._blueInput=$get(_4+"_blueInput");
var _d=this._hexColorInput=$get(_4+"_hexInput");
var _e=this._redSlider;
if(_e){
this._initializeRgbInputHandler(this._redInput);
this._initializeRgbInputHandler(this._greenInput);
this._initializeRgbInputHandler(this._blueInput);
this._initializeRgbSliderHandler(_e);
this._initializeRgbSliderHandler(this._greenSlider);
this._initializeRgbSliderHandler(this._blueSlider);
}
if(_d){
this._initializeHexHandler(_d);
}
},dispose:function(){
this._disposeControl("_popupBehavior");
if(this._enabled){
this._disposeHandlers();
}
this._selectedTab=null;
this._selectedContainer=null;
var _f=this._tabStrip;
if(_f){
var _10=_f.getElementsByTagName("a");
for(var i=0,_12=_10.length;i<_12;i++){
$clearHandlers(_10[i]);
}
this._tabStrip=null;
this._multiPage=null;
this._webPalettePageView=null;
this._rgbPageView=null;
}
this._redSlider=null;
this._greenSlider=null;
this._blueSlider=null;
this._hiddenSlider=null;
this._clearHandlers("_redInput");
this._clearHandlers("_greenInput");
this._clearHandlers("_blueInput");
this._clearHandlers("_hexColorInput");
this._clearHandlers("_applyButton");
this._footer=null;
Telerik.Web.UI.RadColorPicker.callBaseMethod(this,"dispose");
},_disposeControl:function(_13){
var _14=this[_13];
if(_14){
_14.dispose();
this[_13]=null;
}
},_clearHandlers:function(_15){
var _16=this[_15];
if(_16){
$clearHandlers(_16);
this[_15]=null;
}
},_initializeColorElementsArray:function(){
var _17=this._webPaletteWrapper;
if(!_17){
return;
}
var _18=[];
var _19=_17.getElementsByTagName("a");
for(var i=0,_1b=_19.length;i<_1b;i++){
var _1c=_19[i];
if(this._getColorBoxElement(_1c)==null){
continue;
}
_18[this._getElementColor(_1c)]=_1c;
}
this._elementsByColor=_18;
},_setElementsSize:function(){
var _1d=Telerik.Web.UI.PaletteModes.WebPalette;
var _1e="_setWebPaletteSize";
if(this._selectedContainer==this._rgbPageView){
_1d=Telerik.Web.UI.PaletteModes.RGBSliders;
_1e="_setRGBSize";
}
var _1f=this._showIcon?this._paletteWrapperElement:this._wrapperElement;
if(!_1f){
return;
}
var _20=this._getElementsSize(_1d);
var _21=this._width=_20.width;
if(parseInt(_1f.style.width)!=_21){
_1f.style.width=(_21-this.getElementBox(_1f).horizontal)+"px";
}
if(_21<203&&this._previewColor){
var _22=this._emptyColorElement;
if(_22){
var _23=$telerik.getFirstChildByTagName(_22,"span");
if(_23){
_23.style.display="none";
}
_22.style.width="23px";
}
}
this[_1e](_20);
},_setWebPaletteSize:function(_24){
var _25=this._webPaletteWrapper;
if(!_25){
return;
}
if(this.isModeEnabled(Telerik.Web.UI.PaletteModes.WebPalette)){
var _26=_24.colorBoxSize;
var _27=$telerik.isOpera;
var _28=_24.colorBoxSizeOpera;
var _29=_25.getElementsByTagName("li");
for(var i=0,_2b=_29.length;i<_2b;i++){
var _2c=_29[i];
var _2d=_2c.getElementsByTagName("span");
if(_2d.length>0){
var _2e=_2d[0];
if(parseInt(_2e.style.width)!=_26){
_2e.style.width=_26+"px";
_2e.style.height=_26+"px";
}
}
if(_27){
_2c.style.width=_28+"px";
}
}
}
},_setRGBSize:function(_2f){
var _30=_2f.sliderSize;
this._redSlider.set_width(_30);
this._greenSlider.set_width(_30);
this._blueSlider.set_width(_30);
},_createColorElement:function(_31){
var _32=(this._selectedColor==_31.value)?"rcpSelectedColor":"rcpColorBox";
var li=this._createElement("li");
var _34=this._createA(_31.title,_32,null,_31.value);
var _35=this._createElement("span",_31.value);
_34.appendChild(_35);
li.appendChild(_34);
return li;
},_getElementsSize:function(_36){
var _37=this._width;
var _38=this._wrapperElement;
var _39=0;
if(!this._showIcon){
_39+=this.getElementBox(_38).horizontal;
this._rgbSlidersDefaultSize-=_39;
}
_39+=this.getElementBox(this._paletteWrapperElement).horizontal;
_39+=this.getElementBox(this._multiPage).horizontal;
var _3a,_3b,_3c;
if(this.isModeEnabled(Telerik.Web.UI.PaletteModes.WebPalette)&&(_36==Telerik.Web.UI.PaletteModes.WebPalette)){
var _3d=this._getWebPaletteElemenentsSize(_37,_39);
_3a=_3d.colorSize;
_3b=_3d.colorSizeOpera;
_37=_3d.width;
}
if(this.isModeEnabled(Telerik.Web.UI.PaletteModes.RGBSliders)){
var _3e=this._defaultRGBWidth;
if(!this._width&&(_37<_3e)){
_37=_3e;
}
if(_36==Telerik.Web.UI.PaletteModes.RGBSliders){
_3c=this._getRGBElemenentsSize(_37,_39);
}
}
return {colorBoxSize:_3a,colorBoxSizeOpera:_3b,sliderSize:_3c,width:_37};
},_getWebPaletteElemenentsSize:function(_3f,_40){
_40+=this.getElementBox(this._webPalettePageView).horizontal;
var _41=0;
var _42=0;
var _43=this._webPaletteWrapper;
if(_43){
_40+=this.getElementBox(_43).horizontal;
_40+=$telerik.getMarginBox(_43).horizontal;
var _44=$telerik.getFirstChildByTagName(_43,"li");
if(_44){
_42=$telerik.getOuterSize(_44).width;
_41+=this.getElementBox(_44).horizontal;
var a=$telerik.getFirstChildByTagName(_44,"a");
if(a){
_41+=this.getElementBox(a).horizontal;
var _46=$telerik.getFirstChildByTagName(a,"span");
_41+=this.getElementBox(_46).horizontal;
}
}
}
var _47=this._columns;
if(_3f>0){
var _48=_3f-_40;
_48=(_48<1)?1:_48;
_42=parseInt(_48/_47);
_42=(_42<1)?1:_42;
}else{
_3f=_40+_47*_42;
}
var _49=_42;
var _4a=_42-_41;
_4a=(_4a<1)?1:_4a;
return {colorSize:_4a,colorSizeOpera:_49,width:_3f};
},_getRGBElemenentsSize:function(_4b,_4c){
var _4d=this._rgbSlidersDefaultSize;
var _4e=this._defaultRGBWidth;
if(_4b>_4e){
_4c+=this.getElementBox(this._rgbPageView).horizontal;
_4d=_4b-_4c;
_4d-=$telerik.getOuterSize(this._redInput).width;
if(_4d<50){
_4d=50;
}
}
return _4d;
},_createPalette:function(_4f){
if(this._webPaletteWrapper){
return;
}
var ul=this._webPaletteWrapper=this._createElement("ul",null,"rcpWebPalette");
_4f.appendChild(ul);
var _51=0;
var _52=this._columns;
var _53=this._items;
for(var i=0,_55=_53.length;i<_55;i++){
if(_51==_52){
_51=0;
var _56=this._createElement("li",null,"rcpBreakLine");
ul.appendChild(_56);
}
_51++;
var _57=this._createColorElement(_53[i]);
ul.appendChild(_57);
}
this._setElementsSize();
},_createHeader:function(_58){
if(!this._previewColor&&!this._showEmptyColor){
return;
}
var _59=this._createDiv("rcpHeader");
_58.appendChild(_59);
this._createPreviewElement(_59);
this._createEmptyColorElement(_59);
},_createFooter:function(){
var _5a=this._footer=this._createDiv("rcpFooter");
this._paletteWrapperElement.appendChild(_5a);
var _5b=this._applyButton=this._createA(null,"rcpApplyButton");
_5a.appendChild(_5b);
this._initializeApplyHandler(_5b);
var _5c=this._createElement("span","Apply");
_5b.appendChild(_5c);
},_createRgbSliders:function(_5d){
if(this._redSlider){
return;
}
var _5e=this.get_id();
var _5f=_5e+"_redSlider";
var _60=_5e+"_redInput";
this._createRgbSliderWithInput(_5f,"rcpSlider rcpRedSlider","_redSlider",_60,"rcpInput rcpRedInput","_redInput",_5d);
_5f=_5e+"_greenSlider";
_60=_5e+"_greenInput";
this._createRgbSliderWithInput(_5f,"rcpSlider rcpGreenSlider","_greenSlider",_60,"rcpInput rcpGreenInput","_greenInput",_5d);
_5f=_5e+"_blueSlider";
_60=_5e+"_blueInput";
this._createRgbSliderWithInput(_5f,"rcpSlider rcpBlueSlider","_blueSlider",_60,"rcpInput rcpBlueInput","_blueInput",_5d);
this._createFooter();
this._setElementsSize();
this._updateSlidersUI();
},_createRgbSliderWithInput:function(_61,_62,_63,_64,_65,_66,_67){
var _68=this._createInput(_65,this._rgbSlidersDefaultValue,_64);
_67.appendChild(_68);
this._initializeRgbInputHandler(_68);
this[_66]=_68;
var _69=this._createDiv(_62,_61);
_67.appendChild(_69);
this[_63]=this._createSlider(_69);
},_createSlider:function(_6a){
var _6b=this._rgbSlidersDefaultValue;
var _6c=this._rgbSlidersDefaultSize+"px";
var _6d={itemData:[],_width:_6c,_skin:this._skin,maximumValue:_6b,value:_6b};
var _6e=$create(Telerik.Web.UI.RadSlider,_6d,null,null,_6a);
this._initializeRgbSliderHandler(_6e);
return _6e;
},_createHexColorInput:function(_6f){
var _70=this._selectedColor;
if(!_70){
var _71=this._rgbSlidersDefaultValue;
_70=$telerik._rgbToHex("rgb("+_71+", "+_71+", "+_71+")");
}
var _72=this._hexColorInput=this._createInput("rcpHexInput",_70);
_6f.appendChild(_72);
if(this.isModeEnabled(Telerik.Web.UI.PaletteModes.WebPalette)){
_72.readOnly="readonly";
}
this._initializeHexHandler(_72);
},_rcpSliderValueChange:function(_73,_74){
if(this._sliderAvoidRecursion){
return;
}
var _75=this._redSlider.get_value();
var _76=this._greenSlider.get_value();
var _77=this._blueSlider.get_value();
this._sliderAvoidRecursion=true;
this._updateHexPreview(_75,_76,_77);
this._updateInputUI(_73);
this._sliderAvoidRecursion=false;
},_hexColorChange:function(e){
if(!e){
return;
}
var _79=e.target||e.srcElement;
if(!this._validateHexInput(_79)){
this._previewCurrentColor(this._selectedColor);
return;
}
if(this._inputAvoidRecursion){
return;
}
var _7a=_79.value;
this._inputAvoidRecursion=true;
this._updateSlidersUI(_7a);
this._inputAvoidRecursion=false;
},_rgbInputValueChange:function(e){
if(!e){
return;
}
var _7c=e.target||e.srcElement;
if(!this._validateDecInput(_7c)){
_7c.value=this._getSliderFromInput(_7c).get_value();
return;
}
if(this._inputAvoidRecursion){
return;
}
var _7d=this._redInput.value;
var _7e=this._greenInput.value;
var _7f=this._blueInput.value;
this._inputAvoidRecursion=true;
this._updateHexPreview(_7d,_7e,_7f);
this._updateSliderUI(null,null,_7c);
this._inputAvoidRecursion=false;
},_updateSlidersUI:function(_80){
var _81=_80;
if(!_81){
_81=this._selectedColor;
}
var rgb=this._hexToRGB(_81);
if(rgb){
this._updateSliderUI(this._redSlider,rgb.r);
this._updateSliderUI(this._greenSlider,rgb.g);
this._updateSliderUI(this._blueSlider,rgb.b);
}
},_updateSliderUI:function(_83,_84,_85){
var _86=_83;
var _87=_84;
if(!_86){
if(!_85){
return;
}
_86=this._getSliderFromInput(_85);
_87=_85.value;
}
_86.set_value(_87);
},_updateInputUI:function(_88){
if(!_88){
return;
}
this._getInputFromSlider(_88).value=_88.get_value();
},_updateHexPreview:function(red,_8a,_8b){
var _8c=$telerik._rgbToHex("rgb("+red+", "+_8a+", "+_8b+")");
this._previewCurrentColor(_8c,true);
},_validateDecInput:function(_8d){
var _8e=_8d.value;
return (!isNaN(parseInt(_8e,10)));
},_validateHexInput:function(_8f){
var _90=_8f.value;
var _91=/^#?(([0-9a-f]{3})|([0-9a-f]{6}))$/i;
return _91.test(_90);
},_getSliderFromInput:function(_92){
var _93=this._getColorElementPrefix(_92.id.toLowerCase());
return this[_93+"Slider"];
},_getInputFromSlider:function(_94){
var _95=this._getColorElementPrefix(_94.get_id().toLowerCase());
return this[_95+"Input"];
},_getColorElementPrefix:function(id){
var _97="";
if(!id){
return _97;
}
if(id.indexOf("red")>-1){
_97="_red";
}else{
if(id.indexOf("green")>-1){
_97="_green";
}else{
if(id.indexOf("blue")>-1){
_97="_blue";
}
}
}
return _97;
},_hexToRGB:function(_98){
if(!_98){
return null;
}
var rgb={r:0,g:0,b:0};
if(_98.indexOf("#")!=-1){
_98=_98.substring(1,_98.length);
}
if(_98.length==3){
var _9a=function(_9b){
return (_9b+_9b);
};
_98=_98.replace(/([0-9a-f])/gi,_9a);
}
rgb.r=parseInt(_98.substring(0,2),16);
rgb.g=parseInt(_98.substring(2,4),16);
rgb.b=parseInt(_98.substring(4,6),16);
return rgb;
},isModeEnabled:function(_9c){
return _9c&this._paletteModes?true:false;
},_createTabStrip:function(){
if(this._multiPage){
return;
}
var _9d=this.get_element();
var _9e=this.get_id();
var _9f=this._paletteWrapperElement=this._createDiv("rcpPalette",(_9e+"_palette"));
if(this._showIcon){
if(!$telerik.isIE6){
_9f.style.position="absolute";
}
_9f.style.visibility="hidden";
}
_9d.appendChild(_9f);
var _a0=this.isModeEnabled(Telerik.Web.UI.PaletteModes.WebPalette);
var _a1=this.isModeEnabled(Telerik.Web.UI.PaletteModes.RGBSliders);
var _a2=this.get_id();
var _a3=null;
if(_a0&&_a1){
var _a4=this._tabStrip=this._createDiv("rcpTabs");
_9f.appendChild(_a4);
_a3=this._createElement("ul");
_a4.appendChild(_a3);
}
this._createHeader(_9f);
var _a5=this._multiPage=this._createElement("div",null,"rcpViews");
_9f.appendChild(_a5);
var _a6=_a2+"_webPalette";
var _a7="rcpPageView";
var _a8=true;
if(_a0){
this._createTabWithContainer(_a8,_a7,_a5,"_webPalettePageView","_createPalette","Web palette",_a3,_a6);
_a8=false;
}
if(_a1){
_a6=_a2+"_rgbSliders";
_a7+=" rcpRGBPageView";
this._createTabWithContainer(_a8,_a7,_a5,"_rgbPageView","_createRgbSliders","RGB sliders",_a3,_a6);
}
this._initializeColorElementsArray();
this._initializePalleteEventHandlers();
if(!this._popupBehavior){
this._popupBehavior=$create(Telerik.Web.PopupBehavior,{"id":_9e+"PopupBehavior","parentElement":this._iconWrapperElement,"overlay":this._overlay},null,null,_9f);
}
},_createTabWithContainer:function(_a9,_aa,_ab,_ac,_ad,_ae,_af,_b0){
if(_af){
var tab=this._createTab(_ae,_b0);
_af.appendChild(tab);
}
var _b2=this[_ac]=this._createDiv(_aa,_b0,null,(_a9?null:"none"));
_ab.appendChild(_b2);
if(_a9){
this._updateTabSelection(tab,_b2);
this[_ad](_b2);
}
},_createTab:function(_b3,_b4){
var tab=this._createElement("li");
var _b6=this._createA(_b3,null,_b4);
this._initializeTabHandler(_b6);
tab.appendChild(_b6);
var _b7=this._createElement("span",_b3);
_b6.appendChild(_b7);
return tab;
},_createEmptyColorElement:function(_b8){
if(!this._showEmptyColor){
return;
}
var _b9=this._noColorText;
var _ba=this._emptyColorElement=this._createA(_b9,"rcpEmptyColor");
_ba.id=this.get_id()+"_emptycolor";
_b8.appendChild(_ba);
var _bb=this._createElement("span",_b9);
_ba.appendChild(_bb);
},_createPreviewElement:function(_bc){
if(!this._previewColor){
return;
}
var _bd=this._selectedColor;
if(!_bd){
_bd="white";
}
var _be=this._previewElement=this._createDiv("rcpColorPreview",(this.get_id()+"_preview"),_bd,null,"<!-- / -->");
_bc.appendChild(_be);
this._createHexColorInput(_bc);
},_tabClicked:function(e){
var _c0=(e.target||e.srcElement);
var _c1=this._getParentByTagName(_c0,"li");
var _c2=this._getParentByTagName(_c0,"a");
var _c3;
var _c4;
if(_c2){
_c3=_c2.getAttribute("rel");
_c4=$get(_c3);
}
if(!_c1||!_c4){
return;
}
_c3=_c3.toLowerCase();
var _c5=(_c3.indexOf("sliders")>-1);
this._updateHeaderFooter(_c5);
this._updateTabSelection(_c1,_c4);
if(_c3.indexOf("palette")>-1){
this._createPalette(_c4);
hexStyle="readonly";
}else{
if(_c5){
this._createRgbSliders(_c4);
}
}
this.set_selectedColor(this._selectedColor);
this._updateOverlaySize();
return $telerik.cancelRawEvent(e);
},_updateTabSelection:function(tab,_c7){
if(tab){
var _c8=this._selectedTab;
var _c9=this._selectedContainer;
if(_c8&&_c9){
Sys.UI.DomElement.removeCssClass(_c8,"rcpSelectedTab");
_c9.style.display="none";
}
Sys.UI.DomElement.addCssClass(tab,"rcpSelectedTab");
_c7.style.display="";
}
this._selectedTab=tab;
this._selectedContainer=_c7;
},_updateHeaderFooter:function(_ca){
var _cb=this._footer;
if(_cb){
_cb.style.display=_ca?"":"none";
}
var _cc=this._hexColorInput;
if(_cc){
_cc.readOnly=_ca?"":"readonly";
}
},_updateOverlaySize:function(){
var _cd=this._paletteWrapperElement;
var _ce=_cd._hideWindowedElementsIFrame;
if(!_ce){
return;
}
$telerik.setSize(_ce,$telerik.getOuterSize(_cd));
},_initializeTabHandler:function(tab){
$addHandler(tab,"click",Function.createDelegate(this,this._tabClicked));
},_initializeApplyHandler:function(_d0){
$addHandler(_d0,"click",Function.createDelegate(this,this._applyClick));
},_initializeHexHandler:function(_d1){
if(!this.isModeEnabled(Telerik.Web.UI.PaletteModes.RGBSliders)){
return;
}
$addHandlers(_d1,{"blur":this._hexColorChange},this);
},_initializeRgbInputHandler:function(_d2){
$addHandlers(_d2,{"blur":this._rgbInputValueChange},this);
},_initializeRgbSliderHandler:function(_d3){
var obj=this;
var _d5=function(_d6,_d7){
obj._rcpSliderValueChange(_d6,_d7);
};
var _d8=function(_d9,_da){
obj._eventStartedInControl=true;
};
_d3.add_valueChange(_d5);
if(this._showIcon){
_d3.add_slideStart(_d8);
}
},_createElement:function(_db,_dc,_dd,id,_df){
var el=document.createElement(_db);
if(_dc){
el.innerHTML=_dc;
}
if(_dd){
el.className=_dd;
}
if(id){
el.id=id;
}
if(_df){
el.style.backgroundColor=_df;
}
return el;
},_createA:function(_e1,_e2,rel,_e4){
var a=this._createElement("a",null,_e2,null,_e4);
a.href="#";
if(_e1){
a.title=_e1;
}
if(rel){
a.rel=rel;
}
return a;
},_createDiv:function(_e6,id,_e8,_e9,_ea){
var div=this._createElement("div",_ea,_e6,id,_e8);
if(_e9){
div.style.display=_e9;
}
return div;
},_createInput:function(_ec,_ed,id){
var _ef=this._createElement("input",null,_ec,id);
_ef.type="text";
if(_ed!=null){
_ef.value=_ed;
}
return _ef;
},getElementBox:function(_f0){
var box={horizontal:0,vertical:0};
if(_f0){
var _f2=$telerik.getBorderBox(_f0);
var _f3=$telerik.getPaddingBox(_f0);
box.horizontal=_f2.horizontal+_f3.horizontal;
box.vertical=_f2.vertical+_f3.vertical;
}
return box;
},showPalette:function(){
if(this._paletteDisplayed){
return;
}
this._createTabStrip();
var _f4=this._popupBehavior;
_f4.set_x(0);
var _f5=$telerik.getBounds(this._iconWrapperElement);
_f4.set_y(_f5.height);
_f4.show();
var _f6=this._applyButton;
if($telerik.isIE6&&_f6){
_f6.style.visibility="visible";
setTimeout(Function.createDelegate(this,function(){
_f6.style.visibility="";
}),0);
}
this.set_selectedColor(this._selectedColor);
this._paletteDisplayed=true;
},hidePalette:function(){
var _f7=this._popupBehavior;
if(_f7){
_f7.hide();
}
this._paletteDisplayed=false;
},getIconContainer:function(){
return this._iconWrapperElement;
},getPaletteContainer:function(){
return this._paletteWrapperElement;
},add_loaded:function(_f8){
this.get_events().addHandler("loaded",_f8);
},remove_loaded:function(_f9){
this.get_events().removeHandler("loaded",_f9);
},add_colorSelecting:function(_fa){
this.get_events().addHandler("colorSelecting",_fa);
},remove_colorSelecting:function(_fb){
this.get_events().removeHandler("colorSelecting",_fb);
},add_colorChange:function(_fc){
this.get_events().addHandler("colorChange",_fc);
},remove_colorChange:function(_fd){
this.get_events().removeHandler("colorChange",_fd);
},get_selectedColor:function(){
return this._selectedColor;
},set_selectedColor:function(_fe,_ff){
if(!_fe){
_fe=null;
}
var _100=this._selectedColor;
if(!_100){
_100=null;
}
if(_fe!=null){
_fe=_fe.toUpperCase();
}
this._selectedColor=_fe;
this._previewCurrentColor(_fe);
if(this._showIcon){
this._setIconColor(_fe);
}
var _101=this._selectedContainer;
if(_ff!=false&&_101){
var _102=_101.id.toLowerCase();
if(_102.indexOf("palette")>-1){
var _103=this._emptyColorElement;
var _104=this._getMarkedElement();
if(_104!=null){
if(_104!=_103){
_104.className="rcpColorBox";
}
}
_104=this._getBoxElementByColor(_fe);
if(_104!=null){
this._setMarkedElement(_104);
if(_104!=_103){
_104.className="rcpSelectedColor";
}
}
}else{
if(_102.indexOf("sliders")>-1){
var _105=_fe;
var _106=this._rgbSlidersDefaultValue;
if(!_105){
_105=$telerik._rgbToHex("rgb("+_106+", "+_106+", "+_106+")");
}
this._updateSlidersUI(_105);
}
}
}
this.updateClientState();
if(this._selectedColor!=_100){
var _107=new Telerik.Web.UI.ColorPickerColorChangeEventArgs(_100);
this.raiseEvent("colorChange",_107);
if(this._autoPostBack){
this._raiseColorChangedServerEvent();
}
}
},get_selectedColorTitle:function(){
var _108=this._getBoxElementByColor(this._selectedColor);
if(_108!=null){
return _108.getAttribute("title");
}
return this._selectedColor;
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_109){
if(this._enabled==_109){
return;
}
if(_109){
this._initializeEventHandlers();
Sys.UI.DomElement.removeCssClass(this.get_element(),"rcpDisabled");
}else{
this._disposeHandlers();
Sys.UI.DomElement.addCssClass(this.get_element(),"rcpDisabled");
}
this._enabled=_109;
},get_paletteModes:function(){
return this._paletteModes;
},set_paletteModes:function(_10a){
if(this._paletteModes!=_10a){
this._paletteModes=_10a;
}
},get_hiddenSlider:function(){
return this._hiddenSlider;
},set_hiddenSlider:function(_10b){
if(this._hiddenSlider!=_10b){
this._hiddenSlider=_10b;
}
},get_redSlider:function(){
return this._redSlider;
},set_redSlider:function(_10c){
if(this._redSlider!=_10c){
this._redSlider=_10c;
}
},get_greenSlider:function(){
return this._greenSlider;
},set_greenSlider:function(_10d){
if(this._greenSlider!=_10d){
this._greenSlider=_10d;
}
},get_blueSlider:function(){
return this._blueSlider;
},set_blueSlider:function(_10e){
if(this._blueSlider!=_10e){
this._blueSlider=_10e;
}
},get_overlay:function(){
return this._overlay;
},set_overlay:function(_10f){
this._overlay=_10f;
var _110=this._popupBehavior;
if(_110){
_110.set_overlay(this._overlay);
if(this._showIcon&&this._paletteDisplayed){
_110.show();
}
}
},_initializeEventHandlers:function(){
this._initializePalleteEventHandlers();
if(this._showIcon){
$addHandlers(this._iconWrapperElement,{"mousedown":this._onIconMouseDown,"mouseup":this._onIconMouseUp,"click":$telerik.cancelRawEvent},this);
$addHandlers(this.get_element(),{"mousedown":this._onWrapperMouseDown},this);
this._mouseUpHandler=Function.createDelegate(this,this._onMouseUp);
$addHandler(document,"mouseup",this._mouseUpHandler);
}
},_initializePalleteEventHandlers:function(){
var _111=this._webPaletteWrapper;
if(_111){
$addHandlers(_111,{"mouseover":this._onBoxMouseOver,"mouseup":this._onBoxClick,"click":$telerik.cancelRawEvent,"selectstart":this._onSelectStart},this);
}
var _112=this._emptyColorElement;
if(_112&&this._showEmptyColor){
$addHandlers(_112,{"click":this._onEmptyColorClick},this);
}
},_disposeHandlers:function(){
var _113=this._webPaletteWrapper;
if(_113){
$clearHandlers(_113);
}
var _114=this._emptyColorElement;
if(_114&&this._showEmptyColor){
$clearHandlers(_114);
}
if(this._showIcon){
$clearHandlers(this._iconWrapperElement);
$clearHandlers(this.get_element());
$removeHandler(document,"mouseup",this._mouseUpHandler);
}
this._mouseUpHandler=null;
},_raiseColorChangedServerEvent:function(){
setTimeout(Function.createDelegate(this,function(){
__doPostBack(this._uniqueID);
}),0);
},_onMouseUp:function(e){
if(this._eventStartedInControl){
this._eventStartedInControl=false;
return;
}
var _116=e.target||e.srcElement;
if($telerik.isDescendantOrSelf(this._paletteWrapperElement,_116)){
return;
}
this.hidePalette();
},_onBoxMouseOver:function(e){
var _118=this._getColorBoxElement(e.target);
if(_118==null){
return;
}
var _119=this._getElementColor(_118);
this._previewCurrentColor(_119,true,_118.title);
},_applyClick:function(e){
var _11b=$telerik._rgbToHex("rgb("+this._redSlider.get_value()+", "+this._greenSlider.get_value()+", "+this._blueSlider.get_value()+")");
this._applyColorAndClose(_11b);
return $telerik.cancelRawEvent(e);
},_onEmptyColorClick:function(e){
this._applyColorAndClose(null);
return $telerik.cancelRawEvent(e);
},_applyColorAndClose:function(_11d){
var _11e=this._showIcon;
this.set_selectedColor(_11d,!_11e);
if(_11e){
this.hidePalette();
}
},_onWrapperMouseDown:function(e){
this._eventStartedInControl=true;
},_onIconMouseDown:function(e){
return $telerik.cancelRawEvent(e);
},_onIconMouseUp:function(e){
if(this._paletteDisplayed){
this.hidePalette();
}else{
this.showPalette();
}
return $telerik.cancelRawEvent(e);
},_getElementColor:function(_122){
if(_122==this._emptyColorElement){
return null;
}
return _122.firstChild.innerHTML;
},_setIconColor:function(_123){
var _124=(_123)?_123:"blank";
var _125=this._pickColorText+" "+this._currentColorText.toString().replace("{0}",_124);
this._iconWrapperElement.title=_125;
this._iconElement.style.backgroundColor=(_123)?_123:"#FFFFFF";
},_onSelectStart:function(e){
return $telerik.cancelRawEvent(e);
},_onBoxClick:function(evt){
this._eventStartedInControl=false;
if(evt.button!=0){
return;
}
var _128=this._getColorBoxElement(evt.target);
if(_128==null){
return;
}
this._applyColorAndClose(this._getElementColor(_128));
return $telerik.cancelRawEvent(evt);
},_getMarkedElement:function(){
var _129=this._markedElement;
if(_129){
return _129;
}
var _12a=this._webPaletteWrapper;
if(!_12a){
return null;
}
var _12b=_12a.getElementsByTagName("A");
for(var i=0,_12d=_12b.length;i<_12d;i++){
var _12e=_12b[i];
if(_12e.className=="rcpSelectedColor"){
return _12e;
}
}
return null;
},_setMarkedElement:function(_12f){
this._markedElement=_12f;
},_getColorBoxElement:function(_130){
var _131=3;
var i=0;
while(i<_131){
if(_130.className=="rcpColorBox"||_130.className=="rcpSelectedColor"||_130.className.indexOf("rcpEmptyColor")>-1){
return _130;
}
i++;
_130=_130.parentNode;
}
return null;
},_getParentByTagName:function(_133,tag){
var _135=3;
var i=0;
while(i<_135){
if(_133.tagName.toLowerCase()==tag){
return _133;
}
i++;
_133=_133.parentNode;
}
return null;
},_getBoxElementByColor:function(_137){
if(!_137){
return this._emptyColorElement;
}
_137=_137.toUpperCase();
return this._elementsByColor[_137];
},_previewCurrentColor:function(_138,_139,_13a){
if(!this.get_isInitialized()){
return;
}
if(_139&&(_138!=this._lastPreviewColor)){
var _13b=new Telerik.Web.UI.ColorPickerColorSelectingEventArgs(_138);
this.raiseEvent("colorSelecting",_13b);
}
this._lastPreviewColor=_138;
if(!this._previewColor){
return;
}
if(_138==null){
_138="#FFFFFF";
_13a=this._noColorText;
}
_138=_138.toUpperCase();
if(!_13a){
_13a=_138;
}
var _13c=this._previewElement;
if(_13c){
_13c.style.backgroundColor=_138;
}
var _13d=this._hexColorInput;
if(_13d){
_13d.value=_138;
}
},saveClientState:function(){
var _13e=["selectedColor"];
var _13f={};
for(var i=0;i<_13e.length;i++){
_13f[_13e[i]]=this["get_"+_13e[i]]();
}
return Sys.Serialization.JavaScriptSerializer.serialize(_13f);
}};
Telerik.Web.UI.RadColorPicker.registerClass("Telerik.Web.UI.RadColorPicker",Telerik.Web.UI.RadWebControl);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();