var l=null,la=null,lb=null,lc=false,ld=290,le=null,lf=null;function lg(a,b){if(a){le=a}if(b){lf=b}}function lh(a){return a==document.body?0:a.offsetLeft+lh(a.offsetParent)}function li(a){return a==document.body?0:a.offsetTop+li(a.offsetParent)}function lj(a,b){var c=b?b:elem("colorsample-"+a),d=lh(c)+20;l=a;la=elem("colorfield-"+a).value;if(cp_directionality=="rtl"){d=lh(c)-ld;if(b){d+=b.offsetWidth-20}}if(d<0){d=0}else if(d+ld>document.body.offsetWidth){d=document.body.offsetWidth-ld-20}var e=elem("color_picker"); e.style.top=li(c);e.style.left=d;e.style.display="";document.onmouseup=lk}function ll(a){lc=true;lb=a;if(l!=null){lm(l,a,true,true,true);elem("colorfield-"+l).focus()}lk()}function ln(a){lb=a;if(lf){lf(l,la,lb)}}function lk(){if(!lc){ln(la)}lc=false;document.onmouseup="";l=null;elem("color_picker").style.display="none"}function lo(a){if(a==null){return false}if(a.charAt(0)=="#"){a=a.substring(1)}return a.match("[0-9a-fA-F]{6}")!=null}function lp(a){var b=elem("colorfield-"+a).value;if(lo(b)){return b}else{return elem("lastValidColor-"+ a).value}}function lm(a,b,c,d,e){if(lo(b)){l=a;lb=b;hideError(a);elem("colorsample-"+a).style.backgroundColor="#"+b;elem("lastValidColor-"+a).value=b;if(c){elem("colorfield-"+a).value=b}if(e&&le){le(l,la,lb)}}else if(d||b.length==6){elem("colorsample-"+a).style.backgroundColor="#"+elem("lastValidColor-"+a).value;showError(a,val("invalidColorErrorMsg"))}}function lq(a,b){if(b==undefined){for(var c=0;c