@frangoteam/fuxa
Version:
Web-based Process Visualization (SCADA/HMI/Dashboard) software
18 lines • 73.2 kB
JavaScript
(function(){"use strict";var n=jQuery.fn.attr,t="http://www.w3.org/2000/svg";jQuery.fn.attr=function(i,r){var e,u,l=this.length,f,o,s,h,c;if(!l)return n.apply(this,arguments);for(e=0;e<l;++e)if(f=this[e],f.namespaceURI===t){if(r!==undefined)f.setAttribute(i,r);else if($.isArray(i)){for(o=i.length,s={};o--;)h=i[o],u=f.getAttribute(h),(u||u==="0")&&(u=isNaN(u)?u:+u),s[h]=u;return s}if(typeof i=="object")for(c in i)f.setAttribute(c,i[c]);else return u=f.getAttribute(i),(u||u==="0")&&(u=isNaN(u)?u:+u),u}else return n.apply(this,arguments);return this}})();
jQuery&&function(){var e=$(window),n=$(document);$.extend($.fn,{contextMenu:function(t,i){return void 0!=t.menu&&(void 0==t.inSpeed&&(t.inSpeed=150),void 0==t.outSpeed&&(t.outSpeed=75),0==t.inSpeed&&(t.inSpeed=-1),0==t.outSpeed&&(t.outSpeed=-1),$(this).each(function(){var s=$(this),d=$(s).offset(),o=$("#"+t.menu);o.addClass("contextMenu"),$(this).bind("mousedown",function(r){var u=r;$(this).mouseup(function(r){var a=$(this);if(a.unbind("mouseup"),2===u.button||t.allowLeft||u.ctrlKey&&svgedit.browser.isMac()){if(r.stopPropagation(),$(".contextMenu").hide(),s.hasClass("disabled"))return!1;var h=r.pageX,c=r.pageY,l=e.width()-o.width(),f=e.height()-o.height();h>l-15&&(h=l-15),c>f-30&&(c=f-30),n.unbind("click"),o.css({top:c,left:h}).fadeIn(t.inSpeed),o.find("A").mouseover(function(){o.find("LI.hover").removeClass("hover"),$(this).parent().addClass("hover")}).mouseout(function(){o.find("LI.hover").removeClass("hover")}),n.keypress(function(e){switch(e.keyCode){case 38:o.find("LI.hover").length?(o.find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover"),o.find("LI.hover").length||o.find("LI:last").addClass("hover")):o.find("LI:last").addClass("hover");break;case 40:0==o.find("LI.hover").length?o.find("LI:first").addClass("hover"):(o.find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover"),o.find("LI.hover").length||o.find("LI:first").addClass("hover"));break;case 13:o.find("LI.hover A").trigger("click");break;case 27:n.trigger("click")}}),o.find("A").unbind("mouseup"),o.find("LI:not(.disabled) A").mouseup(function(){return n.unbind("click").unbind("keypress"),$(".contextMenu").hide(),i&&i($(this).attr("id").substr(1),$(a),{x:h-d.left,y:c-d.top,docX:h,docY:c}),!1}),setTimeout(function(){n.click(function(){return n.unbind("click").unbind("keypress"),o.fadeOut(t.outSpeed),!1})},0)}})}),$.browser.mozilla?$("#"+t.menu).each(function(){$(this).css({MozUserSelect:"none"})}):$.browser.msie?$("#"+t.menu).each(function(){$(this).bind("selectstart.disableTextSelect",function(){return!1})}):$("#"+t.menu).each(function(){$(this).bind("mousedown.disableTextSelect",function(){return!1})}),$(s).add($("UL.contextMenu")).bind("contextmenu",function(){return!1})}),$(this))},disableContextMenuItems:function(e){return void 0==e?($(this).find("LI").addClass("disabled"),$(this)):($(this).each(function(){if(void 0!=e)for(var n=e.split(","),t=0;t<n.length;t++)$(this).find('A[id="'+n[t]+'"]').parent().addClass("disabled")}),$(this))},enableContextMenuItems:function(e){return void 0==e?($(this).find("LI.disabled").removeClass("disabled"),$(this)):($(this).each(function(){if(void 0!=e)for(var n=e.split(","),t=0;t<n.length;t++)$(this).find('A[id="'+n[t]+'"]').parent().removeClass("disabled")}),$(this))},disableContextMenu:function(){return $(this).each(function(){$(this).addClass("disabled")}),$(this)},enableContextMenu:function(){return $(this).each(function(){$(this).removeClass("disabled")}),$(this)},destroyContextMenu:function(){return $(this).each(function(){$(this).unbind("mousedown").unbind("mouseup")}),$(this)}})}(jQuery);
(function(a,e){Math.precision=function(a,e){return void 0===e&&(e=0),Math.round(a*Math.pow(10,e))/Math.pow(10,e)};var l=function(e,l){var t,n,r=this,i=e.find("img:first"),s=0,o=100,c=100,u=0,v=100,d=100,h=0,p=0,b=new Array,g=function(a){for(var e=0;e<b.length;e++)b[e].call(r,r,a)},f=function(l){var i=e.offset();t={l:0|i.left,t:0|i.top},clearTimeout(n),n=setTimeout(function(){m.call(r,l)},0),a(document).bind("mousemove",x).bind("mouseup",w),l.preventDefault()},x=function(a){return clearTimeout(n),n=setTimeout(function(){m.call(r,a)},0),a.stopPropagation(),a.preventDefault(),!1},w=function(e){return a(document).unbind("mouseup",w).unbind("mousemove",x),e.stopPropagation(),e.preventDefault(),!1},m=function(a){var l=a.pageX-t.l,n=a.pageY-t.t,i=e.w,o=e.h;l<0?l=0:l>i&&(l=i),n<0?n=0:n>o&&(n=o),y.call(r,"xy",{x:l/i*c+s,y:n/o*d+u})},k=function(){var a=0,l=0,t=e.w,n=e.h,r=i.w,s=i.h;setTimeout(function(){c>0&&(a=h==o?t:h/c*t|0),d>0&&(l=p==v?n:p/d*n|0),r>=t?a=(t>>1)-(r>>1):a-=r>>1,s>=n?l=(n>>1)-(s>>1):l-=s>>1,i.css({left:a+"px",top:l+"px"})},0)},y=function(a,e,l){var t=void 0!==e;if(!t)switch(void 0!==a&&null!=a||(a="xy"),a.toLowerCase()){case"x":return h;case"y":return p;case"xy":default:return{x:h,y:p}}if(null==l||l!=r){var n,i,c=!1;switch(null==a&&(a="xy"),a.toLowerCase()){case"x":n=e&&(e.x&&0|e.x||0|e)||0;break;case"y":i=e&&(e.y&&0|e.y||0|e)||0;break;case"xy":default:n=e&&e.x&&0|e.x||0,i=e&&e.y&&0|e.y||0}null!=n&&(n<s?n=s:n>o&&(n=o),h!=n&&(h=n,c=!0)),null!=i&&(i<u?i=u:i>v&&(i=v),p!=i&&(p=i,c=!0)),c&&g.call(r,l||r)}},C=function(a,e){var l=void 0!==e;if(!l)switch(void 0!==a&&null!=a||(a="all"),a.toLowerCase()){case"minx":return s;case"maxx":return o;case"rangex":return{minX:s,maxX:o,rangeX:c};case"miny":return u;case"maxy":return v;case"rangey":return{minY:u,maxY:v,rangeY:d};case"all":default:return{minX:s,maxX:o,rangeX:c,minY:u,maxY:v,rangeY:d}}var t,n,r,i;switch(null==a&&(a="all"),a.toLowerCase()){case"minx":t=e&&(e.minX&&0|e.minX||0|e)||0;break;case"maxx":n=e&&(e.maxX&&0|e.maxX||0|e)||0;break;case"rangex":t=e&&e.minX&&0|e.minX||0,n=e&&e.maxX&&0|e.maxX||0;break;case"miny":r=e&&(e.minY&&0|e.minY||0|e)||0;break;case"maxy":i=e&&(e.maxY&&0|e.maxY||0|e)||0;break;case"rangey":r=e&&e.minY&&0|e.minY||0,i=e&&e.maxY&&0|e.maxY||0;break;case"all":default:t=e&&e.minX&&0|e.minX||0,n=e&&e.maxX&&0|e.maxX||0,r=e&&e.minY&&0|e.minY||0,i=e&&e.maxY&&0|e.maxY||0}null!=t&&s!=t&&(s=t,c=o-s),null!=n&&o!=n&&(o=n,c=o-s),null!=r&&u!=r&&(u=r,d=v-u),null!=i&&v!=i&&(v=i,d=v-u)},M=function(e){a.isFunction(e)&&b.push(e)},T=function(e){if(a.isFunction(e))for(var l;(l=a.inArray(e,b))!=-1;)b.splice(l,1)},Y=function(){a(document).unbind("mouseup",w).unbind("mousemove",x),e.unbind("mousedown",f),e=null,i=null,b=null};a.extend(!0,r,{val:y,range:C,bind:M,unbind:T,destroy:Y}),i.src=l.arrow&&l.arrow.image,i.w=l.arrow&&l.arrow.width||i.width(),i.h=l.arrow&&l.arrow.height||i.height(),e.w=l.map&&l.map.width||e.width(),e.h=l.map&&l.map.height||e.height(),e.bind("mousedown",f),M.call(r,k)},t=function(e,l,t,n){var r=this,i=e.find("td.Text input"),s=i.eq(3),o=i.eq(4),c=i.eq(5),u=i.length>7?i.eq(6):null,v=i.eq(0),d=i.eq(1),h=i.eq(2),p=i.eq(i.length>7?7:6),b=i.length>7?i.eq(8):null,g=function(a){if(""!=a.target.value||a.target==p.get(0)||(null==t||a.target==t.get(0))&&null!=t){if(!w(a))return a;switch(a.target){case s.get(0):switch(a.keyCode){case 38:return s.val(m.call(r,(s.val()<<0)+1,0,255)),l.val("r",s.val(),a.target),!1;case 40:return s.val(m.call(r,(s.val()<<0)-1,0,255)),l.val("r",s.val(),a.target),!1}break;case o.get(0):switch(a.keyCode){case 38:return o.val(m.call(r,(o.val()<<0)+1,0,255)),l.val("g",o.val(),a.target),!1;case 40:return o.val(m.call(r,(o.val()<<0)-1,0,255)),l.val("g",o.val(),a.target),!1}break;case c.get(0):switch(a.keyCode){case 38:return c.val(m.call(r,(c.val()<<0)+1,0,255)),l.val("b",c.val(),a.target),!1;case 40:return c.val(m.call(r,(c.val()<<0)-1,0,255)),l.val("b",c.val(),a.target),!1}break;case u&&u.get(0):switch(a.keyCode){case 38:return u.val(m.call(r,parseFloat(u.val())+1,0,100)),l.val("a",Math.precision(255*u.val()/100,n),a.target),!1;case 40:return u.val(m.call(r,parseFloat(u.val())-1,0,100)),l.val("a",Math.precision(255*u.val()/100,n),a.target),!1}break;case v.get(0):switch(a.keyCode){case 38:return v.val(m.call(r,(v.val()<<0)+1,0,360)),l.val("h",v.val(),a.target),!1;case 40:return v.val(m.call(r,(v.val()<<0)-1,0,360)),l.val("h",v.val(),a.target),!1}break;case d.get(0):switch(a.keyCode){case 38:return d.val(m.call(r,(d.val()<<0)+1,0,100)),l.val("s",d.val(),a.target),!1;case 40:return d.val(m.call(r,(d.val()<<0)-1,0,100)),l.val("s",d.val(),a.target),!1}break;case h.get(0):switch(a.keyCode){case 38:return h.val(m.call(r,(h.val()<<0)+1,0,100)),l.val("v",h.val(),a.target),!1;case 40:return h.val(m.call(r,(h.val()<<0)-1,0,100)),l.val("v",h.val(),a.target),!1}}}},f=function(a){if(""!=a.target.value||a.target==p.get(0)||(null==t||a.target==t.get(0))&&null!=t){if(!w(a))return a;switch(a.target){case s.get(0):s.val(m.call(r,s.val(),0,255)),l.val("r",s.val(),a.target);break;case o.get(0):o.val(m.call(r,o.val(),0,255)),l.val("g",o.val(),a.target);break;case c.get(0):c.val(m.call(r,c.val(),0,255)),l.val("b",c.val(),a.target);break;case u&&u.get(0):u.val(m.call(r,u.val(),0,100)),l.val("a",Math.precision(255*u.val()/100,n),a.target);break;case v.get(0):v.val(m.call(r,v.val(),0,360)),l.val("h",v.val(),a.target);break;case d.get(0):d.val(m.call(r,d.val(),0,100)),l.val("s",d.val(),a.target);break;case h.get(0):h.val(m.call(r,h.val(),0,100)),l.val("v",h.val(),a.target);break;case p.get(0):p.val(p.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6)),t&&t.val(p.val()),l.val("hex",""!=p.val()?p.val():null,a.target);break;case t&&t.get(0):t.val(t.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6)),p.val(t.val()),l.val("hex",""!=t.val()?t.val():null,a.target);break;case b&&b.get(0):b.val(b.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,2)),l.val("a",null!=b.val()?parseInt(b.val(),16):null,a.target)}}},x=function(a){if(null!=l.val())switch(a.target){case s.get(0):s.val(l.val("r"));break;case o.get(0):o.val(l.val("g"));break;case c.get(0):c.val(l.val("b"));break;case u&&u.get(0):u.val(Math.precision(100*l.val("a")/255,n));break;case v.get(0):v.val(l.val("h"));break;case d.get(0):d.val(l.val("s"));break;case h.get(0):h.val(l.val("v"));break;case p.get(0):case t&&t.get(0):p.val(l.val("hex")),t&&t.val(l.val("hex"));break;case b&&b.get(0):b.val(l.val("ahex").substring(6))}},w=function(a){switch(a.keyCode){case 9:case 16:case 29:case 37:case 39:return!1;case"c".charCodeAt():case"v".charCodeAt():if(a.ctrlKey)return!1}return!0},m=function(a,e,l){return""==a||isNaN(a)?e:a>l?l:a<e?e:a},k=function(a,e){var l=a.val("all");e!=s.get(0)&&s.val(null!=l?l.r:""),e!=o.get(0)&&o.val(null!=l?l.g:""),e!=c.get(0)&&c.val(null!=l?l.b:""),u&&e!=u.get(0)&&u.val(null!=l?Math.precision(100*l.a/255,n):""),e!=v.get(0)&&v.val(null!=l?l.h:""),e!=d.get(0)&&d.val(null!=l?l.s:""),e!=h.get(0)&&h.val(null!=l?l.v:""),e!=p.get(0)&&(t&&e!=t.get(0)||!t)&&p.val(null!=l?l.hex:""),t&&e!=t.get(0)&&e!=p.get(0)&&t.val(null!=l?l.hex:""),b&&e!=b.get(0)&&b.val(null!=l?l.ahex.substring(6):"")},y=function(){s.add(o).add(c).add(u).add(v).add(d).add(h).add(p).add(t).add(b).unbind("keyup",f).unbind("blur",x),s.add(o).add(c).add(u).add(v).add(d).add(h).unbind("keydown",g),l.unbind(k),s=null,o=null,c=null,u=null,v=null,d=null,h=null,p=null,b=null};a.extend(!0,r,{destroy:y}),s.add(o).add(c).add(u).add(v).add(d).add(h).add(p).add(t).add(b).bind("keyup",f).bind("blur",x),s.add(o).add(c).add(u).add(v).add(d).add(h).bind("keydown",g),l.bind(k)};a.jPicker={List:[],Color:function(e){var l,t,n,r,i,o,c,u=this,v=new Array,d=function(a){for(var e=0;e<v.length;e++)v[e].call(u,u,a)},h=function(a,e,v){var p=Boolean(e);if(p&&""===e.ahex&&(e.ahex="00000000"),!p){if(void 0!==a&&null!=a&&""!=a||(a="all"),null==l)return null;switch(a.toLowerCase()){case"ahex":return s.rgbaToHex({r:l,g:t,b:n,a:r});case"hex":return h("ahex").substring(0,6);case"all":return{r:l,g:t,b:n,a:r,h:i,s:o,v:c,hex:h.call(u,"hex"),ahex:h.call(u,"ahex")};default:for(var b={},g=0;g<a.length;g++)switch(a.charAt(g)){case"r":1==a.length?b=l:b.r=l;break;case"g":1==a.length?b=t:b.g=t;break;case"b":1==a.length?b=n:b.b=n;break;case"a":1==a.length?b=r:b.a=r;break;case"h":1==a.length?b=i:b.h=i;break;case"s":1==a.length?b=o:b.s=o;break;case"v":1==a.length?b=c:b.v=c}return b=={}?h.call(u,"all"):b}}if(null==v||v!=u){var f=!1;if(null==a&&(a=""),null==e)return null!=l&&(l=null,f=!0),null!=t&&(t=null,f=!0),null!=n&&(n=null,f=!0),null!=r&&(r=null,f=!0),null!=i&&(i=null,f=!0),null!=o&&(o=null,f=!0),null!=c&&(c=null,f=!0),void(f&&d.call(u,v||u));switch(a.toLowerCase()){case"ahex":case"hex":var b=s.hexToRgba(e&&(e.ahex||e.hex)||e||"none");h.call(u,"rgba",{r:b.r,g:b.g,b:b.b,a:"ahex"==a?b.a:null!=r?r:255},v);break;default:if(e&&(null!=e.ahex||null!=e.hex))return void h.call(u,"ahex",e.ahex||e.hex||"00000000",v);var x={},w=!1,m=!1;void 0!==e.r&&!a.indexOf("r")==-1&&(a+="r"),void 0!==e.g&&!a.indexOf("g")==-1&&(a+="g"),void 0!==e.b&&!a.indexOf("b")==-1&&(a+="b"),void 0!==e.a&&!a.indexOf("a")==-1&&(a+="a"),void 0!==e.h&&!a.indexOf("h")==-1&&(a+="h"),void 0!==e.s&&!a.indexOf("s")==-1&&(a+="s"),void 0!==e.v&&!a.indexOf("v")==-1&&(a+="v");for(var g=0;g<a.length;g++)switch(a.charAt(g)){case"r":if(m)continue;w=!0,x.r=e&&e.r&&0|e.r||e&&0|e||0,x.r<0?x.r=0:x.r>255&&(x.r=255),l!=x.r&&(l=x.r,f=!0);break;case"g":if(m)continue;w=!0,x.g=e&&e.g&&0|e.g||e&&0|e||0,x.g<0?x.g=0:x.g>255&&(x.g=255),t!=x.g&&(t=x.g,f=!0);break;case"b":if(m)continue;w=!0,x.b=e&&e.b&&0|e.b||e&&0|e||0,x.b<0?x.b=0:x.b>255&&(x.b=255),n!=x.b&&(n=x.b,f=!0);break;case"a":x.a=e&&null!=e.a?0|e.a:null!=e?0|e:255,x.a<0?x.a=0:x.a>255&&(x.a=255),r!=x.a&&(r=x.a,f=!0);break;case"h":if(w)continue;m=!0,x.h=e&&e.h&&0|e.h||e&&0|e||0,x.h<0?x.h=0:x.h>360&&(x.h=360),i!=x.h&&(i=x.h,f=!0);break;case"s":if(w)continue;m=!0,x.s=e&&null!=e.s?0|e.s:null!=e?0|e:100,x.s<0?x.s=0:x.s>100&&(x.s=100),o!=x.s&&(o=x.s,f=!0);break;case"v":if(w)continue;m=!0,x.v=e&&null!=e.v?0|e.v:null!=e?0|e:100,x.v<0?x.v=0:x.v>100&&(x.v=100),c!=x.v&&(c=x.v,f=!0)}if(f){if(w){l=l||0,t=t||0,n=n||0;var b=s.rgbToHsv({r:l,g:t,b:n});i=b.h,o=b.s,c=b.v}else if(m){i=i||0,o=null!=o?o:100,c=null!=c?c:100;var b=s.hsvToRgb({h:i,s:o,v:c});l=b.r,t=b.g,n=b.b}r=null!=r?r:255,d.call(u,v||u)}}}},p=function(e){a.isFunction(e)&&v.push(e)},b=function(e){if(a.isFunction(e))for(var l;(l=a.inArray(e,v))!=-1;)v.splice(l,1)},g=function(){v=null};a.extend(!0,u,{val:h,bind:p,unbind:b,destroy:g}),e&&(null!=e.ahex?h("ahex",e):null!=e.hex?h((null!=e.a?"a":"")+"hex",null!=e.a?{ahex:e.hex+s.intToHex(e.a)}:e):null!=e.r&&null!=e.g&&null!=e.b?h("rgb"+(null!=e.a?"a":""),e):null!=e.h&&null!=e.s&&null!=e.v&&h("hsv"+(null!=e.a?"a":""),e))},ColorMethods:{hexToRgba:function(a){if(""===a||"none"===a)return{r:null,g:null,b:null,a:null};a=this.validateHex(a);var e="00",l="00",t="00",n="255";return 6==a.length&&(a+="ff"),a.length>6?(e=a.substring(0,2),l=a.substring(2,4),t=a.substring(4,6),n=a.substring(6,a.length)):(a.length>4&&(e=a.substring(4,a.length),a=a.substring(0,4)),a.length>2&&(l=a.substring(2,a.length),a=a.substring(0,2)),a.length>0&&(t=a.substring(0,a.length))),{r:this.hexToInt(e),g:this.hexToInt(l),b:this.hexToInt(t),a:this.hexToInt(n)}},validateHex:function(a){return a=a.toLowerCase().replace(/[^a-f0-9]/g,""),a.length>8&&(a=a.substring(0,8)),a},rgbaToHex:function(a){return this.intToHex(a.r)+this.intToHex(a.g)+this.intToHex(a.b)+this.intToHex(a.a)},intToHex:function(a){var e=(0|a).toString(16);return 1==e.length&&(e="0"+e),e.toLowerCase()},hexToInt:function(a){return parseInt(a,16)},rgbToHsv:function(a){var e,l=a.r/255,t=a.g/255,n=a.b/255,r={h:0,s:0,v:0},i=0,s=0;return l>=t&&l>=n?(s=l,i=t>n?n:t):t>=n&&t>=l?(s=t,i=l>n?n:l):(s=n,i=t>l?l:t),r.v=s,r.s=s?(s-i)/s:0,r.s?(e=s-i,l==s?r.h=(t-n)/e:t==s?r.h=2+(n-l)/e:r.h=4+(l-t)/e,r.h=parseInt(60*r.h),r.h<0&&(r.h+=360)):r.h=0,r.s=100*r.s|0,r.v=100*r.v|0,r},hsvToRgb:function(a){var e={r:0,g:0,b:0,a:100},l=a.h,t=a.s,n=a.v;if(0==t)0==n?e.r=e.g=e.b=0:e.r=e.g=e.b=255*n/100|0;else{360==l&&(l=0),l/=60,t/=100,n/=100;var r=0|l,i=l-r,s=n*(1-t),o=n*(1-t*i),c=n*(1-t*(1-i));switch(r){case 0:e.r=n,e.g=c,e.b=s;break;case 1:e.r=o,e.g=n,e.b=s;break;case 2:e.r=s,e.g=n,e.b=c;break;case 3:e.r=s,e.g=o,e.b=n;break;case 4:e.r=c,e.g=s,e.b=n;break;case 5:e.r=n,e.g=s,e.b=o}e.r=255*e.r|0,e.g=255*e.g|0,e.b=255*e.b|0}return e}}};var n=a.jPicker.Color,r=a.jPicker.List,s=a.jPicker.ColorMethods;a.fn.jPicker=function(e){var o=arguments;return this.each(function(){var c=this,u=a.extend(!0,{},a.fn.jPicker.defaults,e);"input"==a(c).get(0).nodeName.toLowerCase()&&(a.extend(!0,u,{window:{bindToInput:!0,expandable:!0,input:a(c)}}),""==a(c).val()?(u.color.active=new n({hex:null}),u.color.current=new n({hex:null})):s.validateHex(a(c).val())&&(u.color.active=new n({hex:a(c).val(),a:u.color.active.val("a")}),u.color.current=new n({hex:a(c).val(),a:u.color.active.val("a")}))),u.window.expandable?a(c).after('<span class="jPicker"><span class="Icon"><span class="Color"> </span><span class="Alpha"> </span><span class="Image" title="Click To Open Color Picker"> </span><span class="Container"> </span></span></span>'):u.window.liveUpdate=!1;var v=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,d=null,h=null,p=null,b=null,g=null,f=null,x=null,w=null,m=null,k=null,y=null,C=null,M=null,T=null,Y=null,q=null,P=null,A=null,I=null,X=null,L=null,S=null,B=null,O=null,H=null,R=null,j=null,F=null,V=function(a){var e,l,t=ma.active,n=(xa.clientPath,t.val("hex"));switch(u.color.mode=a,a){case"h":if(setTimeout(function(){U.call(c,h,"transparent"),W.call(c,b,0),Z.call(c,b,100),W.call(c,g,260),Z.call(c,g,100),U.call(c,p,"transparent"),W.call(c,x,0),Z.call(c,x,100),W.call(c,w,260),Z.call(c,w,100),W.call(c,m,260),Z.call(c,m,100),W.call(c,k,260),Z.call(c,k,100),W.call(c,C,260),Z.call(c,C,100)},0),M.range("all",{minX:0,maxX:100,minY:0,maxY:100}),T.range("rangeY",{minY:0,maxY:360}),null==t.val("ahex"))break;M.val("xy",{x:t.val("s"),y:100-t.val("v")},M),T.val("y",360-t.val("h"),T);break;case"s":if(setTimeout(function(){U.call(c,h,"transparent"),W.call(c,b,-260),W.call(c,g,-520),W.call(c,x,-260),W.call(c,w,-520),W.call(c,C,260),Z.call(c,C,100)},0),M.range("all",{minX:0,maxX:360,minY:0,maxY:100}),T.range("rangeY",{minY:0,maxY:100}),null==t.val("ahex"))break;M.val("xy",{x:t.val("h"),y:100-t.val("v")},M),T.val("y",100-t.val("s"),T);break;case"v":if(setTimeout(function(){U.call(c,h,"000000"),W.call(c,b,-780),W.call(c,g,260),U.call(c,p,n),W.call(c,x,-520),W.call(c,w,260),Z.call(c,w,100),W.call(c,C,260),Z.call(c,C,100)},0),M.range("all",{minX:0,maxX:360,minY:0,maxY:100}),T.range("rangeY",{minY:0,maxY:100}),null==t.val("ahex"))break;M.val("xy",{x:t.val("h"),y:100-t.val("s")},M),T.val("y",100-t.val("v"),T);break;case"r":if(e=-1040,l=-780,M.range("all",{minX:0,maxX:255,minY:0,maxY:255}),T.range("rangeY",{minY:0,maxY:255}),null==t.val("ahex"))break;M.val("xy",{x:t.val("b"),y:255-t.val("g")},M),T.val("y",255-t.val("r"),T);break;case"g":if(e=-1560,l=-1820,M.range("all",{minX:0,maxX:255,minY:0,maxY:255}),T.range("rangeY",{minY:0,maxY:255}),null==t.val("ahex"))break;M.val("xy",{x:t.val("b"),y:255-t.val("r")},M),T.val("y",255-t.val("g"),T);break;case"b":if(e=-2080,l=-2860,M.range("all",{minX:0,maxX:255,minY:0,maxY:255}),T.range("rangeY",{minY:0,maxY:255}),null==t.val("ahex"))break;M.val("xy",{x:t.val("r"),y:255-t.val("g")},M),T.val("y",255-t.val("b"),T);break;case"a":if(setTimeout(function(){U.call(c,h,"transparent"),W.call(c,b,-260),W.call(c,g,-520),W.call(c,x,260),W.call(c,w,260),Z.call(c,w,100),W.call(c,C,0),Z.call(c,C,100)},0),M.range("all",{minX:0,maxX:360,minY:0,maxY:100}),T.range("rangeY",{minY:0,maxY:255}),null==t.val("ahex"))break;M.val("xy",{x:t.val("h"),y:100-t.val("v")},M),T.val("y",255-t.val("a"),T);break;default:throw"Invalid Mode"}switch(a){case"h":break;case"s":case"v":case"a":setTimeout(function(){Z.call(c,b,100),Z.call(c,x,100),W.call(c,m,260),Z.call(c,m,100),W.call(c,k,260),Z.call(c,k,100)},0);break;case"r":case"g":case"b":setTimeout(function(){U.call(c,h,"transparent"),U.call(c,p,"transparent"),Z.call(c,x,100),Z.call(c,b,100),W.call(c,b,e),W.call(c,g,e-260),W.call(c,x,l-780),W.call(c,w,l-520),W.call(c,m,l),W.call(c,k,l-260),W.call(c,C,260),Z.call(c,C,100)},0)}null!=t.val("ahex")&&D.call(c,t)},D=function(a,e){(null==e||e!=T&&e!=M)&&G.call(c,a,e),setTimeout(function(){N.call(c,a),Q.call(c,a),K.call(c,a)},0)},z=function(a,e){var l=ma.active;if(e==M||null!=l.val()){var t=a.val("all");switch(u.color.mode){case"h":l.val("sv",{s:t.x,v:100-t.y},e);break;case"s":case"a":l.val("hv",{h:t.x,v:100-t.y},e);break;case"v":l.val("hs",{h:t.x,s:100-t.y},e);break;case"r":l.val("gb",{g:255-t.y,b:t.x},e);break;case"g":l.val("rb",{r:255-t.y,b:t.x},e);break;case"b":l.val("rg",{r:t.x,g:255-t.y},e)}}},E=function(a,e){var l=ma.active;if(e==T||null!=l.val())switch(u.color.mode){case"h":l.val("h",{h:360-a.val("y")},e);break;case"s":l.val("s",{s:100-a.val("y")},e);break;case"v":l.val("v",{v:100-a.val("y")},e);break;case"r":l.val("r",{r:255-a.val("y")},e);break;case"g":l.val("g",{g:255-a.val("y")},e);break;case"b":l.val("b",{b:255-a.val("y")},e);break;case"a":l.val("a",255-a.val("y"),e)}},G=function(a,e){if(e!=M)switch(u.color.mode){case"h":var l=a.val("sv");M.val("xy",{x:null!=l?l.s:100,y:100-(null!=l?l.v:100)},e);break;case"s":case"a":var t=a.val("hv");M.val("xy",{x:t&&t.h||0,y:100-(null!=t?t.v:100)},e);break;case"v":var n=a.val("hs");M.val("xy",{x:n&&n.h||0,y:100-(null!=n?n.s:100)},e);break;case"r":var r=a.val("bg");M.val("xy",{x:r&&r.b||0,y:255-(r&&r.g||0)},e);break;case"g":var i=a.val("br");M.val("xy",{x:i&&i.b||0,y:255-(i&&i.r||0)},e);break;case"b":var s=a.val("rg");M.val("xy",{x:s&&s.r||0,y:255-(s&&s.g||0)},e)}if(e!=T)switch(u.color.mode){case"h":T.val("y",360-(a.val("h")||0),e);break;case"s":var o=a.val("s");T.val("y",100-(null!=o?o:100),e);break;case"v":var c=a.val("v");T.val("y",100-(null!=c?c:100),e);break;case"r":T.val("y",255-(a.val("r")||0),e);break;case"g":T.val("y",255-(a.val("g")||0),e);break;case"b":T.val("y",255-(a.val("b")||0),e);break;case"a":var v=a.val("a");T.val("y",255-(null!=v?v:255),e)}},N=function(a){try{var e=a.val("all");X.css({backgroundColor:e&&"#"+e.hex||"transparent"}),Z.call(c,X,e&&Math.precision(100*e.a/255,4)||0)}catch(a){}},Q=function(a){switch(u.color.mode){case"h":U.call(c,h,new n({h:a.val("h")||0,s:100,v:100}).val("hex"));break;case"s":case"a":var e=a.val("s");Z.call(c,g,100-(null!=e?e:100));break;case"v":var l=a.val("v");Z.call(c,b,null!=l?l:100);break;case"r":Z.call(c,g,Math.precision((a.val("r")||0)/255*100,4));break;case"g":Z.call(c,g,Math.precision((a.val("g")||0)/255*100,4));break;case"b":Z.call(c,g,Math.precision((a.val("b")||0)/255*100))}var t=a.val("a");Z.call(c,f,Math.precision(100*(255-(t||0))/255,4))},K=function(a){switch(u.color.mode){case"h":var e=a.val("a");Z.call(c,y,Math.precision(100*(255-(e||0))/255,4));break;case"s":var l=a.val("hva"),t=new n({h:l&&l.h||0,s:100,v:null!=l?l.v:100});U.call(c,p,t.val("hex")),Z.call(c,w,100-(null!=l?l.v:100)),Z.call(c,y,Math.precision(100*(255-(l&&l.a||0))/255,4));break;case"v":var r=a.val("hsa"),i=new n({h:r&&r.h||0,s:null!=r?r.s:100,v:100});U.call(c,p,i.val("hex")),Z.call(c,y,Math.precision(100*(255-(r&&r.a||0))/255,4));break;case"r":case"g":case"b":var s=0,o=0,v=a.val("rgba");"r"==u.color.mode?(s=v&&v.b||0,o=v&&v.g||0):"g"==u.color.mode?(s=v&&v.b||0,o=v&&v.r||0):"b"==u.color.mode&&(s=v&&v.r||0,o=v&&v.g||0);var d=o>s?s:o;Z.call(c,w,s>o?Math.precision((s-o)/(255-o)*100,4):0),Z.call(c,m,o>s?Math.precision((o-s)/(255-s)*100,4):0),Z.call(c,k,Math.precision(d/255*100,4)),Z.call(c,y,Math.precision(100*(255-(v&&v.a||0))/255,4));break;case"a":var e=a.val("a");U.call(c,p,a.val("hex")||"000000"),Z.call(c,y,null!=e?0:100),Z.call(c,C,null!=e?100:0)}},U=function(a,e){a.css({backgroundColor:e&&6==e.length&&"#"+e||"transparent"})},J=function(a,e){!v||e.indexOf("AlphaBar.png")==-1&&e.indexOf("Bars.png")==-1&&e.indexOf("Maps.png")==-1?a.css({backgroundImage:"url('"+e+"')"}):(a.attr("pngSrc",e),a.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e+"', sizingMethod='scale')"}))},W=function(a,e){a.css({top:e+"px"})},Z=function(a,e){if(a.css({visibility:e>0?"visible":"hidden"}),e>0&&e<100)if(v){var l=a.attr("pngSrc");null==l||l.indexOf("AlphaBar.png")==-1&&l.indexOf("Bars.png")==-1&&l.indexOf("Maps.png")==-1?a.css({opacity:Math.precision(e/100,4)}):a.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+l+"', sizingMethod='scale') progid:DXImageTransform.Microsoft.Alpha(opacity="+e+")"})}else a.css({opacity:Math.precision(e/100,4)});else if(0==e||100==e)if(v){var l=a.attr("pngSrc");null==l||l.indexOf("AlphaBar.png")==-1&&l.indexOf("Bars.png")==-1&&l.indexOf("Maps.png")==-1?a.css({opacity:""}):a.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+l+"', sizingMethod='scale')"})}else a.css({opacity:""})},$=function(){ma.active.val("ahex",ma.current.val("ahex"))},_=function(){ma.current.val("ahex",ma.active.val("ahex"))},aa=function(e){a(this).parents("tbody:first").find('input:radio[value!="'+e.target.value+'"]').removeAttr("checked"),V.call(c,e.target.value)},ea=function(){$.call(c)},la=function(){$.call(c),u.window.expandable&&ba.call(c),a.isFunction(ha)&&ha.call(c,ma.active,B)},ta=function(){_.call(c),u.window.expandable&&ba.call(c),a.isFunction(va)&&va.call(c,ma.active,S)},na=function(){pa.call(c)},ra=function(a,e){var l=a.val("hex");L.css({backgroundColor:l&&"#"+l||"transparent"}),Z.call(c,L,Math.precision(100*(a.val("a")||0)/255,4))},ia=function(a,e){var l=a.val("hex"),t=a.val("va");H.css({backgroundColor:l&&"#"+l||"transparent"}),Z.call(c,R,Math.precision(100*(255-(t&&t.a||0))/255,4)),u.window.bindToInput&&u.window.updateInputColor&&u.window.input.css({backgroundColor:l&&"#"+l||"transparent",color:null==t||t.v>75?"#000000":"#ffffff"})},sa=function(e){u.window.element,u.window.page;q=parseInt(d.css("left")),P=parseInt(d.css("top")),A=e.pageX,I=e.pageY,a(document).bind("mousemove",oa).bind("mouseup",ca),e.preventDefault()},oa=function(e){return d.css({left:q-(A-e.pageX)+"px",top:P-(I-e.pageY)+"px"}),u.window.expandable&&!a.support.boxModel&&d.prev().css({left:d.css("left"),top:d.css("top")}),e.stopPropagation(),e.preventDefault(),!1},ca=function(e){return a(document).unbind("mousemove",oa).unbind("mouseup",ca),e.stopPropagation(),e.preventDefault(),!1},ua=function(e){return e.preventDefault(),e.stopPropagation(),ma.active.val("ahex",a(this).attr("title")||null,e.target),!1},va=a.isFunction(o[1])&&o[1]||null,da=a.isFunction(o[2])&&o[2]||null,ha=a.isFunction(o[3])&&o[3]||null,pa=function(){ma.current.val("ahex",ma.active.val("ahex"));var e=function(){if(u.window.expandable&&!a.support.boxModel){var e=d.find("table:first");d.before("<iframe/>"),d.prev().css({width:e.width(),height:d.height(),opacity:0,position:"absolute",left:d.css("left"),top:d.css("top")})}};switch(u.window.expandable&&(a(document.body).children("div.jPicker.Container").css({zIndex:10}),d.css({zIndex:20})),u.window.effects.type){case"fade":d.fadeIn(u.window.effects.speed.show,e);break;case"slide":d.slideDown(u.window.effects.speed.show,e);break;case"show":default:d.show(u.window.effects.speed.show,e)}},ba=function(){var e=function(){u.window.expandable&&d.css({zIndex:10}),u.window.expandable&&!a.support.boxModel&&d.prev().remove()};switch(u.window.effects.type){case"fade":d.fadeOut(u.window.effects.speed.hide,e);break;case"slide":d.slideUp(u.window.effects.speed.hide,e);break;case"show":default:d.hide(u.window.effects.speed.hide,e)}},ga=function(){var e=u.window,r=e.expandable?a(c).next().find(".Container:first"):null;d=a(e.expandable?"<div/>":c),d.addClass("jPicker Container"),e.expandable&&d.hide(),d.get(0).onselectstart=function(a){if("input"!==a.target.nodeName.toLowerCase())return!1};var s=ma.active.val("all");e.alphaPrecision<0?e.alphaPrecision=0:e.alphaPrecision>2&&(e.alphaPrecision=2);var o='<table class="jPicker" cellpadding="0" cellspacing="0"><tbody>'+(e.expandable?'<tr><td class="Move" colspan="5"> </td></tr>':"")+'<tr><td rowspan="9"><h2 class="Title">'+(e.title||wa.text.title)+'</h2><div class="Map"><span class="Map1"> </span><span class="Map2"> </span><span class="Map3"> </span><img src="'+xa.clientPath+xa.colorMap.arrow.file+'" class="Arrow"/></div></td><td rowspan="9"><div class="Bar"><span class="Map1"> </span><span class="Map2"> </span><span class="Map3"> </span><span class="Map4"> </span><span class="Map5"> </span><span class="Map6"> </span><img src="'+xa.clientPath+xa.colorBar.arrow.file+'" class="Arrow"/></div></td><td colspan="2" class="Preview">'+wa.text.newColor+'<div><span class="Active" title="'+wa.tooltips.colors.newColor+'"> </span><span class="Current" title="'+wa.tooltips.colors.currentColor+'"> </span></div>'+wa.text.currentColor+'</td><td rowspan="9" class="Button"><input type="button" class="Ok" value="'+wa.text.ok+'" title="'+wa.tooltips.buttons.ok+'"/><input type="button" class="Cancel" value="'+wa.text.cancel+'" title="'+wa.tooltips.buttons.cancel+'"/><hr/><div class="Grid"> </div></td></tr><tr class="Hue"><td class="Radio"><label title="'+wa.tooltips.hue.radio+'"><input type="radio" value="h"'+("h"==u.color.mode?' checked="checked"':"")+'/>H:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(null!=s?s.h:"")+'" title="'+wa.tooltips.hue.textbox+'"/> °</td></tr><tr class="Saturation"><td class="Radio"><label title="'+wa.tooltips.saturation.radio+'"><input type="radio" value="s"'+("s"==u.color.mode?' checked="checked"':"")+'/>S:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(null!=s?s.s:"")+'" title="'+wa.tooltips.saturation.textbox+'"/> %</td></tr><tr class="Value"><td class="Radio"><label title="'+wa.tooltips.value.radio+'"><input type="radio" value="v"'+("v"==u.color.mode?' checked="checked"':"")+'/>V:</label><br/><br/></td><td class="Text"><input type="text" maxlength="3" value="'+(null!=s?s.v:"")+'" title="'+wa.tooltips.value.textbox+'"/> %<br/><br/></td></tr><tr class="Red"><td class="Radio"><label title="'+wa.tooltips.red.radio+'"><input type="radio" value="r"'+("r"==u.color.mode?' checked="checked"':"")+'/>R:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(null!=s?s.r:"")+'" title="'+wa.tooltips.red.textbox+'"/></td></tr><tr class="Green"><td class="Radio"><label title="'+wa.tooltips.green.radio+'"><input type="radio" value="g"'+("g"==u.color.mode?' checked="checked"':"")+'/>G:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(null!=s?s.g:"")+'" title="'+wa.tooltips.green.textbox+'"/></td></tr><tr class="Blue"><td class="Radio"><label title="'+wa.tooltips.blue.radio+'"><input type="radio" value="b"'+("b"==u.color.mode?' checked="checked"':"")+'/>B:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(null!=s?s.b:"")+'" title="'+wa.tooltips.blue.textbox+'"/></td></tr><tr class="Alpha"><td class="Radio">'+(e.alphaSupport?'<label title="'+wa.tooltips.alpha.radio+'"><input type="radio" value="a"'+("a"==u.color.mode?' checked="checked"':"")+"/>A:</label>":" ")+'</td><td class="Text">'+(e.alphaSupport?'<input type="text" maxlength="'+(3+e.alphaPrecision)+'" value="'+(null!=s?Math.precision(100*s.a/255,e.alphaPrecision):"")+'" title="'+wa.tooltips.alpha.textbox+'"/> %':" ")+'</td></tr><tr class="Hex"><td colspan="2" class="Text"><label title="'+wa.tooltips.hex.textbox+'">#:<input type="text" maxlength="6" class="Hex" value="'+(null!=s?s.hex:"")+'"/></label>'+(e.alphaSupport?'<input type="text" maxlength="2" class="AHex" value="'+(null!=s?s.ahex.substring(6):"")+'" title="'+wa.tooltips.hex.alpha+'"/></td>':" ")+"</tr></tbody></table>";e.expandable?(d.html(o),0==a(document.body).children("div.jPicker.Container").length?a(document.body).prepend(d):a(document.body).children("div.jPicker.Container:last").after(d),d.mousedown(function(){a(document.body).children("div.jPicker.Container").css({zIndex:10}),d.css({zIndex:20})}),d.css({left:"left"==e.position.x?r.offset().left-530-("center"==e.position.y?25:0)+"px":"center"==e.position.x?r.offset().left-260+"px":"right"==e.position.x?r.offset().left-10+("center"==e.position.y?25:0)+"px":"screenCenter"==e.position.x?(a(document).width()>>1)-260+"px":r.offset().left+parseInt(e.position.x)+"px",position:"absolute",top:"top"==e.position.y?r.offset().top-312+"px":"center"==e.position.y?r.offset().top-156+"px":"bottom"==e.position.y?r.offset().top+25+"px":r.offset().top+parseInt(e.position.y)+"px"})):(d=a(c),d.html(o));var v=d.find("tbody:first");h=v.find("div.Map:first"),p=v.find("div.Bar:first");var q=h.find("span"),P=p.find("span");b=q.filter(".Map1:first"),g=q.filter(".Map2:first"),f=q.filter(".Map3:first"),x=P.filter(".Map1:first"),w=P.filter(".Map2:first"),m=P.filter(".Map3:first"),k=P.filter(".Map4:first"),y=P.filter(".Map5:first"),C=P.filter(".Map6:first"),M=new l(h,{map:{width:xa.colorMap.width,height:xa.colorMap.height},arrow:{image:xa.clientPath+xa.colorMap.arrow.file,width:xa.colorMap.arrow.width,height:xa.colorMap.arrow.height}}),M.bind(z),T=new l(p,{map:{width:xa.colorBar.width,height:xa.colorBar.height},arrow:{image:xa.clientPath+xa.colorBar.arrow.file,width:xa.colorBar.arrow.width,height:xa.colorBar.arrow.height}}),T.bind(E),Y=new t(v,ma.active,e.expandable&&e.bindToInput?e.input:null,e.alphaPrecision);var A=null!=s?s.hex:null,I=v.find(".Preview"),G=v.find(".Button");if(X=I.find(".Active:first").css({backgroundColor:A&&"#"+A||"transparent"}),L=I.find(".Current:first").css({backgroundColor:A&&"#"+A||"transparent"}).bind("click",ea),Z.call(c,L,Math.precision(100*ma.current.val("a"))/255,4),S=G.find(".Ok:first").bind("click",ta),B=G.find(".Cancel:first").bind("click",la),O=G.find(".Grid:first"),setTimeout(function(){J.call(c,b,xa.clientPath+"Maps.png"),J.call(c,g,xa.clientPath+"Maps.png"),J.call(c,f,xa.clientPath+"map-opacity.png"),J.call(c,x,xa.clientPath+"Bars.png"),J.call(c,w,xa.clientPath+"Bars.png"),J.call(c,m,xa.clientPath+"Bars.png"),J.call(c,k,xa.clientPath+"Bars.png"),J.call(c,y,xa.clientPath+"bar-opacity.png"),J.call(c,C,xa.clientPath+"AlphaBar.png"),J.call(c,I.find("div:first"),xa.clientPath+"preview-opacity.png")},0),v.find("td.Radio input").bind("click",aa),ma.quickList&&ma.quickList.length>0){var N="";for(i=0;i<ma.quickList.length;i++){"string"==(typeof ma.quickList[i]).toString().toLowerCase()&&(ma.quickList[i]=new n({hex:ma.quickList[i]}));var Q=ma.quickList[i].val("a"),K=ma.quickList[i].val("ahex");!e.alphaSupport&&K&&(K=K.substring(0,6)+"ff");var U=ma.quickList[i].val("hex");K||(K="00000000"),N+='<span class="QuickColor"'+(K&&' title="#'+K+'"'||"none")+' style="background-color:'+(U&&"#"+U||"")+";"+(U?"":"background-image:url("+xa.clientPath+"NoColor.png)")+(e.alphaSupport&&Q&&Q<255?";opacity:"+Math.precision(Q/255,4)+";filter:Alpha(opacity="+Math.precision(Q/2.55,4)+")":"")+'"> </span>'}J.call(c,O,xa.clientPath+"bar-opacity.png"),O.html(N),O.find(".QuickColor").click(ua)}V.call(c,u.color.mode),ma.active.bind(D),a.isFunction(da)&&ma.active.bind(da),ma.current.bind(ra),e.expandable?(c.icon=r.parents(".Icon:first"),H=c.icon.find(".Color:first").css({backgroundColor:A&&"#"+A||"transparent"}),R=c.icon.find(".Alpha:first"),J.call(c,R,xa.clientPath+"bar-opacity.png"),Z.call(c,R,Math.precision(100*(255-(null!=s?s.a:0))/255,4)),j=c.icon.find(".Image:first").css({backgroundImage:"url('"+xa.clientPath+xa.picker.file+"')"}).bind("click",na),e.bindToInput&&e.updateInputColor&&e.input.css({backgroundColor:A&&"#"+A||"transparent",color:null==s||s.v>75?"#000000":"#ffffff"}),F=v.find(".Move:first").bind("mousedown",sa),ma.active.bind(ia)):pa.call(c)},fa=function(){for(d.find("td.Radio input").unbind("click",aa),L.unbind("click",ea),B.unbind("click",la),S.unbind("click",ta),u.window.expandable&&(j.unbind("click",na),F.unbind("mousedown",sa),c.icon=null),
d.find(".QuickColor").unbind("click",ua),h=null,p=null,b=null,g=null,f=null,x=null,w=null,m=null,k=null,y=null,C=null,M.destroy(),M=null,T.destroy(),T=null,Y.destroy(),Y=null,X=null,L=null,S=null,B=null,O=null,va=null,ha=null,da=null,d.html(""),i=0;i<r.length;i++)r[i]==c&&r.splice(i,1)},xa=u.images,wa=u.localization,ma={active:new n("string"==(typeof u.color.active).toString().toLowerCase()?{ahex:!u.window.alphaSupport&&u.color.active?u.color.active.substring(0,6)+"ff":u.color.active}:{ahex:!u.window.alphaSupport&&u.color.active.val("ahex")?u.color.active.val("ahex").substring(0,6)+"ff":u.color.active.val("ahex")}),current:new n("string"==(typeof u.color.active).toString().toLowerCase()?{ahex:!u.window.alphaSupport&&u.color.active?u.color.active.substring(0,6)+"ff":u.color.active}:{ahex:!u.window.alphaSupport&&u.color.active.val("ahex")?u.color.active.val("ahex").substring(0,6)+"ff":u.color.active.val("ahex")}),quickList:u.color.quickList};a.extend(!0,c,{commitCallback:va,liveCallback:da,cancelCallback:ha,color:ma,show:pa,hide:ba,destroy:fa}),r.push(c),setTimeout(function(){ga.call(c)},0)})},a.fn.jPicker.defaults={window:{title:null,effects:{type:"slide",speed:{show:"slow",hide:"fast"}},position:{x:"screenCenter",y:"top"},expandable:!1,liveUpdate:!0,alphaSupport:!1,alphaPrecision:0,updateInputColor:!0},color:{mode:"h",active:new n({ahex:"#ffcc00ff"}),quickList:[new n({h:360,s:33,v:100}),new n({h:360,s:66,v:100}),new n({h:360,s:100,v:100}),new n({h:360,s:100,v:75}),new n({h:360,s:100,v:50}),new n({h:180,s:0,v:100}),new n({h:30,s:33,v:100}),new n({h:30,s:66,v:100}),new n({h:30,s:100,v:100}),new n({h:30,s:100,v:75}),new n({h:30,s:100,v:50}),new n({h:180,s:0,v:90}),new n({h:60,s:33,v:100}),new n({h:60,s:66,v:100}),new n({h:60,s:100,v:100}),new n({h:60,s:100,v:75}),new n({h:60,s:100,v:50}),new n({h:180,s:0,v:80}),new n({h:90,s:33,v:100}),new n({h:90,s:66,v:100}),new n({h:90,s:100,v:100}),new n({h:90,s:100,v:75}),new n({h:90,s:100,v:50}),new n({h:180,s:0,v:70}),new n({h:120,s:33,v:100}),new n({h:120,s:66,v:100}),new n({h:120,s:100,v:100}),new n({h:120,s:100,v:75}),new n({h:120,s:100,v:50}),new n({h:180,s:0,v:60}),new n({h:150,s:33,v:100}),new n({h:150,s:66,v:100}),new n({h:150,s:100,v:100}),new n({h:150,s:100,v:75}),new n({h:150,s:100,v:50}),new n({h:180,s:0,v:50}),new n({h:180,s:33,v:100}),new n({h:180,s:66,v:100}),new n({h:180,s:100,v:100}),new n({h:180,s:100,v:75}),new n({h:180,s:100,v:50}),new n({h:180,s:0,v:40}),new n({h:210,s:33,v:100}),new n({h:210,s:66,v:100}),new n({h:210,s:100,v:100}),new n({h:210,s:100,v:75}),new n({h:210,s:100,v:50}),new n({h:180,s:0,v:30}),new n({h:240,s:33,v:100}),new n({h:240,s:66,v:100}),new n({h:240,s:100,v:100}),new n({h:240,s:100,v:75}),new n({h:240,s:100,v:50}),new n({h:180,s:0,v:20}),new n({h:270,s:33,v:100}),new n({h:270,s:66,v:100}),new n({h:270,s:100,v:100}),new n({h:270,s:100,v:75}),new n({h:270,s:100,v:50}),new n({h:180,s:0,v:10}),new n({h:300,s:33,v:100}),new n({h:300,s:66,v:100}),new n({h:300,s:100,v:100}),new n({h:300,s:100,v:75}),new n({h:300,s:100,v:50}),new n({h:180,s:0,v:0}),new n({h:330,s:33,v:100}),new n({h:330,s:66,v:100}),new n({h:330,s:100,v:100}),new n({h:330,s:100,v:75}),new n({h:330,s:100,v:50}),new n]},images:{clientPath:"/jPicker/images/",colorMap:{width:256,height:256,arrow:{file:"mappoint.gif",width:15,height:15}},colorBar:{width:20,height:256,arrow:{file:"rangearrows.gif",width:20,height:7}},picker:{file:"picker.gif",width:25,height:24}},localization:{text:{title:"Drag Markers To Pick A Color",newColor:"new",currentColor:"current",ok:"OK",cancel:"Cancel"},tooltips:{colors:{newColor:"New Color - Press “OK” To Commit",currentColor:"Click To Revert To Original Color"},buttons:{ok:"Commit To This Color Selection",cancel:"Cancel And Revert To Original Color"},hue:{radio:"Set To “Hue” Color Mode",textbox:"Enter A “Hue” Value (0-360°)"},saturation:{radio:"Set To “Saturation” Color Mode",textbox:"Enter A “Saturation” Value (0-100%)"},value:{radio:"Set To “Value” Color Mode",textbox:"Enter A “Value” Value (0-100%)"},red:{radio:"Set To “Red” Color Mode",textbox:"Enter A “Red” Value (0-255)"},green:{radio:"Set To “Green” Color Mode",textbox:"Enter A “Green” Value (0-255)"},blue:{radio:"Set To “Blue” Color Mode",textbox:"Enter A “Blue” Value (0-255)"},alpha:{radio:"Set To “Alpha” Color Mode",textbox:"Enter A “Alpha” Value (0-100)"},hex:{textbox:"Enter A “Hex” Color Value (#000000-#ffffff)",alpha:"Enter A “Alpha” Value (#00-#ff)"}}}}})(jQuery,"1.1.6");
(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
(function(){function r(i,z,t){i=document.createElementNS(A.svg,i);if(Ba)for(var B in z)i.setAttribute(B,z[B]);else for(B in z){var W=z[B],w=i[B];if(w&&w.constructor==="SVGLength")w.baseVal.value=W;else i.setAttribute(B,W)}t&&t.appendChild(i);return i}var A={svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"};if(!window.console)window.console=new function(){this.log=function(){};this.dir=function(){}};$.jGraduate={Paint:function(i){i=i||{};this.alpha=isNaN(i.alpha)?100:i.alpha;if(i.copy){this.type=
i.copy.type;this.alpha=i.copy.alpha;this.radialGradient=this.linearGradient=this.solidColor=null;switch(this.type){case "solidColor":this.solidColor=i.copy.solidColor;break;case "linearGradient":this.linearGradient=i.copy.linearGradient.cloneNode(true);break;case "radialGradient":this.radialGradient=i.copy.radialGradient.cloneNode(true)}}else if(i.linearGradient){this.type="linearGradient";this.radialGradient=this.solidColor=null;this.linearGradient=i.linearGradient.cloneNode(true)}else if(i.radialGradient){this.type=
"radialGradient";this.linearGradient=this.solidColor=null;this.radialGradient=i.radialGradient.cloneNode(true)}else if(i.solidColor){this.type="solidColor";this.solidColor=i.solidColor}else{this.type="none";this.radialGradient=this.linearGradient=this.solidColor=null}}};jQuery.fn.jGraduateDefaults={paint:new $.jGraduate.Paint,window:{pickerTitle:"Drag markers to pick a paint"},images:{clientPath:"images/"},newstop:"inverse"};var Ba=navigator.userAgent.indexOf("Gecko/")>=0;jQuery.fn.jGraduate=function(i){var z=
arguments;return this.each(function(){function t(c,a,d,h,f){var l=f||r("stop",{"stop-color":a,"stop-opacity":d,offset:c},g);if(f){a=f.getAttribute("stop-color");d=f.getAttribute("stop-opacity");c=f.getAttribute("offset")}else g.appendChild(l);if(d===null)d=1;f=r("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:"url(#jGraduate_trans)",transform:"translate("+(10+c*j)+", 26)"},fa);var X=r("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",
fill:a,"fill-opacity":d,transform:"translate("+(10+c*j)+", 26)",stroke:"#000","stroke-width":1.5},fa);$(X).mousedown(function(M){B(this);R=F;N.mousemove(la).mouseup(W);S=ga.offset();M.preventDefault();return false}).data("stop",l).data("bg",f).dblclick(function(){$("div.jGraduate_LightBox").show();for(var M=this,I=+l.getAttribute("stop-opacity")||1,C=l.getAttribute("stop-color")||1,Y=(parseFloat(I)*255).toString(16);Y.length<2;)Y="0"+Y;a=C.substr(1)+Y;$("#"+b+"_jGraduate_stopPicker").css({left:100,
bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:o.images.clientPath},color:{active:a,alphaSupport:true}},function(Z){C=Z.val("hex")?"#"+Z.val("hex"):"none";I=Z.val("a")!==null?Z.val("a")/256:1;M.setAttribute("fill",C);M.setAttribute("fill-opacity",I);l.setAttribute("stop-color",C);l.setAttribute("stop-opacity",I);$("div.jGraduate_LightBox").hide();$("#"+b+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();
$("#"+b+"_jGraduate_stopPicker").hide()})});$(g).find("stop").each(function(){var M=$(this);if(+this.getAttribute("offset")>c){if(!a){var I=this.getAttribute("stop-color"),C=this.getAttribute("stop-opacity");l.setAttribute("stop-color",I);X.setAttribute("fill",I);l.setAttribute("stop-opacity",C===null?1:C);X.setAttribute("fill-opacity",C===null?1:C)}M.before(l);return false}});h&&B(X);return l}function B(c){F&&F.setAttribute("stroke","#000");c.setAttribute("stroke","blue");F=c;F.parentNode.appendChild(F)}
function W(){N.unbind("mousemove",la);if(O.getAttribute("display")!=="none"){O.setAttribute("display","none");var c=$(F),a=c.data("stop");c=c.data("bg");$([F,a,c]).remove()}R=null}function w(){var c=T?"rotate("+T+","+ha+","+ia+") ":"";J===1&&G===1?g.removeAttribute("gradientTransform"):g.setAttribute("gradientTransform",c+"translate("+-ha*(J-1)+","+-ia*(G-1)+") scale("+J+","+G+")")}function la(c){var a=c.pageX-S.left;c=c.pageY-S.top;a=a<10?10:a>j+10?j+10:a;var d="translate("+a+", 26)";if(c<-60||c>
130){O.setAttribute("display","block");O.setAttribute("transform",d)}else O.setAttribute("display","none");R.setAttribute("transform",d);$.data(R,"bg").setAttribute("transform",d);$.data(R,"stop").setAttribute("offset",(a-10)/j);var h=0;$(g).find("stop").each(function(){var f=this.getAttribute("offset"),l=$(this);if(f<h){l.prev().before(l);D=$(g).find("stop")}h=f})}var e=$(this),o=$.extend(true,{},jQuery.fn.jGraduateDefaults,i),b=e.attr("id"),s="#"+e.attr("id")+" ";if(s){var ma=function(){switch(e.paint.type){case "radialGradient":e.paint.linearGradient=
null;break;case "linearGradient":e.paint.radialGradient=null;break;case "solidColor":e.paint.radialGradient=e.paint.linearGradient=null}$.isFunction(e.okCallback)&&e.okCallback(e.paint);e.hide()},na=function(){$.isFunction(e.cancelCallback)&&e.cancelCallback();e.hide()};$.extend(true,e,{paint:new $.jGraduate.Paint({copy:o.paint}),okCallback:$.isFunction(z[1])&&z[1]||null,cancelCallback:$.isFunction(z[2])&&z[2]||null});e.position();var u=null,N=$(window);if(e.paint.type=="none")e.paint=$.jGraduate.Paint({solidColor:"ffffff"});
e.addClass("jGraduate_Picker");e.html('<ul class="jGraduate_tabs"><li class="jGraduate_tab_color jGraduate_tab_current" data-type="col">Solid Color</li><li class="jGraduate_tab_lingrad" data-type="lg">Linear Gradient</li><li class="jGraduate_tab_radgrad" data-type="rg">Radial Gradient</li></ul><div class="jGraduate_colPick"></div><div class="jGraduate_gradPick"></div><div class="jGraduate_LightBox"></div><div id="'+b+'_jGraduate_stopPicker" class="jGraduate_stopPicker"></div>');var Ca=$(s+"> .jGraduate_colPick"),
n=$(s+"> .jGraduate_gradPick");n.html('<div id="'+b+'_jGraduate_Swatch" class="jGraduate_Swatch"><h2 class="jGraduate_Title">'+o.window.pickerTitle+'</h2><div