gunnertechnology 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +4 -0
  3. data/README +0 -0
  4. data/Rakefile +2 -0
  5. data/gunnertechnology.gemspec +28 -0
  6. data/lib/generators/project/USAGE +8 -0
  7. data/lib/generators/project/project_generator.rb +61 -0
  8. data/lib/generators/project/templates/app/controllers/authentications_controller.rb +85 -0
  9. data/lib/generators/project/templates/app/models/authentication.rb +17 -0
  10. data/lib/generators/project/templates/app/views/layouts/application.html.erb +77 -0
  11. data/lib/generators/project/templates/app/views/shared/_facebook_init.html.erb +12 -0
  12. data/lib/generators/project/templates/app/views/shared/_flash_messages.html.erb +7 -0
  13. data/lib/generators/project/templates/app/views/shared/_footer.html.erb +15 -0
  14. data/lib/generators/project/templates/app/views/shared/_google_analytics.html.erb +11 -0
  15. data/lib/generators/project/templates/app/views/shared/_header.html.erb +23 -0
  16. data/lib/generators/project/templates/config/facebook_config.yml +29 -0
  17. data/lib/generators/project/templates/config/google_analytics_config.yml +8 -0
  18. data/lib/generators/project/templates/config/initializers/load_facebook_config.rb +2 -0
  19. data/lib/generators/project/templates/config/initializers/load_google_analytics_config.rb +2 -0
  20. data/lib/generators/project/templates/config/initializers/load_seo_config.rb +2 -0
  21. data/lib/generators/project/templates/config/initializers/omniauth.rb +91 -0
  22. data/lib/generators/project/templates/config/providers.yml +27 -0
  23. data/lib/generators/project/templates/config/seo_config.yml +8 -0
  24. data/lib/generators/project/templates/db/create_authentications.rb +21 -0
  25. data/lib/generators/project/templates/public/javascripts/libs/PIE.htc +73 -0
  26. data/lib/generators/project/templates/public/javascripts/libs/colorpicker.js +484 -0
  27. data/lib/generators/project/templates/public/javascripts/libs/dd_belatedpng.js +13 -0
  28. data/lib/generators/project/templates/public/javascripts/libs/eye.js +34 -0
  29. data/lib/generators/project/templates/public/javascripts/libs/head.js +8 -0
  30. data/lib/generators/project/templates/public/javascripts/libs/jquery.validationEngine-en.js +130 -0
  31. data/lib/generators/project/templates/public/javascripts/libs/jquery.validationEngine-es.js +124 -0
  32. data/lib/generators/project/templates/public/javascripts/libs/jquery.validationEngine-fr.js +119 -0
  33. data/lib/generators/project/templates/public/javascripts/libs/jquery.validationEngine-it.js +103 -0
  34. data/lib/generators/project/templates/public/javascripts/libs/jquery.validationEngine-pt.js +125 -0
  35. data/lib/generators/project/templates/public/javascripts/libs/jquery.validationEngine-ro.js +126 -0
  36. data/lib/generators/project/templates/public/javascripts/libs/jquery.validationEngine.js +1137 -0
  37. data/lib/generators/project/templates/public/javascripts/libs/layout.js +67 -0
  38. data/lib/generators/project/templates/public/javascripts/libs/modernizr-1.6.min.js +30 -0
  39. data/lib/generators/project/templates/public/javascripts/libs/utils.js +252 -0
  40. data/lib/generators/project/templates/public/javascripts/mylibs/.gitignore +3 -0
  41. data/lib/generators/project/templates/public/javascripts/plugins.js +38 -0
  42. data/lib/generators/project/templates/public/javascripts/profiling/config.js +59 -0
  43. data/lib/generators/project/templates/public/javascripts/profiling/yahoo-profiling.min.js +39 -0
  44. data/lib/generators/project/templates/public/javascripts/script.js +46 -0
  45. data/lib/generators/project/templates/public/stylesheets/grids/1008_24_10_10.css +201 -0
  46. data/lib/generators/project/templates/public/stylesheets/grids/fluid.css +320 -0
  47. data/lib/generators/project/templates/public/stylesheets/handheld.css +8 -0
  48. data/lib/generators/project/templates/public/stylesheets/profiling/yahoo-profiling.css +7 -0
  49. data/lib/generators/project/templates/public/stylesheets/reset.css +53 -0
  50. data/lib/generators/project/templates/public/stylesheets/text.css +84 -0
  51. data/lib/generators/project/templates/public/stylesheets/validationEngine.jquery.css +142 -0
  52. data/lib/generators/project/templates/public/swfs/charts.swf +0 -0
  53. data/lib/gunnertechnology/version.rb +3 -0
  54. data/lib/gunnertechnology.rb +47 -0
  55. metadata +206 -0
@@ -0,0 +1,73 @@
1
+ <!--
2
+ PIE: CSS3 rendering for IE
3
+ Version 1.0beta1
4
+ http://css3pie.com
5
+ Licensed for use under the Apache License, Version 2.0
6
+ -->
7
+ <PUBLIC:COMPONENT lightWeight="true">
8
+ <PUBLIC:ATTACH EVENT="onresize" FOR="element" ONEVENT="update()" />
9
+ <PUBLIC:ATTACH EVENT="onresize" FOR="window" ONEVENT="update()" /><!-- for IE8 -->
10
+ <PUBLIC:ATTACH EVENT="onmove" FOR="element" ONEVENT="update()" />
11
+ <PUBLIC:ATTACH EVENT="onpropertychange" FOR="element" ONEVENT="propChanged()" />
12
+ <PUBLIC:ATTACH EVENT="onmouseenter" FOR="element" ONEVENT="mouseEntered()" />
13
+ <PUBLIC:ATTACH EVENT="onmouseleave" FOR="element" ONEVENT="mouseLeft()" />
14
+ <PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="init()" />
15
+ <PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" />
16
+
17
+ <script type="text/javascript">
18
+ function j(){return function(){}}var C=window.PIE;
19
+ if(!C){C=window.PIE={T:"-pie-",Ha:"Pie",Fa:"pie_"};if(!window.XMLHttpRequest){C.Qb=true;C.T=C.T.replace(/^-/,"")}C.q={ja:function(a){var b=C.zb;if(!b){b=C.zb=element.document.createDocumentFragment();b.namespaces.add("css3vml","urn:schemas-microsoft-com:vml")}return b.createElement("css3vml:"+a)},Aa:function(a){var b,c,d,e,f=arguments;b=1;for(c=f.length;b<c;b++){e=f[b];for(d in e)if(e.hasOwnProperty(d))a[d]=e[d]}return a},ab:function(a,b,c){var d=C.tb||(C.tb={}),e=d[a],f;if(e)b.call(c,e);else{f=new Image;
20
+ f.onload=function(){e=d[a]={u:f.width,i:f.height};b.call(c,e);f.onload=null};f.src=a}}};C.g=function(){function a(b){this.F=b}a.prototype={Ba:/(px|em|ex|mm|cm|in|pt|pc|%)$/,Pa:function(){var b=this.ub;if(b===undefined)b=this.ub=parseFloat(this.F);return b},xa:function(){var b=this.sa;if(!b)b=this.sa=(b=this.F.match(this.Ba))&&b[0]||"px";return b},a:function(b,c){var d=this.Pa(),e=this.xa();switch(e){case "px":return d;case "%":return d*(typeof c==="function"?c():c)/100;case "em":return d*this.Oa(b);
21
+ case "ex":return d*this.Oa(b)/2;default:return d*a.Hb[e]}},Oa:function(b){var c=b.currentStyle.fontSize,d;if(c.indexOf("px")>0)return parseFloat(c);else{c=this.yb;if(!c){c=this.yb=b.document.createElement("length-calc");d=c.style;d.width="1em";d.position="absolute";d.top=d.left=-9999}b.appendChild(c);d=c.offsetWidth;b.removeChild(c);return d}}};a.Hb=function(){for(var b=["mm","cm","in","pt","pc"],c={},d=element.parentNode,e=0,f=b.length,g,h,i;e<f;e++){g=b[e];h=element.document.createElement("length-calc");
22
+ i=h.style;i.position="absolute";i.top=i.left=-9999;i.width="100"+g;d.appendChild(h);c[g]=h.offsetWidth/100;d.removeChild(h)}return c}();a.qb=new a("0");return a}();C.qa=function(){function a(b){this.C=b}a.prototype={Nb:function(){if(!this.Ka){var b=this.C,c=b.length,d=C.g.qb,e=new C.g("50%"),f=C.k.Y.V,g={top:1,center:1,bottom:1},h={left:1,center:1,right:1};d=["left",d,"top",d];if(c===1){b.push({type:f,value:"center"});c++}if(c===2){f&(b[0].type|b[1].type)&&b[0].value in g&&b[1].value in h&&b.push(b.shift());
23
+ if(b[0].type&f)if(b[0].value==="center")d[1]=e;else d[0]=b[0].value;else if(b[0].J())d[1]=new C.g(b[0].value);if(b[1].type&f)if(b[1].value==="center")d[3]=e;else d[2]=b[1].value;else if(b[1].J())d[3]=new C.g(b[1].value)}this.Ka=d}return this.Ka},coords:function(b,c,d){var e=this.Nb(),f=e[1].a(b,c);b=e[3].a(b,d);return{x:Math.round(e[0]==="right"?c-f:f),y:Math.round(e[2]==="bottom"?d-b:b)}}};return a}();C.bb=function(){function a(b){this.F=b}a.prototype={Ba:/[a-z]+$/i,xa:function(){return this.sa||
24
+ (this.sa=this.F.match(this.Ba)[0].toLowerCase())},Ib:function(){var b=this.sb,c;if(b===undefined){b=this.xa();c=parseFloat(this.F,10);b=this.sb=b==="deg"?c:b==="rad"?c/Math.PI*180:b==="grad"?c/400*360:b==="turn"?c*360:0}return b}};return a}();C.U=function(){function a(b){this.F=b}a.Xb=/\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/;a.prototype={parse:function(){if(!this.ga){var b=this.F,c=b.match(a.Xb);if(c){this.ga="rgb("+c[1]+","+c[2]+","+c[3]+")";this.Ja=parseFloat(c[4])}else{this.ga=
25
+ b;this.Ja=1}}},value:function(b){this.parse();return this.ga==="currentColor"?b.currentStyle.color:this.ga},La:function(){this.parse();return this.Ja}};return a}();C.k=function(){function a(c){this.ka=c;this.ch=0;this.C=[];this.da=0}var b=a.Y={ea:1,Ea:2,S:4,mb:8,Ga:16,V:32,o:64,W:128,X:256,fa:512,ob:1024,URL:2048};a.Ia=function(c,d){this.type=c;this.value=d};a.Ia.prototype={za:function(){return this.type&b.o||this.type&b.W&&this.value==="0"},J:function(){return this.za()||this.type&b.fa}};a.prototype=
26
+ {fc:/\s/,Sb:/^[\+\-]?(\d*\.)?\d+/,url:/^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i,Sa:/^\-?[_a-z][\w-]*/i,ac:/^("([^"]*)"|'([^']*)')/,Ob:/^#([\da-f]{6}|[\da-f]{3})/i,dc:{px:b.o,em:b.o,ex:b.o,mm:b.o,cm:b.o,"in":b.o,pt:b.o,pc:b.o,deg:b.ea,rad:b.ea,grad:b.ea},Eb:{aqua:1,black:1,blue:1,fuchsia:1,gray:1,green:1,lime:1,maroon:1,navy:1,olive:1,purple:1,red:1,silver:1,teal:1,white:1,yellow:1,currentColor:1},Db:{rgb:1,rgba:1,hsl:1,hsla:1},next:function(c){function d(n,p){n=new a.Ia(n,p);if(!c){k.C.push(n);
27
+ k.da++}return n}function e(){k.da++;return null}var f,g,h,i,k=this;if(this.da<this.C.length)return this.C[this.da++];for(;this.fc.test(this.ka.charAt(this.ch));)this.ch++;if(this.ch>=this.ka.length)return e();g=this.ch;f=this.ka.substring(this.ch);h=f.charAt(0);switch(h){case "#":if(i=f.match(this.Ob)){this.ch+=i[0].length;return d(b.S,i[0])}break;case '"':case "'":if(i=f.match(this.ac)){this.ch+=i[0].length;return d(b.ob,i[2]||i[3]||"")}break;case "/":case ",":this.ch++;return d(b.X,h);case "u":if(i=
28
+ f.match(this.url)){this.ch+=i[0].length;return d(b.URL,i[2]||i[3]||i[4]||"")}}if(i=f.match(this.Sb)){h=i[0];this.ch+=h.length;if(f.charAt(h.length)==="%"){this.ch++;return d(b.fa,h+"%")}if(i=f.substring(h.length).match(this.Sa)){h+=i[0];this.ch+=i[0].length;return d(this.dc[i[0].toLowerCase()]||b.mb,h)}return d(b.W,h)}if(i=f.match(this.Sa)){h=i[0];this.ch+=h.length;if(h.toLowerCase()in this.Eb)return d(b.S,h);if(f.charAt(h.length)==="("){this.ch++;if(h.toLowerCase()in this.Db){f=function(n){return n&&
29
+ n.type&b.W};i=function(n){return n&&n.type&(b.W|b.fa)};var o=function(n,p){return n&&n.value===p},l=function(){return k.next(1)};if((h.charAt(0)==="r"?i(l()):f(l()))&&o(l(),",")&&i(l())&&o(l(),",")&&i(l())&&(h==="rgb"||h==="hsa"||o(l(),",")&&f(l()))&&o(l(),")"))return d(b.S,this.ka.substring(g,this.ch));return e()}return d(b.Ga,h+"(")}return d(b.V,h)}this.ch++;return d(b.Ea,h)},n:function(){return this.C[this.da-- -2]},all:function(){for(;this.next(););return this.C},R:function(c,d){for(var e=[],
30
+ f,g;f=this.next();){if(c(f)){g=true;this.n();break}e.push(f)}return d&&!g?null:e}};return a}();C.w={M:function(a){function b(c){this.element=c}C.q.Aa(b.prototype,C.w,a);return b},f:function(){if(this.j())this.xb=this.N(this.rb=this.aa());return this.xb},aa:function(){var a=this.element,b=a.style;a=a.currentStyle;var c=this.$,d=this.ca,e=this.vb||(this.vb=C.T+c),f=this.wb||(this.wb=C.Ha+d.charAt(0).toUpperCase()+d.substring(1));return b[f]||a.getAttribute(e)||b[d]||a.getAttribute(c)},d:function(){return!!this.f()},
31
+ j:function(){return this.rb!==this.aa()}};C.db=C.w.M({$:C.T+"background",ca:C.Ha+"Background",Bb:{scroll:1,fixed:1,local:1},pa:{"repeat-x":1,"repeat-y":1,repeat:1,"no-repeat":1},Tb:{"padding-box":1,"border-box":1,"content-box":1},Cb:{"padding-box":1,"border-box":1},Wb:{top:1,right:1,bottom:1,left:1,center:1},Zb:{contain:1,cover:1},N:function(a){function b(q){return q.J()||q.type&i&&q.value in n}function c(q){return q.J()&&new C.g(q.value)||q.value==="auto"&&"auto"}var d=this.element.currentStyle,
32
+ e,f,g=C.k.Y,h=g.X,i=g.V,k=g.S,o,l,n=this.Wb,p,u,s=null;if(this.wa()){a=new C.k(a);s={images:[]};for(f={};e=a.next();){o=e.type;l=e.value;if(!f.type&&o&g.Ga&&l==="linear-gradient("){p={P:[],type:"linear-gradient"};for(u={};e=a.next();){o=e.type;l=e.value;if(o&g.Ea&&l===")"){u.color&&p.P.push(u);p.P.length>1&&C.q.Aa(f,p);break}if(o&k){if(p.ua||p.ya){e=a.n();if(e.type!==h)break;a.next()}u={color:new C.U(l)};e=a.next();if(e.J())u.Ta=new C.g(e.value);else a.n()}else if(o&g.ea&&!p.ua&&!u.color&&!p.P.length)p.ua=
33
+ new C.bb(e.value);else if(b(e)&&!p.ya&&!u.color&&!p.P.length){a.n();p.ya=new C.qa(a.R(function(q){return!b(q)},false))}else if(o&h&&l===","){if(u.color){p.P.push(u);u={}}}else break}}else if(!f.type&&o&g.URL){f.url=l;f.type="image"}else if(b(e)&&!f.size){a.n();f.position=new C.qa(a.R(function(q){return!b(q)},false))}else if(o&i)if(l in this.pa)f.repeat=l;else if(l in this.Tb){f.origin=l;if(l in this.Cb)f.clip=l}else{if(l in this.Bb)f.jc=l}else if(o&k&&!s.color)s.color=new C.U(l);else if(o&h)if(l===
34
+ "/"){e=a.next();o=e.type;l=e.value;if(o&i&&l in this.Zb)f.size=l;else if(l=c(e))f.size={u:l,i:c(a.next())||a.n()&&l}}else{if(l===","&&f.type){s.images.push(f);f={}}}else return null}f.type&&s.images.push(f)}else this.$a(function(){var q=d.backgroundPositionX,v=d.backgroundPositionY,m=d.backgroundImage,t=d.backgroundColor;s={};if(t!=="transparent")s.color=new C.U(t);if(m!=="none")s.images=[{type:"image",url:(new C.k(m)).next().value,repeat:d.backgroundRepeat,position:new C.qa((new C.k(q+" "+v)).all())}]});
35
+ return s},$a:function(a){var b=this.element.runtimeStyle,c=b.backgroundImage,d=b.backgroundColor;b.backgroundImage=b.backgroundColor="";a=a.call(this);b.backgroundImage=c;b.backgroundColor=d;return a},aa:function(){var a=this.element.currentStyle;return this.wa()||this.$a(function(){return a.backgroundColor+" "+a.backgroundImage+" "+a.backgroundRepeat+" "+a.backgroundPositionX+" "+a.backgroundPositionY})},wa:function(){var a=this.element;return a.style[this.ca]||a.currentStyle.getAttribute(this.$)},
36
+ d:function(){return this.wa()&&!!this.f()}});C.ib=C.w.M({Yb:["Top","Right","Bottom","Left"],Rb:{mc:"1px",kc:"3px",lc:"5px"},N:function(){var a={},b={},c={},d=this.element,e=d.currentStyle;d=d.runtimeStyle;var f=d.borderColor,g=0,h=false,i=true,k=true,o=true,l,n,p,u,s,q,v;for(d.borderColor="";g<4;g++){p=this.Yb[g];v=p.charAt(0).toLowerCase();l=b[v]=e["border"+p+"Style"];n=e["border"+p+"Color"];p=e["border"+p+"Width"];if(g>0){if(l!==u)k=false;if(n!==s)i=false;if(p!==q)o=false}u=l;s=n;q=p;c[v]=new C.U(n);
37
+ p=a[v]=new C.g(b[v]==="none"?"0":this.Rb[p]||p);if(p.a(this.element)>0)h=true}d.borderColor=f;return h?{Za:a,bc:b,Fb:c,gc:o,Gb:i,cc:k}:null},aa:function(){var a=this.element,b=a.currentStyle;a=a.runtimeStyle;var c=a.borderColor;a.borderColor="";b=b.borderWidth+"|"+b.borderStyle+"|"+b.borderColor;a.borderColor=c;return b}});C.gb=C.w.M({$:"border-radius",ca:"borderRadius",N:function(a){var b=null,c,d,e,f,g=false;if(a){d=new C.k(a);var h=function(){for(var i=[],k;(e=d.next())&&e.J();){f=new C.g(e.value);
38
+ k=f.Pa();if(k<0)return null;if(k>0)g=true;i.push(f)}return i.length>0&&i.length<5?{tl:i[0],tr:i[1]||i[0],br:i[2]||i[0],bl:i[3]||i[1]||i[0]}:null};if(a=h()){if(e){if(e.type&C.k.Y.X&&e.value==="/")c=h()}else c=a;if(g&&a&&c)b={x:a,y:c}}}return b}});C.fb=C.w.M({$:"border-image",ca:"borderImage",pa:{stretch:1,round:1,repeat:1,space:1},N:function(a){var b=null,c,d,e,f,g,h,i=0,k,o=C.k.Y,l=o.V,n=o.W,p=o.o,u=o.fa;if(a){c=new C.k(a);b={};for(var s=function(m){return m&&m.type&o.X&&m.value==="/"},q=function(m){return m&&
39
+ m.type&l&&m.value==="fill"},v=function(){f=c.R(function(m){return!(m.type&(n|u))});if(q(c.next())&&!b.fill)b.fill=true;else c.n();if(s(c.next())){i++;g=c.R(function(){return!(d.type&(n|u|p))&&!(d.type&l&&d.value==="auto")});if(s(c.next())){i++;h=c.R(function(){return!(d.type&(n|p))})}}else c.n()};d=c.next();){a=d.type;e=d.value;if(a&(n|u)&&!f){c.n();v()}else if(q(d)&&!b.fill){b.fill=true;v()}else if(a&l&&this.pa[e]&&!b.repeat){b.repeat={i:e};if(d=c.next())if(d.type&l&&this.pa[d.value])b.repeat.Ca=
40
+ d.value;else c.n()}else if(a&o.URL&&!b.src)b.src=e;else return null}if(!b.src||!f||f.length<1||f.length>4||g&&g.length>4||i===1&&g.length<1||h&&h.length>4||i===2&&h.length<1)return null;if(!b.repeat)b.repeat={i:"stretch"};if(!b.repeat.Ca)b.repeat.Ca=b.repeat.i;a=function(m,t){return{Q:t(m[0]),O:t(m[1]||m[0]),H:t(m[2]||m[0]),K:t(m[3]||m[1]||m[0])}};b.slice=a(f,function(m){return new C.g(m.type&n?m.value+"px":m.value)});b.width=g&&g.length>0?a(g,function(m){return m.type&(p|u)?new C.g(m.value):m.value}):
41
+ (k=this.element.currentStyle)&&{Q:new C.g(k.borderTopWidth),O:new C.g(k.borderRightWidth),H:new C.g(k.borderBottomWidth),K:new C.g(k.borderLeftWidth)};b.ba=a(h||[0],function(m){return m.type&p?new C.g(m.value):m.value})}return b}});C.lb=C.w.M({$:"box-shadow",ca:"boxShadow",N:function(a){var b,c=C.g,d=C.k.Y,e;if(a){e=new C.k(a);b={ba:[],oa:[]};for(a=function(){for(var f,g,h,i,k,o;f=e.next();){h=f.value;g=f.type;if(g&d.X&&h===",")break;else if(f.za()&&!k){e.n();k=e.R(function(l){return!l.za()})}else if(g&
42
+ d.S&&!i)i=h;else if(g&d.V&&h==="inset"&&!o)o=true;else return false}f=k&&k.length;if(f>1&&f<5){(o?b.oa:b.ba).push({hc:new c(k[0].value),ic:new c(k[1].value),blur:new c(k[2]?k[2].value:"0"),$b:new c(k[3]?k[3].value:"0"),color:new C.U(i||"currentColor")});return true}return false};a(););}return b&&(b.oa.length||b.ba.length)?b:null}});C.pb=C.w.M({aa:function(){var a=this.element.currentStyle;return a.visibility+"|"+a.display},N:function(){var a=this.element,b=a.runtimeStyle;a=a.currentStyle;var c=b.visibility,
43
+ d;b.visibility="";d=a.visibility;b.visibility=c;return{ec:d!=="hidden",Jb:a.display!=="none"}},d:function(){return false}});C.p={L:function(a){function b(c,d,e){this.element=c;this.e=d;this.parent=e}C.q.Aa(b.prototype,C.p,a);return b},B:function(){return false},D:j(),Wa:j(),s:j(),ta:function(a,b){this.Va(a);for(var c=this.Z||(this.Z=[]),d=a+1,e=c.length,f;d<e;d++)if(f=c[d])break;c[a]=b;this.m().insertBefore(b,f||null)},ma:function(a){var b=this.Z;return b&&b[a]||null},Va:function(a){var b=this.ma(a),
44
+ c=this.G;if(b&&c){c.removeChild(b);this.Z[a]=null}},na:function(a,b,c,d){var e=this.ra||(this.ra={}),f=e[a];if(!f){f=e[a]=C.q.ja("shape");if(b)f.appendChild(f[b]=C.q.ja(b));if(d){c=this.ma(d);if(!c){this.ta(d,this.element.document.createElement("group"+d));c=this.ma(d)}}c.appendChild(f);a=f.style;a.position="absolute";a.left=a.top=0;a.behavior="url(#default#VML)"}return f},va:function(a){var b=this.ra,c=b&&b[a];if(c){c.parentNode.removeChild(c);delete b[a]}return!!c},Qa:function(a){var b=this.element,
45
+ c=b.offsetWidth,d=b.offsetHeight,e,f,g,h,i,k,o;e=a.x.tl.a(b,c);f=a.y.tl.a(b,d);g=a.x.tr.a(b,c);h=a.y.tr.a(b,d);i=a.x.br.a(b,c);k=a.y.br.a(b,d);o=a.x.bl.a(b,c);a=a.y.bl.a(b,d);c=Math.min(c/(e+g),d/(h+k),c/(o+i),d/(f+a));if(c<1){e*=c;f*=c;g*=c;h*=c;i*=c;k*=c;o*=c;a*=c}return{x:{tl:e,tr:g,br:i,bl:o},y:{tl:f,tr:h,br:k,bl:a}}},la:function(a,b){b=b||1;var c,d,e=this.element;d=e.offsetWidth*b;e=e.offsetHeight*b;var f=this.e.v,g=Math.floor,h=Math.ceil,i=a?a.Q*b:0,k=a?a.O*b:0,o=a?a.H*b:0;a=a?a.K*b:0;var l,
46
+ n,p,u,s,q;if(f.d()){c=this.Qa(f.f());f=c.x.tl*b;l=c.y.tl*b;n=c.x.tr*b;p=c.y.tr*b;u=c.x.br*b;s=c.y.br*b;q=c.x.bl*b;b=c.y.bl*b;d="m"+g(a)+","+g(l)+"qy"+g(f)+","+g(i)+"l"+h(d-n)+","+g(i)+"qx"+h(d-k)+","+g(p)+"l"+h(d-k)+","+h(e-s)+"qy"+h(d-u)+","+h(e-o)+"l"+g(q)+","+h(e-o)+"qx"+g(a)+","+h(e-b)+" x e"}else d="m"+g(a)+","+g(i)+"l"+h(d-k)+","+g(i)+"l"+h(d-k)+","+h(e-o)+"l"+g(a)+","+h(e-o)+"xe";return d},m:function(){var a=this.parent.ma(this.zIndex),b;if(!a){a=this.element.document.createElement(this.ia);
47
+ b=a.style;b.position="absolute";b.top=b.left=0;this.parent.ta(this.zIndex,a)}return a},h:function(){this.parent.Va(this.zIndex);delete this.ra;delete this.Z}};C.nb=C.p.L({d:function(){var a=this.e;for(var b in a)if(a.hasOwnProperty(b)&&a[b].d())return true;return false},B:function(){return this.e.Ya.j()},Wa:function(){if(this.d()){var a=this.element,b=a,c,d,e=this.m().style,f=0;c=0;do b=b.offsetParent;while(b&&b.currentStyle.position==="static");c=a.getBoundingClientRect();if(b){d=b.getBoundingClientRect();
48
+ b=b.currentStyle;f=c.left-d.left-(parseFloat(b.borderLeftWidth)||0);c=c.top-d.top-(parseFloat(b.borderTopWidth)||0)}else{b=a.document.documentElement;f=c.left+b.scrollLeft-b.clientLeft;c=c.top+b.scrollTop-b.clientTop}e.left=f;e.top=c;e.zIndex=a.currentStyle.position==="static"?-1:a.currentStyle.zIndex}},s:function(){if(this.d()){var a=this.element,b=this.m().style;b.width=a.offsetWidth;b.height=a.offsetHeight}},Xa:function(){var a=this.e.Ya.f();this.m().style.display=a.ec&&a.Jb?"":"none"},D:function(){this.d()?
49
+ this.Xa():this.h()},m:function(){var a=this.G,b,c;if(!a){b=this.element;a=this.G=b.document.createElement("css3-container");c=a.style;c.position=b.currentStyle.position==="fixed"?"fixed":"absolute";this.Xa();b.parentNode.insertBefore(a,b)}return a},h:function(){var a=this.G;a&&a.parentNode&&a.parentNode.removeChild(a);delete this.G;delete this.Z}});C.cb=C.p.L({zIndex:2,ia:"background",B:function(){var a=this.e;return a.I.j()||a.v.j()},d:function(){var a=this.e;return a.z.d()||a.v.d()||a.I.d()||a.A.d()&&
50
+ a.A.f().oa},s:function(){this.d()&&this.Ma()},D:function(){this.h();this.d()&&this.Ma()},Ma:function(){this.Kb();this.Lb()},Kb:function(){var a=this.e.I.f(),b=this.element,c=a&&a.color&&a.color.value(b),d,e,f;if(c&&c!=="transparent"){this.Ra();d=this.na("bgColor","fill",this.m(),1);e=b.offsetWidth;b=b.offsetHeight;d.stroked=false;d.coordsize=e*2+","+b*2;d.coordorigin="1,1";d.path=this.la(null,2);f=d.style;f.width=e;f.height=b;d.fill.color=c;a=a.color.La();if(a<1)d.fill.opacity=a}else this.va("bgColor")},
51
+ Lb:function(){var a=this.e.I.f();a=a&&a.images;var b,c,d,e,f,g;if(a){this.Ra();b=this.element;d=b.offsetWidth;e=b.offsetHeight;for(g=a.length;g--;){b=a[g];c=this.na("bgImage"+g,"fill",this.m(),2);c.stroked=false;c.fill.type="tile";c.fillcolor="none";c.coordsize=d*2+","+e*2;c.coordorigin="1,1";c.path=this.la(0,2);f=c.style;f.width=d;f.height=e;if(b.type==="linear-gradient")this.Ab(c,b);else{c.fill.src=b.url;this.Vb(c,g)}}}for(g=a?a.length:0;this.va("bgImage"+g++););},Vb:function(a,b){C.q.ab(a.fill.src,
52
+ function(c){var d=a.fill,e=this.element,f=e.offsetWidth,g=e.offsetHeight,h=this.e,i=h.ha.f(),k=i&&i.Za;i=k?k.t.a(e):0;var o=k?k.r.a(e):0,l=k?k.b.a(e):0;k=k?k.l.a(e):0;h=h.I.f().images[b];e=h.position?h.position.coords(e,f-c.u-k-o,g-c.i-i-l):{x:0,y:0};h=h.repeat;o=0;l=f;var n=g,p=0;k=e.x+k+0.5;i=e.y+i+0.5;d.position=k/f+","+i/g;if(h&&h!=="repeat"){if(h==="repeat-x"||h==="no-repeat"){o=i+1;n=i+c.i+1}if(h==="repeat-y"||h==="no-repeat"){p=k+1;l=k+c.u+1}a.style.clip="rect("+o+"px,"+l+"px,"+n+"px,"+p+"px)"}},
53
+ this)},Ab:function(a,b){function c(x,y,w,D,H){if(w===0||w===180)return[D,y];else if(w===90||w===270)return[x,H];else{w=Math.tan(-w*l/180);x=w*x-y;y=-1/w;D=y*D-H;H=y-w;return[(D-x)/H,(w*D-y*x)/H]}}function d(){q=i>=90&&i<270?g:0;v=i<180?h:0;m=g-q;t=h-v}function e(x,y){var w=y[0]-x[0];x=y[1]-x[1];return Math.abs(w===0?x:x===0?w:Math.sqrt(w*w+x*x))}var f=this.element,g=f.offsetWidth,h=f.offsetHeight;a=a.fill;var i=b.ua,k=b.ya;b=b.P;var o=b.length,l=Math.PI,n,p,u,s,q,v,m,t,r,A,B,z;if(k){k=k.coords(f,
54
+ g,h);n=k.x;p=k.y}if(i){i=i.Ib();if(i<0)i+=360;i%=360;d();if(!k){n=q;p=v}k=c(n,p,i,m,t);u=k[0];s=k[1]}else if(k){u=g-n;s=h-p}else{n=p=u=0;s=h}k=u-n;r=s-p;if(i===undefined){i=-Math.atan2(r,k)/l*180;if(i<0)i+=360;i%=360;d()}k=Math.atan2(k*g/h,r)/l*180;k+=180;k%=360;A=e([n,p],[u,s]);u=e([q,v],c(q,v,i,m,t));s=[];p=e([n,p],c(n,p,i,q,v))/u*100;n=[];for(r=0;r<o;r++)n.push(b[r].Ta?b[r].Ta.a(f,A):r===0?0:r===o-1?A:null);for(r=1;r<o;r++){if(n[r]===null){B=n[r-1];A=r;do z=n[++A];while(z===null);n[r]=B+(z-B)/
55
+ (A-r+1)}n[r]=Math.max(n[r],n[r-1])}for(r=0;r<o;r++)s.push(p+n[r]/u*100+"% "+b[r].color.value(f));a.angle=k;a.type="gradient";a.method="sigma";a.color=b[0].color.value(f);a.color2=b[o-1].color.value(f);a.colors.value=s.join(",")},Ra:function(){var a=this.element.runtimeStyle;a.backgroundImage="none";a.backgroundColor="transparent"},h:function(){C.p.h.call(this);var a=this.element.runtimeStyle;a.backgroundImage=a.backgroundColor=""}});C.hb=C.p.L({zIndex:4,ia:"border",B:function(){var a=this.e;return a.ha.j()||
56
+ a.v.j()},d:function(){var a=this.e;return a.z.d()||a.v.d()||a.I.d()},s:function(){this.d()&&this.Na()},D:function(){this.h();this.d()&&this.Na()},Na:function(){var a=this.element,b=a.offsetWidth,c=a.offsetHeight,d,e,f,g,h,i;if(this.e.ha.f()){this.Pb();f=this.Mb(2);h=0;for(i=f.length;h<i;h++){g=f[h];d=this.na("borderPiece"+h,g.stroke?"stroke":"fill",this.m());d.coordsize=b*2+","+c*2;d.coordorigin="1,1";d.path=g.path;e=d.style;e.width=b;e.height=c;d.filled=!!g.fill;d.stroked=!!g.stroke;if(g.stroke){d=
57
+ d.stroke;d.weight=g.Da+"px";d.color=g.color.value(a);d.dashstyle=g.stroke==="dashed"?"2 2":g.stroke==="dotted"?"1 1":"solid";d.linestyle=g.stroke==="double"&&g.Da>2?"ThinThin":"Single"}else d.fill.color=g.fill.value(a)}for(;this.va("borderPiece"+h++););}},Pb:function(){var a=this.element,b=a.runtimeStyle;if(C.Qb){if(a.childNodes.length!==1||a.firstChild.tagName!=="ie6-mask"){var c=a.document.createElement("ie6-mask"),d=c.style;d.visibility="visible";for(d.zoom=1;d=a.firstChild;)c.appendChild(d);a.appendChild(c);
58
+ b.visibility="hidden"}}else b.borderColor="transparent"},Mb:function(a){var b=this.element,c,d,e=this.e.ha,f=[],g,h,i,k,o,l,n,p;if(e.d()){e=e.f();l=e.Za;n=e.bc;p=e.Fb;if(e.gc&&e.cc&&e.Gb){e=l.t.a(b);i=e/2;f.push({path:this.la({Q:i,O:i,H:i,K:i},a),stroke:n.t,color:p.t,Da:e})}else{a=a||1;c=b.offsetWidth;d=b.offsetHeight;e=l.t.a(b);i=l.r.a(b);k=l.b.a(b);b=l.l.a(b);var u={t:e,r:i,b:k,l:b};b=this.e.v;if(b.d())o=this.Qa(b.f());g=Math.floor;h=Math.ceil;var s=function(m,t){return o?o[m][t]:0},q=function(m,
59
+ t,r,A,B,z){var x=s("x",m),y=s("y",m),w=m.charAt(1)==="r";m=m.charAt(0)==="b";return x>0&&y>0?(z?"al":"ae")+(w?h(c-x):g(x))*a+","+(m?h(d-y):g(y))*a+","+(g(x)-t)*a+","+(g(y)-r)*a+","+A*65535+","+2949075*(B?1:-1):(z?"m":"l")+(w?c-t:t)*a+","+(m?d-r:r)*a},v=function(m,t,r,A){var B=m==="t"?g(s("x","tl"))*a+","+h(t)*a:m==="r"?h(c-t)*a+","+g(s("y","tr"))*a:m==="b"?h(c-s("x","br"))*a+","+g(d-t)*a:g(t)*a+","+h(d-s("y","bl"))*a;m=m==="t"?h(c-s("x","tr"))*a+","+h(t)*a:m==="r"?h(c-t)*a+","+h(d-s("y","br"))*a:
60
+ m==="b"?g(s("x","bl"))*a+","+g(d-t)*a:g(t)*a+","+g(s("y","tl"))*a;return r?(A?"m"+m:"")+"l"+B:(A?"m"+B:"")+"l"+m};b=function(m,t,r,A,B,z){var x=m==="l"||m==="r",y=u[m],w,D;if(y>0&&n[m]!=="none"){w=u[x?m:t];t=u[x?t:m];D=u[x?m:r];r=u[x?r:m];if(n[m]==="dashed"||n[m]==="dotted"){f.push({path:q(A,w,t,z+45,0,1)+q(A,0,0,z,1,0),fill:p[m]});f.push({path:v(m,y/2,0,1),stroke:n[m],Da:y,color:p[m]});f.push({path:q(B,D,r,z,0,1)+q(B,0,0,z-45,1,0),fill:p[m]})}else f.push({path:q(A,w,t,z+45,0,1)+v(m,y,0,0)+q(B,D,
61
+ r,z,0,0)+(n[m]==="double"&&y>2?q(B,D-g(D/3),r-g(r/3),z-45,1,0)+v(m,h(y/3*2),1,0)+q(A,w-g(w/3),t-g(t/3),z,1,0)+"x "+q(A,g(w/3),g(t/3),z+45,0,1)+v(m,g(y/3),1,0)+q(B,g(D/3),g(r/3),z,0,0):"")+q(B,0,0,z-45,1,0)+v(m,0,1,0)+q(A,0,0,z,1,0),fill:p[m]})}};b("t","l","r","tl","tr",90);b("r","t","b","tr","br",0);b("b","r","l","br","bl",-90);b("l","b","t","bl","tl",-180)}}return f},h:function(){C.p.h.call(this);this.element.runtimeStyle.borderColor=""}});C.eb=C.p.L({zIndex:5,Ub:["t","tr","r","br","b","bl","l",
62
+ "tl","c"],B:function(){var a=this.e;return a.z.j()||a.z.j()},d:function(){return this.e.z.d()},s:function(){if(this.d()){var a=this.e.z.f();this.m();var b=this.element,c=this.Ua;C.q.ab(a.src,function(d){function e(q,v,m,t,r){q=c[q].style;q.width=v;q.height=m;q.left=t;q.top=r}function f(q,v,m){for(var t=0,r=q.length;t<r;t++)c[q[t]].imagedata[v]=m}var g=b.offsetWidth,h=b.offsetHeight,i=a.width,k=i.Q.a(b),o=i.O.a(b),l=i.H.a(b);i=i.K.a(b);var n=a.slice,p=n.Q.a(b),u=n.O.a(b),s=n.H.a(b);n=n.K.a(b);e("tl",
63
+ i,k,0,0);e("t",g-i-o,k,i,0);e("tr",o,k,g-o,0);e("r",o,h-k-l,g-o,k);e("br",o,l,g-o,h-l);e("b",g-i-o,l,i,h-l);e("bl",i,l,0,h-l);e("l",i,h-k-l,0,k);e("c",g-i-o,h-k-l,i,k);f(["tl","t","tr"],"cropBottom",(d.i-p)/d.i);f(["tl","l","bl"],"cropRight",(d.u-n)/d.u);f(["bl","b","br"],"cropTop",(d.i-s)/d.i);f(["tr","r","br"],"cropLeft",(d.u-u)/d.u);if(a.repeat.Ca==="stretch"){f(["l","r","c"],"cropTop",p/d.i);f(["l","r","c"],"cropBottom",s/d.i)}if(a.repeat.i==="stretch"){f(["t","b","c"],"cropLeft",n/d.u);f(["t",
64
+ "b","c"],"cropRight",u/d.u)}c.c.style.display=a.fill?"":"none"},this)}else this.h()},D:function(){this.h();this.d()&&this.s()},m:function(){var a=this.G,b,c,d,e=this.Ub,f=e.length;if(!a){a=this.G=this.element.document.createElement("border-image");b=a.style;b.position="absolute";this.Ua={};for(d=0;d<f;d++){c=this.Ua[e[d]]=C.q.ja("rect");c.appendChild(C.q.ja("imagedata"));b=c.style;b.behavior="url(#default#VML)";b.position="absolute";b.top=b.left=0;c.imagedata.src=this.e.z.f().src;c.stroked=false;
65
+ c.filled=false;a.appendChild(c)}this.parent.ta(this.zIndex,a)}return a}});C.kb=C.p.L({zIndex:1,ia:"outset-box-shadow",B:function(){var a=this.e;return a.A.j()||a.v.j()},d:function(){var a=this.e.A;return a.d()&&a.f().ba[0]},s:function(){if(this.d())for(var a=this.element,b=this.e.A.f().ba,c=b.length,d=a.offsetWidth,e=a.offsetHeight,f,g,h,i,k,o,l,n;c--;){f=b[c];g=this.na("shadow"+c,"fill",this.m());h=g.style;i=f.hc.a(a);k=f.ic.a(a);o=f.$b.a(a);l=f.blur.a(a);n=Math.ceil(l/2);l=n*2;if(l>0){n="progid:DXImageTransform.Microsoft.blur(pixelRadius="+
66
+ n+")";h.filter=n+" "+n}h.left=i-l;h.top=k-l;h.width=d;h.height=e;g.stroked=false;g.filled=true;g.fillcolor=f.color.value(a);f=f.color.La();if(f<1)g.fill.opacity=f;l=l>0?4:0;g.coordsize=d*2+l+","+(e*2+l);g.coordorigin="1,1";g.path=this.la(o?{Q:-o,O:-o,H:-o,K:-o}:0,2)}else this.h()},D:function(){this.h();this.s()}});C.jb=C.p.L({zIndex:3,ia:"inset-box-shadow",B:function(){var a=this.e;return a.A.j()||a.v.j()},d:function(){var a=this.e.A;return a.d()&&a.f().oa[0]},s:j(),D:j()})}var E,F,G,I,J,K,L;
67
+ function update(){init();var a=element.getBoundingClientRect(),b=a.left,c=a.top,d=a.right-b;a=a.bottom-c;var e,f;if(b!==G||c!==I){e=0;for(f=J.length;e<f;e++)J[e].Wa();G=b;I=c}if(d!==E||a!==F){e=0;for(f=J.length;e<f;e++)J[e].s();E=d;F=a}}function propChanged(){init();var a,b,c=[];a=0;for(b=J.length;a<b;a++)J[a].B()&&c.push(J[a]);a=0;for(b=c.length;a<b;a++)c[a].D()}function mouseEntered(){event.srcElement.className+=" "+C.Fa+"hover";setTimeout(propChanged,0)}
68
+ function mouseLeft(){var a=event.srcElement;a.className=a.className.replace(new RegExp("\\b"+C.Fa+"hover\\b","g"),"");setTimeout(propChanged,0)}function M(){var a=event.propertyName;if(a==="className"||a==="id")propChanged()}function cleanup(){var a,b;if(J){a=0;for(b=J.length;a<b;a++)J[a].h();J=null}K=null;if(L){a=0;for(b=L.length;a<b;a++){L[a].detachEvent("onpropertychange",M);L[a].detachEvent("onmouseenter",mouseEntered);L[a].detachEvent("onmouseleave",mouseLeft)}L=null}}
69
+ function init(){if(!J){var a=element;a.runtimeStyle.zoom=1;K={I:new C.db(a),ha:new C.ib(a),z:new C.fb(a),v:new C.gb(a),A:new C.lb(a),Ya:new C.pb(a)};var b=new C.nb(a,K);J=[b,new C.kb(a,K,b),new C.cb(a,K,b),new C.jb(a,K,b),new C.hb(a,K,b),new C.eb(a,K,b)];var c=element;if(a=c.currentStyle.getAttribute(C.T+"watch-ancestors")){L=[];a=parseInt(a,10);b=0;for(c=c.parentNode;c&&(a==="NaN"||b++<a);){L.push(c);c.attachEvent("onpropertychange",M);c.attachEvent("onmouseenter",mouseEntered);c.attachEvent("onmouseleave",
70
+ mouseLeft);c=c.parentNode}}update()}}element.readyState==="complete"&&init();
71
+ </script>
72
+
73
+ </PUBLIC:COMPONENT>
@@ -0,0 +1,484 @@
1
+ /**
2
+ *
3
+ * Color picker
4
+ * Author: Stefan Petre www.eyecon.ro
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses
7
+ *
8
+ */
9
+ (function ($) {
10
+ var ColorPicker = function () {
11
+ var
12
+ ids = {},
13
+ inAction,
14
+ charMin = 65,
15
+ visible,
16
+ tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
17
+ defaults = {
18
+ eventName: 'click',
19
+ onShow: function () {},
20
+ onBeforeShow: function(){},
21
+ onHide: function () {},
22
+ onChange: function () {},
23
+ onSubmit: function () {},
24
+ color: 'ff0000',
25
+ livePreview: true,
26
+ flat: false
27
+ },
28
+ fillRGBFields = function (hsb, cal) {
29
+ var rgb = HSBToRGB(hsb);
30
+ $(cal).data('colorpicker').fields
31
+ .eq(1).val(rgb.r).end()
32
+ .eq(2).val(rgb.g).end()
33
+ .eq(3).val(rgb.b).end();
34
+ },
35
+ fillHSBFields = function (hsb, cal) {
36
+ $(cal).data('colorpicker').fields
37
+ .eq(4).val(hsb.h).end()
38
+ .eq(5).val(hsb.s).end()
39
+ .eq(6).val(hsb.b).end();
40
+ },
41
+ fillHexFields = function (hsb, cal) {
42
+ $(cal).data('colorpicker').fields
43
+ .eq(0).val(HSBToHex(hsb)).end();
44
+ },
45
+ setSelector = function (hsb, cal) {
46
+ $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
47
+ $(cal).data('colorpicker').selectorIndic.css({
48
+ left: parseInt(150 * hsb.s/100, 10),
49
+ top: parseInt(150 * (100-hsb.b)/100, 10)
50
+ });
51
+ },
52
+ setHue = function (hsb, cal) {
53
+ $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
54
+ },
55
+ setCurrentColor = function (hsb, cal) {
56
+ $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
57
+ },
58
+ setNewColor = function (hsb, cal) {
59
+ $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
60
+ },
61
+ keyDown = function (ev) {
62
+ var pressedKey = ev.charCode || ev.keyCode || -1;
63
+ if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
64
+ return false;
65
+ }
66
+ var cal = $(this).parent().parent();
67
+ if (cal.data('colorpicker').livePreview === true) {
68
+ change.apply(this);
69
+ }
70
+ },
71
+ change = function (ev) {
72
+ var cal = $(this).parent().parent(), col;
73
+ if (this.parentNode.className.indexOf('_hex') > 0) {
74
+ cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
75
+ } else if (this.parentNode.className.indexOf('_hsb') > 0) {
76
+ cal.data('colorpicker').color = col = fixHSB({
77
+ h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
78
+ s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
79
+ b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
80
+ });
81
+ } else {
82
+ cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
83
+ r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
84
+ g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
85
+ b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
86
+ }));
87
+ }
88
+ if (ev) {
89
+ fillRGBFields(col, cal.get(0));
90
+ fillHexFields(col, cal.get(0));
91
+ fillHSBFields(col, cal.get(0));
92
+ }
93
+ setSelector(col, cal.get(0));
94
+ setHue(col, cal.get(0));
95
+ setNewColor(col, cal.get(0));
96
+ cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
97
+ },
98
+ blur = function (ev) {
99
+ var cal = $(this).parent().parent();
100
+ cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
101
+ },
102
+ focus = function () {
103
+ charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
104
+ $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
105
+ $(this).parent().addClass('colorpicker_focus');
106
+ },
107
+ downIncrement = function (ev) {
108
+ var field = $(this).parent().find('input').focus();
109
+ var current = {
110
+ el: $(this).parent().addClass('colorpicker_slider'),
111
+ max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
112
+ y: ev.pageY,
113
+ field: field,
114
+ val: parseInt(field.val(), 10),
115
+ preview: $(this).parent().parent().data('colorpicker').livePreview
116
+ };
117
+ $(document).bind('mouseup', current, upIncrement);
118
+ $(document).bind('mousemove', current, moveIncrement);
119
+ },
120
+ moveIncrement = function (ev) {
121
+ ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
122
+ if (ev.data.preview) {
123
+ change.apply(ev.data.field.get(0), [true]);
124
+ }
125
+ return false;
126
+ },
127
+ upIncrement = function (ev) {
128
+ change.apply(ev.data.field.get(0), [true]);
129
+ ev.data.el.removeClass('colorpicker_slider').find('input').focus();
130
+ $(document).unbind('mouseup', upIncrement);
131
+ $(document).unbind('mousemove', moveIncrement);
132
+ return false;
133
+ },
134
+ downHue = function (ev) {
135
+ var current = {
136
+ cal: $(this).parent(),
137
+ y: $(this).offset().top
138
+ };
139
+ current.preview = current.cal.data('colorpicker').livePreview;
140
+ $(document).bind('mouseup', current, upHue);
141
+ $(document).bind('mousemove', current, moveHue);
142
+ },
143
+ moveHue = function (ev) {
144
+ change.apply(
145
+ ev.data.cal.data('colorpicker')
146
+ .fields
147
+ .eq(4)
148
+ .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
149
+ .get(0),
150
+ [ev.data.preview]
151
+ );
152
+ return false;
153
+ },
154
+ upHue = function (ev) {
155
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
156
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
157
+ $(document).unbind('mouseup', upHue);
158
+ $(document).unbind('mousemove', moveHue);
159
+ return false;
160
+ },
161
+ downSelector = function (ev) {
162
+ var current = {
163
+ cal: $(this).parent(),
164
+ pos: $(this).offset()
165
+ };
166
+ current.preview = current.cal.data('colorpicker').livePreview;
167
+ $(document).bind('mouseup', current, upSelector);
168
+ $(document).bind('mousemove', current, moveSelector);
169
+ },
170
+ moveSelector = function (ev) {
171
+ change.apply(
172
+ ev.data.cal.data('colorpicker')
173
+ .fields
174
+ .eq(6)
175
+ .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
176
+ .end()
177
+ .eq(5)
178
+ .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
179
+ .get(0),
180
+ [ev.data.preview]
181
+ );
182
+ return false;
183
+ },
184
+ upSelector = function (ev) {
185
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
186
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
187
+ $(document).unbind('mouseup', upSelector);
188
+ $(document).unbind('mousemove', moveSelector);
189
+ return false;
190
+ },
191
+ enterSubmit = function (ev) {
192
+ $(this).addClass('colorpicker_focus');
193
+ },
194
+ leaveSubmit = function (ev) {
195
+ $(this).removeClass('colorpicker_focus');
196
+ },
197
+ clickSubmit = function (ev) {
198
+ var cal = $(this).parent();
199
+ var col = cal.data('colorpicker').color;
200
+ cal.data('colorpicker').origColor = col;
201
+ setCurrentColor(col, cal.get(0));
202
+ cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
203
+ },
204
+ show = function (ev) {
205
+ var cal = $('#' + $(this).data('colorpickerId'));
206
+ cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
207
+ var pos = $(this).offset();
208
+ var viewPort = getViewport();
209
+ var top = pos.top + this.offsetHeight;
210
+ var left = pos.left;
211
+ if (top + 176 > viewPort.t + viewPort.h) {
212
+ top -= this.offsetHeight + 176;
213
+ }
214
+ if (left + 356 > viewPort.l + viewPort.w) {
215
+ left -= 356;
216
+ }
217
+ cal.css({left: left + 'px', top: top + 'px'});
218
+ if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
219
+ cal.show();
220
+ }
221
+ $(document).bind('mousedown', {cal: cal}, hide);
222
+ return false;
223
+ },
224
+ hide = function (ev) {
225
+ if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
226
+ if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
227
+ ev.data.cal.hide();
228
+ }
229
+ $(document).unbind('mousedown', hide);
230
+ }
231
+ },
232
+ isChildOf = function(parentEl, el, container) {
233
+ if (parentEl == el) {
234
+ return true;
235
+ }
236
+ if (parentEl.contains) {
237
+ return parentEl.contains(el);
238
+ }
239
+ if ( parentEl.compareDocumentPosition ) {
240
+ return !!(parentEl.compareDocumentPosition(el) & 16);
241
+ }
242
+ var prEl = el.parentNode;
243
+ while(prEl && prEl != container) {
244
+ if (prEl == parentEl)
245
+ return true;
246
+ prEl = prEl.parentNode;
247
+ }
248
+ return false;
249
+ },
250
+ getViewport = function () {
251
+ var m = document.compatMode == 'CSS1Compat';
252
+ return {
253
+ l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
254
+ t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
255
+ w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
256
+ h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
257
+ };
258
+ },
259
+ fixHSB = function (hsb) {
260
+ return {
261
+ h: Math.min(360, Math.max(0, hsb.h)),
262
+ s: Math.min(100, Math.max(0, hsb.s)),
263
+ b: Math.min(100, Math.max(0, hsb.b))
264
+ };
265
+ },
266
+ fixRGB = function (rgb) {
267
+ return {
268
+ r: Math.min(255, Math.max(0, rgb.r)),
269
+ g: Math.min(255, Math.max(0, rgb.g)),
270
+ b: Math.min(255, Math.max(0, rgb.b))
271
+ };
272
+ },
273
+ fixHex = function (hex) {
274
+ var len = 6 - hex.length;
275
+ if (len > 0) {
276
+ var o = [];
277
+ for (var i=0; i<len; i++) {
278
+ o.push('0');
279
+ }
280
+ o.push(hex);
281
+ hex = o.join('');
282
+ }
283
+ return hex;
284
+ },
285
+ HexToRGB = function (hex) {
286
+ var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
287
+ return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
288
+ },
289
+ HexToHSB = function (hex) {
290
+ return RGBToHSB(HexToRGB(hex));
291
+ },
292
+ RGBToHSB = function (rgb) {
293
+ var hsb = {
294
+ h: 0,
295
+ s: 0,
296
+ b: 0
297
+ };
298
+ var min = Math.min(rgb.r, rgb.g, rgb.b);
299
+ var max = Math.max(rgb.r, rgb.g, rgb.b);
300
+ var delta = max - min;
301
+ hsb.b = max;
302
+ if (max != 0) {
303
+
304
+ }
305
+ hsb.s = max != 0 ? 255 * delta / max : 0;
306
+ if (hsb.s != 0) {
307
+ if (rgb.r == max) {
308
+ hsb.h = (rgb.g - rgb.b) / delta;
309
+ } else if (rgb.g == max) {
310
+ hsb.h = 2 + (rgb.b - rgb.r) / delta;
311
+ } else {
312
+ hsb.h = 4 + (rgb.r - rgb.g) / delta;
313
+ }
314
+ } else {
315
+ hsb.h = -1;
316
+ }
317
+ hsb.h *= 60;
318
+ if (hsb.h < 0) {
319
+ hsb.h += 360;
320
+ }
321
+ hsb.s *= 100/255;
322
+ hsb.b *= 100/255;
323
+ return hsb;
324
+ },
325
+ HSBToRGB = function (hsb) {
326
+ var rgb = {};
327
+ var h = Math.round(hsb.h);
328
+ var s = Math.round(hsb.s*255/100);
329
+ var v = Math.round(hsb.b*255/100);
330
+ if(s == 0) {
331
+ rgb.r = rgb.g = rgb.b = v;
332
+ } else {
333
+ var t1 = v;
334
+ var t2 = (255-s)*v/255;
335
+ var t3 = (t1-t2)*(h%60)/60;
336
+ if(h==360) h = 0;
337
+ if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
338
+ else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
339
+ else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
340
+ else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
341
+ else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
342
+ else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
343
+ else {rgb.r=0; rgb.g=0; rgb.b=0}
344
+ }
345
+ return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
346
+ },
347
+ RGBToHex = function (rgb) {
348
+ var hex = [
349
+ rgb.r.toString(16),
350
+ rgb.g.toString(16),
351
+ rgb.b.toString(16)
352
+ ];
353
+ $.each(hex, function (nr, val) {
354
+ if (val.length == 1) {
355
+ hex[nr] = '0' + val;
356
+ }
357
+ });
358
+ return hex.join('');
359
+ },
360
+ HSBToHex = function (hsb) {
361
+ return RGBToHex(HSBToRGB(hsb));
362
+ },
363
+ restoreOriginal = function () {
364
+ var cal = $(this).parent();
365
+ var col = cal.data('colorpicker').origColor;
366
+ cal.data('colorpicker').color = col;
367
+ fillRGBFields(col, cal.get(0));
368
+ fillHexFields(col, cal.get(0));
369
+ fillHSBFields(col, cal.get(0));
370
+ setSelector(col, cal.get(0));
371
+ setHue(col, cal.get(0));
372
+ setNewColor(col, cal.get(0));
373
+ };
374
+ return {
375
+ init: function (opt) {
376
+ opt = $.extend({}, defaults, opt||{});
377
+ if (typeof opt.color == 'string') {
378
+ opt.color = HexToHSB(opt.color);
379
+ } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
380
+ opt.color = RGBToHSB(opt.color);
381
+ } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
382
+ opt.color = fixHSB(opt.color);
383
+ } else {
384
+ return this;
385
+ }
386
+ return this.each(function () {
387
+ if (!$(this).data('colorpickerId')) {
388
+ var options = $.extend({}, opt);
389
+ options.origColor = opt.color;
390
+ var id = 'collorpicker_' + parseInt(Math.random() * 1000);
391
+ $(this).data('colorpickerId', id);
392
+ var cal = $(tpl).attr('id', id);
393
+ if (options.flat) {
394
+ cal.appendTo(this).show();
395
+ } else {
396
+ cal.appendTo(document.body);
397
+ }
398
+ options.fields = cal
399
+ .find('input')
400
+ .bind('keyup', keyDown)
401
+ .bind('change', change)
402
+ .bind('blur', blur)
403
+ .bind('focus', focus);
404
+ cal
405
+ .find('span').bind('mousedown', downIncrement).end()
406
+ .find('>div.colorpicker_current_color').bind('click', restoreOriginal);
407
+ options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
408
+ options.selectorIndic = options.selector.find('div div');
409
+ options.el = this;
410
+ options.hue = cal.find('div.colorpicker_hue div');
411
+ cal.find('div.colorpicker_hue').bind('mousedown', downHue);
412
+ options.newColor = cal.find('div.colorpicker_new_color');
413
+ options.currentColor = cal.find('div.colorpicker_current_color');
414
+ cal.data('colorpicker', options);
415
+ cal.find('div.colorpicker_submit')
416
+ .bind('mouseenter', enterSubmit)
417
+ .bind('mouseleave', leaveSubmit)
418
+ .bind('click', clickSubmit);
419
+ fillRGBFields(options.color, cal.get(0));
420
+ fillHSBFields(options.color, cal.get(0));
421
+ fillHexFields(options.color, cal.get(0));
422
+ setHue(options.color, cal.get(0));
423
+ setSelector(options.color, cal.get(0));
424
+ setCurrentColor(options.color, cal.get(0));
425
+ setNewColor(options.color, cal.get(0));
426
+ if (options.flat) {
427
+ cal.css({
428
+ position: 'relative',
429
+ display: 'block'
430
+ });
431
+ } else {
432
+ $(this).bind(options.eventName, show);
433
+ }
434
+ }
435
+ });
436
+ },
437
+ showPicker: function() {
438
+ return this.each( function () {
439
+ if ($(this).data('colorpickerId')) {
440
+ show.apply(this);
441
+ }
442
+ });
443
+ },
444
+ hidePicker: function() {
445
+ return this.each( function () {
446
+ if ($(this).data('colorpickerId')) {
447
+ $('#' + $(this).data('colorpickerId')).hide();
448
+ }
449
+ });
450
+ },
451
+ setColor: function(col) {
452
+ if (typeof col == 'string') {
453
+ col = HexToHSB(col);
454
+ } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
455
+ col = RGBToHSB(col);
456
+ } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
457
+ col = fixHSB(col);
458
+ } else {
459
+ return this;
460
+ }
461
+ return this.each(function(){
462
+ if ($(this).data('colorpickerId')) {
463
+ var cal = $('#' + $(this).data('colorpickerId'));
464
+ cal.data('colorpicker').color = col;
465
+ cal.data('colorpicker').origColor = col;
466
+ fillRGBFields(col, cal.get(0));
467
+ fillHSBFields(col, cal.get(0));
468
+ fillHexFields(col, cal.get(0));
469
+ setHue(col, cal.get(0));
470
+ setSelector(col, cal.get(0));
471
+ setCurrentColor(col, cal.get(0));
472
+ setNewColor(col, cal.get(0));
473
+ }
474
+ });
475
+ }
476
+ };
477
+ }();
478
+ $.fn.extend({
479
+ ColorPicker: ColorPicker.init,
480
+ ColorPickerHide: ColorPicker.hidePicker,
481
+ ColorPickerShow: ColorPicker.showPicker,
482
+ ColorPickerSetColor: ColorPicker.setColor
483
+ });
484
+ })(jQuery)
@@ -0,0 +1,13 @@
1
+ /**
2
+ * DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>.
3
+ * Author: Drew Diller
4
+ * Email: drew.diller@gmail.com
5
+ * URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
6
+ * Version: 0.0.8a
7
+ * Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
8
+ *
9
+ * Example usage:
10
+ * DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
11
+ * DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
12
+ **/
13
+ var DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}},createVmlStyleSheet:function(){var b,a;b=document.createElement("style");b.setAttribute("media","screen");document.documentElement.firstChild.insertBefore(b,document.documentElement.firstChild.firstChild);if(b.styleSheet){b=b.styleSheet;b.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");b.addRule(this.ns+"\\:shape","position:absolute;");b.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.screenStyleSheet=b;a=document.createElement("style");a.setAttribute("media","print");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\\:*","{display: none !important;}");a.addRule("img."+this.ns+"_sizeFinder","{display: none !important;}")}},readPropertyChange:function(){var b,c,a;b=event.srcElement;if(!b.vmlInitiated){return}if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1){DD_belatedPNG.applyVML(b)}if(event.propertyName=="style.display"){c=(b.currentStyle.display=="none")?"none":"block";for(a in b.vml){if(b.vml.hasOwnProperty(a)){b.vml[a].shape.style.display=c}}}if(event.propertyName.search("filter")!=-1){DD_belatedPNG.vmlOpacity(b)}},vmlOpacity:function(b){if(b.currentStyle.filter.search("lpha")!=-1){var a=b.currentStyle.filter;a=parseInt(a.substring(a.lastIndexOf("=")+1,a.lastIndexOf(")")),10)/100;b.vml.color.shape.style.filter=b.currentStyle.filter;b.vml.image.fill.opacity=a}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c,b;c=a.split(",");for(b=0;b<c.length;b++){this.screenStyleSheet.addRule(c[b],"behavior:expression(DD_belatedPNG.fixPng(this))")}}},applyVML:function(a){a.runtimeStyle.cssText="";this.vmlFill(a);this.vmlOffsets(a);this.vmlOpacity(a);if(a.isImg){this.copyImageBorders(a)}},attachHandlers:function(i){var d,c,g,e,b,f;d=this;c={resize:"vmlOffsets",move:"vmlOffsets"};if(i.nodeName=="A"){e={mouseleave:"handlePseudoHover",mouseenter:"handlePseudoHover",focus:"handlePseudoHover",blur:"handlePseudoHover"};for(b in e){if(e.hasOwnProperty(b)){c[b]=e[b]}}}for(f in c){if(c.hasOwnProperty(f)){g=function(){d[c[f]](i)};i.attachEvent("on"+f,g)}}i.attachEvent("onpropertychange",this.readPropertyChange)},giveLayout:function(a){a.style.zoom=1;if(a.currentStyle.position=="static"){a.style.position="relative"}},copyImageBorders:function(b){var c,a;c={borderStyle:true,borderWidth:true,borderColor:true};for(a in c){if(c.hasOwnProperty(a)){b.vml.color.shape.style[a]=b.currentStyle[a]}}},vmlFill:function(e){if(!e.currentStyle){return}else{var d,f,g,b,a,c;d=e.currentStyle}for(b in e.vml){if(e.vml.hasOwnProperty(b)){e.vml[b].shape.style.zIndex=d.zIndex}}e.runtimeStyle.backgroundColor="";e.runtimeStyle.backgroundImage="";f=true;if(d.backgroundImage!="none"||e.isImg){if(!e.isImg){e.vmlBg=d.backgroundImage;e.vmlBg=e.vmlBg.substr(5,e.vmlBg.lastIndexOf('")')-5)}else{e.vmlBg=e.src}g=this;if(!g.imgSize[e.vmlBg]){a=document.createElement("img");g.imgSize[e.vmlBg]=a;a.className=g.ns+"_sizeFinder";a.runtimeStyle.cssText="behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;";c=function(){this.width=this.offsetWidth;this.height=this.offsetHeight;g.vmlOffsets(e)};a.attachEvent("onload",c);a.src=e.vmlBg;a.removeAttribute("width");a.removeAttribute("height");document.body.insertBefore(a,document.body.firstChild)}e.vml.image.fill.src=e.vmlBg;f=false}e.vml.image.fill.on=!f;e.vml.image.fill.color="none";e.vml.color.shape.style.backgroundColor=d.backgroundColor;e.runtimeStyle.backgroundImage="none";e.runtimeStyle.backgroundColor="transparent"},vmlOffsets:function(d){var h,n,a,e,g,m,f,l,j,i,k;h=d.currentStyle;n={W:d.clientWidth+1,H:d.clientHeight+1,w:this.imgSize[d.vmlBg].width,h:this.imgSize[d.vmlBg].height,L:d.offsetLeft,T:d.offsetTop,bLW:d.clientLeft,bTW:d.clientTop};a=(n.L+n.bLW==1)?1:0;e=function(b,p,q,c,s,u){b.coordsize=c+","+s;b.coordorigin=u+","+u;b.path="m0,0l"+c+",0l"+c+","+s+"l0,"+s+" xe";b.style.width=c+"px";b.style.height=s+"px";b.style.left=p+"px";b.style.top=q+"px"};e(d.vml.color.shape,(n.L+(d.isImg?0:n.bLW)),(n.T+(d.isImg?0:n.bTW)),(n.W-1),(n.H-1),0);e(d.vml.image.shape,(n.L+n.bLW),(n.T+n.bTW),(n.W),(n.H),1);g={X:0,Y:0};if(d.isImg){g.X=parseInt(h.paddingLeft,10)+1;g.Y=parseInt(h.paddingTop,10)+1}else{for(j in g){if(g.hasOwnProperty(j)){this.figurePercentage(g,n,j,h["backgroundPosition"+j])}}}d.vml.image.fill.position=(g.X/n.W)+","+(g.Y/n.H);m=h.backgroundRepeat;f={T:1,R:n.W+a,B:n.H,L:1+a};l={X:{b1:"L",b2:"R",d:"W"},Y:{b1:"T",b2:"B",d:"H"}};if(m!="repeat"||d.isImg){i={T:(g.Y),R:(g.X+n.w),B:(g.Y+n.h),L:(g.X)};if(m.search("repeat-")!=-1){k=m.split("repeat-")[1].toUpperCase();i[l[k].b1]=1;i[l[k].b2]=n[l[k].d]}if(i.B>n.H){i.B=n.H}d.vml.image.shape.style.clip="rect("+i.T+"px "+(i.R+a)+"px "+i.B+"px "+(i.L+a)+"px)"}else{d.vml.image.shape.style.clip="rect("+f.T+"px "+f.R+"px "+f.B+"px "+f.L+"px)"}},figurePercentage:function(d,c,f,a){var b,e;e=true;b=(f=="X");switch(a){case"left":case"top":d[f]=0;break;case"center":d[f]=0.5;break;case"right":case"bottom":d[f]=1;break;default:if(a.search("%")!=-1){d[f]=parseInt(a,10)/100}else{e=false}}d[f]=Math.ceil(e?((c[b?"W":"H"]*d[f])-(c[b?"w":"h"]*d[f])):parseInt(a,10));if(d[f]%2===0){d[f]++}return d[f]},fixPng:function(c){c.style.behavior="none";var g,b,f,a,d;if(c.nodeName=="BODY"||c.nodeName=="TD"||c.nodeName=="TR"){return}c.isImg=false;if(c.nodeName=="IMG"){if(c.src.toLowerCase().search(/\.png$/)!=-1){c.isImg=true;c.style.visibility="hidden"}else{return}}else{if(c.currentStyle.backgroundImage.toLowerCase().search(".png")==-1){return}}g=DD_belatedPNG;c.vml={color:{},image:{}};b={shape:{},fill:{}};for(a in c.vml){if(c.vml.hasOwnProperty(a)){for(d in b){if(b.hasOwnProperty(d)){f=g.ns+":"+d;c.vml[a][d]=document.createElement(f)}}c.vml[a].shape.stroked=false;c.vml[a].shape.appendChild(c.vml[a].fill);c.parentNode.insertBefore(c.vml[a].shape,c)}}c.vml.image.shape.fillcolor="none";c.vml.image.fill.type="tile";c.vml.color.fill.on=false;g.attachHandlers(c);g.giveLayout(c);g.giveLayout(c.offsetParent);c.vmlInitiated=true;g.applyVML(c)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet();