­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ "use strict";window.jscolor||(window.jscolor=function(){var e={register:function(){e.attachDOMReadyEvent(e.init),e.attachEvent(document,"mousedown",e.onDocumentMouseDown),e.attachEvent(document,"touchstart",e.onDocumentTouchStart),e.attachEvent(window,"resize",e.onWindowResize)},init:function(){e.jscolor.lookupClass&&e.jscolor.installByClassName(e.jscolor.lookupClass)},tryInstallOnElements:function(t,r){for(var o=new RegExp("(^|\\s)("+r+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),n=0;ns[n]&&-r[n]+t[n]+l[n]/2>s[n]/2&&t[n]+l[n]-c[n]>=0?t[n]+l[n]-c[n]:t[n],-r[i]+t[i]+l[i]+c[i]-d+d*a>s[i]?-r[i]+t[i]+l[i]/2>s[i]/2&&t[i]+l[i]-d-d*a>=0?t[i]+l[i]-d-d*a:t[i]+l[i]-d+d*a:t[i]+l[i]-d+d*a>=0?t[i]+l[i]-d+d*a:t[i]+l[i]-d-d*a];else var p=[t[n],t[i]+l[i]-d+d*a];var u=p[n],h=p[i],m=o.fixed?"fixed":"absolute",v=(p[0]+c[0]>t[0]||p[0]2)switch(e.mode.charAt(2).toLowerCase()){case"s":return"s";case"v":return"v"}return null},onDocumentMouseDown:function(t){t||(t=window.event);var r=t.target||t.srcElement;if(r._jscLinkedInstance)r._jscLinkedInstance.showOnClick&&r._jscLinkedInstance.show();else if(r._jscControlName)e.onControlPointerStart(t,r,r._jscControlName,"mouse");else{if(e.picker&&e.picker.owner&&"arp_advanced_color_picker"===jQuery(e.picker.owner.targetElement).attr("id")&&"arp_ribbon_colorpicker_wrapper"!==jQuery(r).attr("id"))return;!e.picker||!e.picker.owner||jQuery(r).hasClass("arp_add_favorite_color")||jQuery(r).parents().hasClass("arp_add_favorite_color")||jQuery(r).hasClass("arp_color_picker_input_div")||jQuery(r).parents().hasClass("arp_color_picker_input_div")||e.picker.owner.hide()}},onDocumentTouchStart:function(t){t||(t=window.event);var r=t.target||t.srcElement;r._jscLinkedInstance?r._jscLinkedInstance.showOnClick&&r._jscLinkedInstance.show():r._jscControlName?e.onControlPointerStart(t,r,r._jscControlName,"touch"):e.picker&&e.picker.owner&&e.picker.owner.hide()},onWindowResize:function(){e.redrawPosition()},onParentScroll:function(){e.picker&&e.picker.owner&&e.picker.owner.hide()},_pointerMoveEvent:{mouse:"mousemove",touch:"touchmove"},_pointerEndEvent:{mouse:"mouseup",touch:"touchend"},_pointerOrigin:null,_capturedTarget:null,onControlPointerStart:function(t,r,o,n){var i=r._jscInstance;e.preventDefault(t),e.captureTarget(r);var a=function(i,a){e.attachGroupEvent("drag",i,e._pointerMoveEvent[n],e.onDocumentPointerMove(t,r,o,n,a)),e.attachGroupEvent("drag",i,e._pointerEndEvent[n],e.onDocumentPointerEnd(t,r,o,n))};if(a(document,[0,0]),window.parent&&window.frameElement){var l=window.frameElement.getBoundingClientRect(),s=[-l.left,-l.top];a(window.parent.window.document,s)}var c=e.getAbsPointerPos(t),d=e.getRelPointerPos(t);switch(e._pointerOrigin={x:c.x-d.x,y:c.y-d.y},o){case"pad":switch(e.getSliderComponent(i)){case"s":0===i.hsv[1]&&i.fromHSV(null,100,null);break;case"v":0===i.hsv[2]&&i.fromHSV(null,null,100)}e.setPad(i,t,0,0);break;case"sld":e.setSld(i,t,0)}e.dispatchFineChange(i)},onDocumentPointerMove:function(t,r,o,n,i){return function(t){var n=r._jscInstance;switch(o){case"pad":t||(t=window.event),e.setPad(n,t,i[0],i[1]),e.dispatchFineChange(n);break;case"sld":t||(t=window.event),e.setSld(n,t,i[1]),e.dispatchFineChange(n)}}},onDocumentPointerEnd:function(t,r){return function(){var t=r._jscInstance;e.detachGroupEvents("drag"),e.releaseTarget(),e.dispatchChange(t)}},dispatchChange:function(t){t.valueElement&&e.isElementType(t.valueElement,"input")&&e.fireEvent(t.valueElement,"change")},dispatchFineChange:function(e){if(e.onFineChange){var t;t="string"==typeof e.onFineChange?new Function(e.onFineChange):e.onFineChange,t.call(e)}},setPad:function(t,r,o,n){var i=e.getAbsPointerPos(r),a=o+i.x-e._pointerOrigin.x-t.padding-t.insetWidth,l=n+i.y-e._pointerOrigin.y-t.padding-t.insetWidth,s=a*(360/(t.width-1)),c=100-l*(100/(t.height-1));switch(e.getPadYComponent(t)){case"s":t.fromHSV(s,c,null,e.leaveSld);break;case"v":t.fromHSV(s,null,c,e.leaveSld)}},setSld:function(t,r,o){var n=e.getAbsPointerPos(r),i=o+n.y-e._pointerOrigin.y-t.padding-t.insetWidth,a=100-i*(100/(t.height-1));switch(e.getSliderComponent(t)){case"s":t.fromHSV(null,a,null,e.leavePad);break;case"v":t.fromHSV(null,null,a,e.leavePad)}},_vmlNS:"jsc_vml_",_vmlCSS:"jsc_vml_css_",_vmlReady:!1,initVML:function(){if(!e._vmlReady){var t=document;if(t.namespaces[e._vmlNS]||t.namespaces.add(e._vmlNS,"urn:schemas-microsoft-com:vml"),!t.styleSheets[e._vmlCSS]){var r=["shape","shapetype","group","background","path","formulas","handles","fill","stroke","shadow","textbox","textpath","imagedata","line","polyline","curve","rect","roundrect","oval","arc","image"],o=t.createStyleSheet();o.owningElement.id=e._vmlCSS;for(var n=0;n-1&&(t+="_wrapper");var r=(jQuery("#"+t),t.replace("_hidden",""));if("tooltip_bgcolor_hidden"===t&&(t="tooltip_bgcolor_div",r="tooltip_bgcolor_div"),"tooltip_txtcolor_hidden"===t&&(t="tooltip_txtcolor_div",r="tooltip_txtcolor_div"),"arp_shortcode_font_color"===r&&(r="arp_shortcode_font_custom_color"),"undefined"==typeof document.getElementById(t).jscolor&&"undefined"==typeof document.getElementById(r).jscolor){"arp_ribbon_txtcolor"===t&&document.getElementById("arp_advanced_color_picker").jscolor.fromString(e.replace("#","")),"arp_caption_border_color"===t&&(document.getElementById("arp_caption_border_color_div").jscolor.fromString(e.replace("#","")),arp_update_color(document.getElementById("arp_caption_border_color_div").jscolor,document.getElementById("arp_caption_border_color_div"))),"arp_caption_row_border_color"===t&&(document.getElementById("arp_caption_row_border_color_div").jscolor.fromString(e.replace("#","")),arp_update_color(document.getElementById("arp_caption_row_border_color_div").jscolor,document.getElementById("arp_caption_row_border_color_div")));var o=document.getElementById(t);"undefined"!=typeof __JSPICKER&&jQuery(__JSPICKER).each(function(t){var r=__JSPICKER[t],n=r.targetElement;o===n&&(__JSPICKER[t].fromString(e.replace("#","")),arp_update_color(__JSPICKER[t],n))})}else"undefined"==typeof document.getElementById(t).jscolor&&"undefined"!=typeof document.getElementById(r).jscolor?(document.getElementById(r).jscolor.fromString(e.replace("#","")),"arp_shortcode_font_custom_color"===r?(r="arp_shortcode_font_color",arp_update_color(document.getElementById("arp_shortcode_font_custom_color").jscolor,document.getElementById(r))):arp_update_color(document.getElementById(r).jscolor,document.getElementById(r))):"arp_ribbon_txtcolor"===t?document.getElementById("arp_advanced_color_picker").jscolor.fromString(e.replace("#","")):(document.getElementById(t).jscolor.fromString(e.replace("#","")),arp_update_color(document.getElementById(t).jscolor,document.getElementById(t)))}),e.picker.color_input.addEventListener("paste",function(e){e.preventDefault();var t=e.clipboardData.getData("text");t=t.replace("#",""),jQuery(this).val(t).trigger("change");var r=jQuery(this).attr("data-value"),o=jQuery(this).val(),r=jQuery(this).attr("data-value");r.indexOf("_main_column_")>-1&&(r+="_wrapper");var n=(jQuery("#"+r),r.replace("_hidden",""));if("tooltip_bgcolor_hidden"===r&&(r="tooltip_bgcolor_div",n="tooltip_bgcolor_div"),"tooltip_txtcolor_hidden"===r&&(r="tooltip_txtcolor_div",n="tooltip_txtcolor_div"),"arp_shortcode_font_color"===n&&(n="arp_shortcode_font_custom_color"),"undefined"==typeof document.getElementById(r).jscolor&&"undefined"==typeof document.getElementById(n).jscolor){"arp_ribbon_txtcolor"===r&&document.getElementById("arp_advanced_color_picker").jscolor.fromString(o.replace("#","")),"arp_caption_border_color"===r&&(document.getElementById("arp_caption_border_color_div").jscolor.fromString(o.replace("#","")),arp_update_color(document.getElementById("arp_caption_border_color_div").jscolor,document.getElementById("arp_caption_border_color_div"))),"arp_caption_row_border_color"===r&&(document.getElementById("arp_caption_row_border_color_div").jscolor.fromString(o.replace("#","")),arp_update_color(document.getElementById("arp_caption_row_border_color_div").jscolor,document.getElementById("arp_caption_row_border_color_div")));var i=document.getElementById(r);"undefined"!=typeof __JSPICKER&&jQuery(__JSPICKER).each(function(e){var t=__JSPICKER[e],r=t.targetElement;i===r&&(__JSPICKER[e].fromString(o.replace("#","")),arp_update_color(__JSPICKER[e],r))})}else"undefined"==typeof document.getElementById(r).jscolor&&"undefined"!=typeof document.getElementById(n).jscolor?(document.getElementById(n).jscolor.fromString(o.replace("#","")),"arp_shortcode_font_custom_color"===n?(n="arp_shortcode_font_color",arp_update_color(document.getElementById("arp_shortcode_font_custom_color").jscolor,document.getElementById(n))):arp_update_color(document.getElementById(n).jscolor,document.getElementById(n))):"arp_ribbon_txtcolor"===r?document.getElementById("arp_advanced_color_picker").jscolor.fromString(o.replace("#","")):(document.getElementById(r).jscolor.fromString(o.replace("#","")),arp_update_color(document.getElementById(r).jscolor,document.getElementById(r)))}),e.picker.color_input_div=document.createElement("div"),e.picker.color_input_div.setAttribute("class","arp_color_picker_input_div");var r=jQuery(m.targetElement).attr("id");e.picker.color_input_div.setAttribute("id","arp_color_picker_input_div"),e.picker.color_input_div.appendChild(e.picker.color_input_hex_div),e.picker.color_input_div.appendChild(e.picker.color_input),setTimeout(function(){e.picker.box.appendChild(e.picker.color_input_div)},200),e.picker.fav=document.createElement("div"),e.picker.favW=document.createElement("div"),e.picker.favB=document.createElement("div"),e.picker.favI=document.createElement("i"),e.picker.favB.setAttribute("data-value",jQuery(m.valueElement).attr("id")),e.picker.favI.setAttribute("class","fa fa-heart"),e.picker.favB.appendChild(e.picker.favI),e.picker.favW.setAttribute("class","arp_favorite_color_buttons"),e.picker.fav.appendChild(e.picker.favW),e.picker.favB.setAttribute("class","arp_add_favorite_color_btn arptooltipster tipso_style"),e.picker.favB.setAttribute("data-tipso","Add to Favourite"),e.picker.favB.setAttribute("title","Add to Favourite"),e.picker.favB.setAttribute("id","arp_add_favorite_color_btn");var r=jQuery(m.targetElement).attr("id");if("undefined"!=typeof Storage)var o=localStorage.getItem("arp_fav_color[colors]");else var o=getCookie("arp_fav_color[colors]");if(void 0!==o&&""!==o&&null!==o){var n=o.split(",");for(var i in n){var a=n[i],c=document.createElement("div");c.setAttribute("class","select_from_fav_color"),c.setAttribute("value",a),c.setAttribute("style","background:"+a),7>i&&e.picker.favW.appendChild(c)}}e.picker.fav.appendChild(e.picker.favB),e.picker.fav.setAttribute("class","arp_add_favorite_color"),e.picker.fav.setAttribute("id","arp_add_favorite_color"),setTimeout(function(){e.picker.box.appendChild(e.picker.fav)},200);var d=e.picker,p=!!e.getSliderComponent(m),u=e.getPickerDims(m),h=2*m.pointerBorderWidth+m.pointerThickness+2*m.crossSize,g=e.getPadToSliderPadding(m),y=Math.min(m.borderRadius,Math.round(m.padding*Math.PI)),f="crosshair";if(d.wrap.setAttribute("class","arprice_js_colorpicker"),"arp_advanced_color_picker"===r&&d.wrap.setAttribute("class","arprice_js_colorpicker arp_advanced"),d.wrap.style.clear="both",d.wrap.style.width=u[0]+2*m.borderWidth+"px",d.wrap.style.height=u[1]+2*m.borderWidth+65+"px",d.wrap.style.zIndex=m.zIndex,d.fav.style.top=u[1]+2*m.borderWidth-5+"px","arp_advanced_color_picker"===r&&(d.wrap.style.width=u[0]+2*m.borderWidth+3+"px",d.wrap.style.height=u[1]+2*m.borderWidth+102+"px"),d.box.style.width=u[0]+"px",d.box.style.height=u[1]+65+"px","arp_advanced_color_picker"===r&&(d.box.style.width=u[0]+3+"px",d.box.style.height=u[1]+102+"px"),d.boxS.style.position="absolute",d.boxS.style.left="0",d.boxS.style.top="0",d.boxS.style.width="100%",d.boxS.style.height="100%",e.setBorderRadius(d.boxS,y+"px"),"arp_advanced_color_picker"===r&&e.setBorderRadius(d.boxS,"0px"),"arp_advanced_color_picker"===r){setTimeout(function(){jQuery(".arp_close_colorpicker_advanced").remove()},100),e.picker.rbncls=document.createElement("input"),e.picker.rbncls.setAttribute("id","arp_close_colorpicker_advanced"),e.picker.rbncls.setAttribute("class","col_opt_btn arp_close_colorpicker_advanced");u[1]+2*m.borderWidth+60+"px;";e.picker.rbncls.setAttribute("type","button"),e.picker.rbncls.setAttribute("style","float:right;margin-right:10px;margin-top:10px;height:30px;"),e.picker.rbncls.setAttribute("value","OK"),setTimeout(function(){e.picker.box.appendChild(e.picker.rbncls)},200)}else"undefined"!=typeof e.picker.rbncls&&null!==e.picker.rbncls&&delete e.picker.rbncls;d.boxB.style.position="relative",d.boxB.style.border=m.borderWidth+"px solid",d.boxB.style.borderColor=m.borderColor,d.boxB.style.background=m.backgroundColor,e.setBorderRadius(d.boxB,y+"px"),"arp_advanced_color_picker"===r&&e.setBorderRadius(d.boxB,"0px"),d.padM.style.background=d.sldM.style.background="#FFF",e.setStyle(d.padM,"opacity","0"),e.setStyle(d.sldM,"opacity","0"),d.pad.style.position="relative",d.pad.style.width=m.width+"px",d.pad.style.height=m.height+"px",d.padPal.draw(m.width,m.height,e.getPadYComponent(m)),d.padB.style.position="absolute",d.padB.style.left=m.padding+"px",d.padB.style.top=m.padding+"px",d.padB.style.border=m.insetWidth+"px solid",d.padB.style.borderColor=m.insetColor,d.padM._jscInstance=m,d.padM._jscControlName="pad",d.padM.style.position="absolute",d.padM.style.left="0",d.padM.style.top="0",d.padM.style.width=m.padding+2*m.insetWidth+m.width+g/2+"px",d.padM.style.height=u[1]+"px",d.padM.style.cursor=f,d.cross.style.position="absolute",d.cross.style.left=d.cross.style.top="0",d.cross.style.width=d.cross.style.height=h+"px",d.crossBY.style.position=d.crossBX.style.position="absolute",d.crossBY.style.background=d.crossBX.style.background=m.pointerBorderColor,d.crossBY.style.width=d.crossBX.style.height=2*m.pointerBorderWidth+m.pointerThickness+"px",d.crossBY.style.height=d.crossBX.style.width=h+"px",d.crossBY.style.left=d.crossBX.style.top=Math.floor(h/2)-Math.floor(m.pointerThickness/2)-m.pointerBorderWidth+"px",d.crossBY.style.top=d.crossBX.style.left="0",d.crossLY.style.position=d.crossLX.style.position="absolute",d.crossLY.style.background=d.crossLX.style.background=m.pointerColor,d.crossLY.style.height=d.crossLX.style.width=h-2*m.pointerBorderWidth+"px",d.crossLY.style.width=d.crossLX.style.height=m.pointerThickness+"px",d.crossLY.style.left=d.crossLX.style.top=Math.floor(h/2)-Math.floor(m.pointerThickness/2)+"px",d.crossLY.style.top=d.crossLX.style.left=m.pointerBorderWidth+"px",d.sld.style.overflow="hidden",d.sld.style.width=m.sliderSize+"px",d.sld.style.height=m.height+"px",d.sldGrad.draw(m.sliderSize,m.height,"#000","#000"),d.sldB.style.display=p?"block":"none",d.sldB.style.position="absolute",d.sldB.style.right=m.padding+"px",d.sldB.style.top=m.padding+"px",d.sldB.style.border=m.insetWidth+"px solid",d.sldB.style.borderColor=m.insetColor,d.sldM._jscInstance=m,d.sldM._jscControlName="sld",d.sldM.style.display=p?"block":"none",d.sldM.style.position="absolute",d.sldM.style.right="0",d.sldM.style.top="0",d.sldM.style.width=m.sliderSize+g/2+m.padding+2*m.insetWidth+"px",d.sldM.style.height=u[1]+"px","arp_advanced_color_picker"===r&&(d.sldM.style.height=u[1]+20+"px"),d.sldM.style.cursor="default",d.sldPtrIB.style.border=d.sldPtrOB.style.border=m.pointerBorderWidth+"px solid "+m.pointerBorderColor,d.sldPtrOB.style.position="absolute",d.sldPtrOB.style.left=-(2*m.pointerBorderWidth+m.pointerThickness)+"px",d.sldPtrOB.style.top="0",d.sldPtrMB.style.border=m.pointerThickness+"px solid "+m.pointerColor,d.sldPtrS.style.width=m.sliderSize+"px",d.sldPtrS.style.height=_+"px",d.btn.style.display=m.closable?"block":"none",d.btn.style.position="absolute",d.btn.style.left=m.padding+"px",d.btn.style.bottom=m.padding+"px",d.btn.style.padding="0 15px",d.btn.style.height=m.buttonHeight+"px",d.btn.style.border=m.insetWidth+"px solid",t(),d.btn.style.color=m.buttonColor,d.btn.style.font="12px sans-serif",d.btn.style.textAlign="center";try{d.btn.style.cursor="pointer"}catch(b){d.btn.style.cursor="hand"}d.btn.onmousedown=function(){m.hide()},d.btnT.style.lineHeight=m.buttonHeight+"px",d.btnT.innerHTML="",d.btnT.appendChild(document.createTextNode(m.closeText)),l(),s(),e.picker.owner&&e.picker.owner!==m&&e.unsetClass(e.picker.owner.targetElement,m.activeClass),e.picker.owner=m,e.isElementType(v,"body")?e.redrawPosition():e._drawPosition(m,0,0,"relative",!1),d.wrap.parentNode!=v&&v.appendChild(d.wrap),e.setClass(m.targetElement,m.activeClass),jQuery.isFunction(jQuery().tipso)&&setTimeout(function(){jQuery(".arptooltipster").tipso({position:"bottom",background:"#43B4FB",width:"auto"})},250)}function l(){switch(e.getPadYComponent(m)){case"s":var t=1;break;case"v":var t=2}var r=Math.round(m.hsv[0]/360*(m.width-1)),o=Math.round((1-m.hsv[t]/100)*(m.height-1)),i=2*m.pointerBorderWidth+m.pointerThickness+2*m.crossSize,a=-Math.floor(i/2);switch(e.picker.cross.style.left=r+a+"px",e.picker.cross.style.top=o+a+"px",e.getSliderComponent(m)){case"s":var l=n(m.hsv[0],100,m.hsv[2]),s=n(m.hsv[0],0,m.hsv[2]),c="rgb("+Math.round(l[0])+","+Math.round(l[1])+","+Math.round(l[2])+")",d="rgb("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+")";e.picker.sldGrad.draw(m.sliderSize,m.height,c,d),"arp_advanced_color_picker"===jQuery(m.styleElement).attr("id")&&e.picker.sldGrad.draw(m.sliderSize,m.height+20,c,d);break;case"v":var p=n(m.hsv[0],m.hsv[1],100),c="rgb("+Math.round(p[0])+","+Math.round(p[1])+","+Math.round(p[2])+")",d="#000";e.picker.sldGrad.draw(m.sliderSize,m.height,c,d),"arp_advanced_color_picker"===jQuery(m.styleElement).attr("id")&&e.picker.sldGrad.draw(m.sliderSize,m.height+20,c,d)}}function s(){var t=e.getSliderComponent(m);if(t){switch(t){case"s":var r=1;break;case"v":var r=2}var o=Math.round((1-m.hsv[r]/100)*(m.height-1));e.picker.sldPtrOB.style.top=o-(2*m.pointerBorderWidth+m.pointerThickness)-Math.floor(_/2)+"px"}}function c(){return e.picker&&e.picker.owner===m}function d(){m.importColor()}this.value=null,this.valueElement=t,this.styleElement=t,this.required=!0,this.refine=!0,this.hash=!1,this.uppercase=!0,this.onFineChange=null,this.activeClass="jscolor-active",this.minS=0,this.maxS=100,this.minV=0,this.maxV=100,this.hsv=[0,0,100],this.rgb=[255,255,255],this.width=181,this.height=101,this.showOnClick=!0,this.mode="HSV",this.position="bottom",this.smartPosition=!0,this.sliderSize=16,this.crossSize=8,this.closable=!1,this.closeText="Close",this.buttonColor="#000000",this.buttonHeight=18,this.padding=12,this.backgroundColor="#FFFFFF",this.borderWidth=1,this.borderColor="#BBBBBB",this.borderRadius=8,this.insetWidth=1,this.insetColor="#BBBBBB",this.shadow=!0,this.shadowBlur=15, this.shadowColor="rgba(0,0,0,0.2)",this.pointerColor="#4C4C4C",this.pointerBorderColor="#FFFFFF",this.pointerBorderWidth=1,this.pointerThickness=2,this.zIndex=1e3,this.container=null;for(var p in r)r.hasOwnProperty(p)&&(this[p]=r[p]);if(this.hide=function(){c()&&i()},this.show=function(){a()},this.redraw=function(){c()&&a()},this.importColor=function(){this.valueElement&&e.isElementType(this.valueElement,"input")?this.refine?!this.required&&/^\s*$/.test(this.valueElement.value)?(this.valueElement.value="",this.styleElement&&(this.styleElement.style.backgroundImage=this.styleElement._jscOrigStyle.backgroundImage,this.styleElement.style.backgroundColor=this.styleElement._jscOrigStyle.backgroundColor,this.styleElement.style.color=this.styleElement._jscOrigStyle.color),this.exportColor(e.leaveValue|e.leaveStyle)):this.fromString(this.valueElement.value)||this.exportColor():this.fromString(this.valueElement.value,e.leaveValue)||(this.styleElement&&(this.styleElement.style.backgroundImage=this.styleElement._jscOrigStyle.backgroundImage,this.styleElement.style.backgroundColor=this.styleElement._jscOrigStyle.backgroundColor,this.styleElement.style.color=this.styleElement._jscOrigStyle.color),this.exportColor(e.leaveValue|e.leaveStyle)):this.exportColor()},this.exportColor=function(t){if(!(t&e.leaveValue)&&this.valueElement){var r=this.toString();this.uppercase&&(r=r.toUpperCase()),this.hash&&(r="#"+r),e.isElementType(this.valueElement,"input")?this.valueElement.value=r:this.valueElement.innerHTML=r}t&e.leaveStyle||this.styleElement&&(this.styleElement.style.backgroundImage="none",this.styleElement.style.backgroundColor="#"+this.toString(),this.styleElement.style.color=this.isLight()?"#000":"#FFF"),t&e.leavePad||!c()||l(),t&e.leaveSld||!c()||s()},this.fromHSV=function(e,t,r,o){if(null!==e){if(isNaN(e))return!1;e=Math.max(0,Math.min(360,e))}if(null!==t){if(isNaN(t))return!1;t=Math.max(0,Math.min(100,this.maxS,t),this.minS)}if(null!==r){if(isNaN(r))return!1;r=Math.max(0,Math.min(100,this.maxV,r),this.minV)}this.rgb=n(null===e?this.hsv[0]:this.hsv[0]=e,null===t?this.hsv[1]:this.hsv[1]=t,null===r?this.hsv[2]:this.hsv[2]=r),this.exportColor(o)},this.fromRGB=function(e,t,r,i){if(null!==e){if(isNaN(e))return!1;e=Math.max(0,Math.min(255,e))}if(null!==t){if(isNaN(t))return!1;t=Math.max(0,Math.min(255,t))}if(null!==r){if(isNaN(r))return!1;r=Math.max(0,Math.min(255,r))}var a=o(null===e?this.rgb[0]:e,null===t?this.rgb[1]:t,null===r?this.rgb[2]:r);null!==a[0]&&(this.hsv[0]=Math.max(0,Math.min(360,a[0]))),0!==a[2]&&(this.hsv[1]=null===a[1]?null:Math.max(0,this.minS,Math.min(100,this.maxS,a[1]))),this.hsv[2]=null===a[2]?null:Math.max(0,this.minV,Math.min(100,this.maxV,a[2]));var l=n(this.hsv[0],this.hsv[1],this.hsv[2]);this.rgb[0]=l[0],this.rgb[1]=l[1],this.rgb[2]=l[2],this.exportColor(i)},this.fromString=function(e,t){var r;if(void 0===e)return!0;if(r=e.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i))return 6===r[1].length?this.fromRGB(parseInt(r[1].substr(0,2),16),parseInt(r[1].substr(2,2),16),parseInt(r[1].substr(4,2),16),t):this.fromRGB(parseInt(r[1].charAt(0)+r[1].charAt(0),16),parseInt(r[1].charAt(1)+r[1].charAt(1),16),parseInt(r[1].charAt(2)+r[1].charAt(2),16),t),!0;if(r=e.match(/^\W*rgba?\(([^)]*)\)\W*$/i)){var o,n,i,a=r[1].split(","),l=/^\s*(\d*)(\.\d+)?\s*$/;if(a.length>=3&&(o=a[0].match(l))&&(n=a[1].match(l))&&(i=a[2].match(l))){var s=parseFloat((o[1]||"0")+(o[2]||"")),c=parseFloat((n[1]||"0")+(n[2]||"")),d=parseFloat((i[1]||"0")+(i[2]||""));return this.fromRGB(s,c,d,t),!0}}return!1},this.toString=function(){return(256|Math.round(this.rgb[0])).toString(16).substr(1)+(256|Math.round(this.rgb[1])).toString(16).substr(1)+(256|Math.round(this.rgb[2])).toString(16).substr(1)},this.toHEXString=function(){return"#"+this.toString().toUpperCase()},this.toRGBString=function(){return"rgb("+Math.round(this.rgb[0])+","+Math.round(this.rgb[1])+","+Math.round(this.rgb[2])+")"},this.isLight=function(){return.213*this.rgb[0]+.715*this.rgb[1]+.072*this.rgb[2]>127.5},this._processParentElementsInDOM=function(){if(!this._linkedElementsProcessed){this._linkedElementsProcessed=!0;var t=this.targetElement;do{var r=e.getStyle(t);r&&"fixed"===r.position.toLowerCase()&&(this.fixed=!0),t!==this.targetElement&&(t._jscEventsAttached||(e.attachEvent(t,"scroll",e.onParentScroll),t._jscEventsAttached=!0))}while((t=t.parentNode)&&!e.isElementType(t,"body"))}},"string"==typeof t){var u=t,h=document.getElementById(u);h?this.targetElement=h:e.warn("Could not find target element with ID '"+u+"'")}else t?this.targetElement=t:e.warn("Invalid target element: '"+t+"'");if(this.targetElement._jscLinkedInstance)return void e.warn("Cannot link jscolor twice to the same element. Skipping.");this.targetElement._jscLinkedInstance=this,this.valueElement=e.fetchElement(this.valueElement),this.styleElement=e.fetchElement(this.styleElement);var m=this,v=this.container?e.fetchElement(this.container):document.getElementsByTagName("body")[0],_=3;if(e.isElementType(this.targetElement,"button"))if(this.targetElement.onclick){var g=this.targetElement.onclick;this.targetElement.onclick=function(e){return g.call(this,e),!1}}else this.targetElement.onclick=function(){return!1};if(this.valueElement&&e.isElementType(this.valueElement,"input")){var y=function(){m.fromString(m.valueElement.value,e.leaveValue),e.dispatchFineChange(m)};e.attachEvent(this.valueElement,"keyup",y),e.attachEvent(this.valueElement,"input",y),e.attachEvent(this.valueElement,"blur",d),this.valueElement.setAttribute("autocomplete","off")}this.styleElement&&(this.styleElement._jscOrigStyle={backgroundImage:this.styleElement.style.backgroundImage,backgroundColor:this.styleElement.style.backgroundColor,color:this.styleElement.style.color}),this.value?this.fromString(this.value)||this.exportColor():this.importColor()}};return e.jscolor.lookupClass="jscolor",e.jscolor.installByClassName=function(t){var r=document.getElementsByTagName("input"),o=document.getElementsByTagName("button");e.tryInstallOnElements(r,t),e.tryInstallOnElements(o,t);var n=document.getElementsByTagName("div");e.tryInstallOnElements(n,t)},e.register(),e.jscolor}());