function NumberFormat(a,b){this.VERSION="Number Format v1.5.4";this.COMMA=",";this.PERIOD=".";this.DASH="-";this.LEFT_PAREN="(";this.RIGHT_PAREN=")";this.LEFT_OUTSIDE=0;this.LEFT_INSIDE=1;this.RIGHT_INSIDE=2;this.RIGHT_OUTSIDE=3;this.LEFT_DASH=0;this.RIGHT_DASH=1;this.PARENTHESIS=2;this.NO_ROUNDING=-1;this.num;this.numOriginal;this.hasSeparators=false;this.separatorValue;this.inputDecimalValue;this.decimalValue;this.negativeFormat;this.negativeRed;this.hasCurrency;this.currencyPosition;this.currencyValue;this.places;this.roundToPlaces;this.truncate;this.setNumber=setNumberNF;this.toUnformatted=toUnformattedNF;this.setInputDecimal=setInputDecimalNF;this.setSeparators=setSeparatorsNF;this.setCommas=setCommasNF;this.setNegativeFormat=setNegativeFormatNF;this.setNegativeRed=setNegativeRedNF;this.setCurrency=setCurrencyNF;this.setCurrencyPrefix=setCurrencyPrefixNF;this.setCurrencyValue=setCurrencyValueNF;this.setCurrencyPosition=setCurrencyPositionNF;this.setPlaces=setPlacesNF;this.toFormatted=toFormattedNF;this.toPercentage=toPercentageNF;this.getOriginal=getOriginalNF;this.moveDecimalRight=moveDecimalRightNF;this.moveDecimalLeft=moveDecimalLeftNF;this.getRounded=getRoundedNF;this.preserveZeros=preserveZerosNF;this.justNumber=justNumberNF;this.expandExponential=expandExponentialNF;this.getZeros=getZerosNF;this.moveDecimalAsString=moveDecimalAsStringNF;this.moveDecimal=moveDecimalNF;this.addSeparators=addSeparatorsNF;if(b==null){this.setNumber(a,this.PERIOD)}else{this.setNumber(a,b)}this.setCommas(true);this.setNegativeFormat(this.LEFT_DASH);this.setNegativeRed(false);this.setCurrency(false);this.setCurrencyPrefix("$");this.setPlaces(2)}function setInputDecimalNF(a){this.inputDecimalValue=a}function setNumberNF(a,b){if(b!=null){this.setInputDecimal(b)}this.numOriginal=a;this.num=this.justNumber(a)}function toUnformattedNF(){return(this.num)}function getOriginalNF(){return(this.numOriginal)}function setNegativeFormatNF(a){this.negativeFormat=a}function setNegativeRedNF(a){this.negativeRed=a}function setSeparatorsNF(b,c,a){this.hasSeparators=b;if(c==null){c=this.COMMA}if(a==null){a=this.PERIOD}if(c==a){this.decimalValue=(a==this.PERIOD)?this.COMMA:this.PERIOD}else{this.decimalValue=a}this.separatorValue=c}function setCommasNF(a){this.setSeparators(a,this.COMMA,this.PERIOD)}function setCurrencyNF(a){this.hasCurrency=a}function setCurrencyValueNF(a){this.currencyValue=a}function setCurrencyPrefixNF(a){this.setCurrencyValue(a);this.setCurrencyPosition(this.LEFT_OUTSIDE)}function setCurrencyPositionNF(a){this.currencyPosition=a}function setPlacesNF(b,a){this.roundToPlaces=!(b==this.NO_ROUNDING);this.truncate=(a!=null&&a);this.places=(b<0)?0:b}function addSeparatorsNF(d,e,a,c){d+="";var f=d.indexOf(e);var g="";if(f!=-1){g=a+d.substring(f+1,d.length);d=d.substring(0,f)}var b=/(\d+)(\d{3})/;while(b.test(d)){d=d.replace(b,"$1"+c+"$2")}return d+g}function toFormattedNF(){var n;var o=this.num;var a;var b=new Array(2);if(this.roundToPlaces){o=this.getRounded(o);a=this.preserveZeros(Math.abs(o))}else{a=this.expandExponential(Math.abs(o))}if(this.hasSeparators){a=this.addSeparators(a,this.PERIOD,this.decimalValue,this.separatorValue)}else{a=a.replace(new RegExp("\\"+this.PERIOD),this.decimalValue)}var f="";var m="";var e="";var l="";var h="";var d="";var g="";var c="";var p=(this.negativeFormat==this.PARENTHESIS)?this.LEFT_PAREN:this.DASH;var k=(this.negativeFormat==this.PARENTHESIS)?this.RIGHT_PAREN:this.DASH;if(this.currencyPosition==this.LEFT_OUTSIDE){if(o<0){if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){l=p}if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){h=k}}if(this.hasCurrency){f=this.currencyValue}}else{if(this.currencyPosition==this.LEFT_INSIDE){if(o<0){if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){m=p}if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){g=k}}if(this.hasCurrency){e=this.currencyValue}}else{if(this.currencyPosition==this.RIGHT_INSIDE){if(o<0){if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){m=p}if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){g=k}}if(this.hasCurrency){d=this.currencyValue}}else{if(this.currencyPosition==this.RIGHT_OUTSIDE){if(o<0){if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){l=p}if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){h=k}}if(this.hasCurrency){c=this.currencyValue}}}}}a=f+m+e+l+a+h+d+g+c;if(this.negativeRed&&o<0){a='<font color="red">'+a+"</font>"}return(a)}function toPercentageNF(){nNum=this.num*100;nNum=this.getRounded(nNum);return nNum+"%"}function getZerosNF(a){var c="";var b;for(b=0;b<a;b++){c+="0"}return c}function expandExponentialNF(b){if(isNaN(b)){return b}var d=parseFloat(b)+"";var g=d.toLowerCase().indexOf("e");if(g!=-1){var a=d.toLowerCase().indexOf("+");var e=d.toLowerCase().indexOf("-",g);var f=d.substring(0,g);if(e!=-1){var c=d.substring(e+1,d.length);f=this.moveDecimalAsString(f,true,parseInt(c))}else{if(a==-1){a=g}var c=d.substring(a+1,d.length);f=this.moveDecimalAsString(f,false,parseInt(c))}d=f}return d}function moveDecimalRightNF(c,b){var a="";if(b==null){a=this.moveDecimal(c,false)}else{a=this.moveDecimal(c,false,b)}return a}function moveDecimalLeftNF(c,b){var a="";if(b==null){a=this.moveDecimal(c,true)}else{a=this.moveDecimal(c,true,b)}return a}function moveDecimalAsStringNF(d,e,a){var k=(arguments.length<3)?this.places:a;if(k<=0){return d}var b=d+"";var f=this.getZeros(k);var h=new RegExp("([0-9.]+)");if(e){b=b.replace(h,f+"$1");var g=new RegExp("(-?)([0-9]*)([0-9]{"+k+"})(\\.?)");b=b.replace(g,"$1$2.$3")}else{var c=h.exec(b);if(c!=null){b=b.substring(0,c.index)+c[1]+f+b.substring(c.index+c[0].length)}var g=new RegExp("(-?)([0-9]*)(\\.?)([0-9]{"+k+"})");b=b.replace(g,"$1$2$4.")}b=b.replace(/\.$/,"");return b}function moveDecimalNF(d,c,b){var a="";if(b==null){a=this.moveDecimalAsString(d,c)}else{a=this.moveDecimalAsString(d,c,b)}return parseFloat(a)}function getRoundedNF(a){a=this.moveDecimalRight(a);if(this.truncate){a=a>=0?Math.floor(a):Math.ceil(a)}else{a=Math.round(a)}a=this.moveDecimalLeft(a);return a}function preserveZerosNF(c){var b;c=this.expandExponential(c);if(this.places<=0){return c}var a=c.indexOf(".");if(a==-1){c+=".";for(b=0;b<this.places;b++){c+="0"}}else{var e=(c.length-1)-a;var d=this.places-e;for(b=0;b<d;b++){c+="0"}}return c}function justNumberNF(e){newVal=e+"";var d=false;if(newVal.indexOf("%")!=-1){newVal=newVal.replace(/\%/g,"");d=true}var b=new RegExp("[^\\"+this.inputDecimalValue+"\\d\\-\\+\\(\\)eE]","g");newVal=newVal.replace(b,"");var f=new RegExp("["+this.inputDecimalValue+"]","g");var c=f.exec(newVal);if(c!=null){var a=newVal.substring(c.index+c[0].length);newVal=newVal.substring(0,c.index)+this.PERIOD+a.replace(f,"")}if(newVal.charAt(newVal.length-1)==this.DASH){newVal=newVal.substring(0,newVal.length-1);newVal="-"+newVal}else{if(newVal.charAt(0)==this.LEFT_PAREN&&newVal.charAt(newVal.length-1)==this.RIGHT_PAREN){newVal=newVal.substring(1,newVal.length-1);newVal="-"+newVal}}newVal=parseFloat(newVal);if(!isFinite(newVal)){newVal=0}if(d){newVal=this.moveDecimalLeft(newVal,2)}return newVal}var dateFormat=function(){var a=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,b=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,d=/[^-+\dA-Z]/g,c=function(f,e){f=String(f);e=e||2;while(f.length<e){f="0"+f}return f};return function(k,x,t){var g=dateFormat;if(arguments.length==1&&(typeof k=="string"||k instanceof String)&&!/\d/.test(k)){x=k;k=undefined}k=k?new Date(k):new Date();if(isNaN(k)){throw new SyntaxError("invalid date")}x=String(g.masks[x]||x||g.masks["default"]);if(x.slice(0,4)=="UTC:"){x=x.slice(4);t=true}var v=t?"getUTC":"get",p=k[v+"Date"](),e=k[v+"Day"](),l=k[v+"Month"](),r=k[v+"FullYear"](),u=k[v+"Hours"](),n=k[v+"Minutes"](),w=k[v+"Seconds"](),q=k[v+"Milliseconds"](),f=t?0:k.getTimezoneOffset(),h={d:p,dd:c(p),ddd:g.i18n.dayNames[e],dddd:g.i18n.dayNames[e+7],m:l+1,mm:c(l+1),mmm:g.i18n.monthNames[l],mmmm:g.i18n.monthNames[l+12],yy:String(r).slice(2),yyyy:r,h:u%12||12,hh:c(u%12||12),H:u,HH:c(u),M:n,MM:c(n),s:w,ss:c(w),l:c(q,3),L:c(q>99?Math.round(q/10):q),t:u<12?"a":"p",tt:u<12?"am":"pm",T:u<12?"A":"P",TT:u<12?"AM":"PM",Z:t?"UTC":(String(k).match(b)||[""]).pop().replace(d,""),o:(f>0?"-":"+")+c(Math.floor(Math.abs(f)/60)*100+Math.abs(f)%60,4),S:["th","st","nd","rd"][p%10>3?0:(p%100-p%10!=10)*p%10]};return x.replace(a,function(m){return m in h?h[m]:m.slice(1,m.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(a,b){return dateFormat(this,a,b)};var isIE=navigator.userAgent.toLowerCase().indexOf("msie")>-1;var isMoz=document.implementation&&document.implementation.createDocument;var isSafari=((navigator.userAgent.toLowerCase().indexOf("safari")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("mac")!=-1))?true:false;function curvyCorners(){if(typeof(arguments[0])!="object"){throw newCurvyError("First parameter of curvyCorners() must be an object.")}if(typeof(arguments[1])!="object"&&typeof(arguments[1])!="string"){throw newCurvyError("Second parameter of curvyCorners() must be an object or a class name.")}if(typeof(arguments[1])=="string"){var g=0;var a=getElementsByClass(arguments[1])}else{var g=1;var a=arguments}var d=new Array();if(arguments[0].validTags){var f=arguments[0].validTags}else{var f=["div"]}for(var c=g,b=a.length;c<b;c++){var e=a[c].tagName.toLowerCase();if(inArray(f,e)!==false){d[d.length]=new curvyObject(arguments[0],a[c])}}this.objects=d;this.applyCornersToAll=function(){for(var h=0,l=this.objects.length;h<l;h++){this.objects[h].applyCorners()}}}function curvyObject(){this.box=arguments[1];this.settings=arguments[0];this.topContainer=null;this.bottomContainer=null;this.masterCorners=new Array();this.contentDIV=null;var g=get_style(this.box,"height","height");var d=get_style(this.box,"width","width");var a=get_style(this.box,"borderTopWidth","border-top-width");var h=get_style(this.box,"borderTopColor","border-top-color");var c=get_style(this.box,"backgroundColor","background-color");var e=get_style(this.box,"backgroundImage","background-image");var b=get_style(this.box,"position","position");var f=get_style(this.box,"paddingTop","padding-top");this.boxHeight=parseInt(((g!=""&&g!="auto"&&g.indexOf("%")==-1)?g.substring(0,g.indexOf("px")):this.box.scrollHeight));this.boxWidth=parseInt(((d!=""&&d!="auto"&&d.indexOf("%")==-1)?d.substring(0,d.indexOf("px")):this.box.scrollWidth));this.borderWidth=parseInt(((a!=""&&a.indexOf("px")!==-1)?a.slice(0,a.indexOf("px")):0));this.boxColour=format_colour(c);this.boxPadding=parseInt(((f!=""&&f.indexOf("px")!==-1)?f.slice(0,f.indexOf("px")):0));this.borderColour=format_colour(h);this.borderString=this.borderWidth+"px solid "+this.borderColour;this.backgroundImage=((e!="none")?e:"");this.boxContent=this.box.innerHTML;if(b!="absolute"){this.box.style.position="relative"}this.box.style.padding="0px";if(isIE&&d=="auto"&&g=="auto"){this.box.style.width="100%"}if(this.settings.autoPad==true&&this.boxPadding>0){this.box.innerHTML=""}this.applyCorners=function(){for(var E=0;E<2;E++){switch(E){case 0:if(this.settings.tl||this.settings.tr){var B=document.createElement("DIV");B.style.width="100%";B.style.fontSize="1px";B.style.overflow="hidden";B.style.position="absolute";B.style.paddingLeft=this.borderWidth+"px";B.style.paddingRight=this.borderWidth+"px";var v=Math.max(this.settings.tl?this.settings.tl.radius:0,this.settings.tr?this.settings.tr.radius:0);B.style.height=v+"px";B.style.top=0-v+"px";B.style.left=0-this.borderWidth+"px";this.topContainer=this.box.appendChild(B)}break;case 1:if(this.settings.bl||this.settings.br){var B=document.createElement("DIV");B.style.width="100%";B.style.fontSize="1px";B.style.overflow="hidden";B.style.position="absolute";B.style.paddingLeft=this.borderWidth+"px";B.style.paddingRight=this.borderWidth+"px";var C=Math.max(this.settings.bl?this.settings.bl.radius:0,this.settings.br?this.settings.br.radius:0);B.style.height=C+"px";B.style.bottom=0-C+"px";B.style.left=0-this.borderWidth+"px";this.bottomContainer=this.box.appendChild(B)}break}}if(this.topContainer){this.box.style.borderTopWidth="0px"}if(this.bottomContainer){this.box.style.borderBottomWidth="0px"}var I=["tr","tl","br","bl"];for(var M in I){if(M>-1<4){var H=I[M];if(!this.settings[H]){if(((H=="tr"||H=="tl")&&this.topContainer!=null)||((H=="br"||H=="bl")&&this.bottomContainer!=null)){var A=document.createElement("DIV");A.style.position="relative";A.style.fontSize="1px";A.style.overflow="hidden";if(this.backgroundImage==""){A.style.backgroundColor=this.boxColour}else{A.style.backgroundImage=this.backgroundImage}switch(H){case"tl":A.style.height=v-this.borderWidth+"px";A.style.marginRight=this.settings.tr.radius-(this.borderWidth*2)+"px";A.style.borderLeft=this.borderString;A.style.borderTop=this.borderString;A.style.left=-this.borderWidth+"px";break;case"tr":A.style.height=v-this.borderWidth+"px";A.style.marginLeft=this.settings.tl.radius-(this.borderWidth*2)+"px";A.style.borderRight=this.borderString;A.style.borderTop=this.borderString;A.style.backgroundPosition="-"+(v+this.borderWidth)+"px 0px";A.style.left=this.borderWidth+"px";break;case"bl":A.style.height=C-this.borderWidth+"px";A.style.marginRight=this.settings.br.radius-(this.borderWidth*2)+"px";A.style.borderLeft=this.borderString;A.style.borderBottom=this.borderString;A.style.left=-this.borderWidth+"px";A.style.backgroundPosition="-"+(this.borderWidth)+"px -"+(this.boxHeight+(C+this.borderWidth))+"px";break;case"br":A.style.height=C-this.borderWidth+"px";A.style.marginLeft=this.settings.bl.radius-(this.borderWidth*2)+"px";A.style.borderRight=this.borderString;A.style.borderBottom=this.borderString;A.style.left=this.borderWidth+"px";A.style.backgroundPosition="-"+(C+this.borderWidth)+"px -"+(this.boxHeight+(C+this.borderWidth))+"px";break}}}else{if(this.masterCorners[this.settings[H].radius]){var A=this.masterCorners[this.settings[H].radius].cloneNode(true)}else{var A=document.createElement("DIV");A.style.height=this.settings[H].radius+"px";A.style.width=this.settings[H].radius+"px";A.style.position="absolute";A.style.fontSize="1px";A.style.overflow="hidden";var p=parseInt(this.settings[H].radius-this.borderWidth);for(var x=0,L=this.settings[H].radius;x<L;x++){if((x+1)>=p){var r=-1}else{var r=(Math.floor(Math.sqrt(Math.pow(p,2)-Math.pow((x+1),2)))-1)}if(p!=L){if((x)>=p){var o=-1}else{var o=Math.ceil(Math.sqrt(Math.pow(p,2)-Math.pow(x,2)))}if((x+1)>=L){var m=-1}else{var m=(Math.floor(Math.sqrt(Math.pow(L,2)-Math.pow((x+1),2)))-1)}}if((x)>=L){var l=-1}else{var l=Math.ceil(Math.sqrt(Math.pow(L,2)-Math.pow(x,2)))}if(r>-1){this.drawPixel(x,0,this.boxColour,100,(r+1),A,-1,this.settings[H].radius)}if(p!=L){for(var w=(r+1);w<o;w++){if(this.settings.antiAlias){if(this.backgroundImage!=""){var n=(pixelFraction(x,w,p)*100);if(n<30){this.drawPixel(x,w,this.borderColour,100,1,A,0,this.settings[H].radius)}else{this.drawPixel(x,w,this.borderColour,100,1,A,-1,this.settings[H].radius)}}else{var G=BlendColour(this.boxColour,this.borderColour,pixelFraction(x,w,p));this.drawPixel(x,w,G,100,1,A,0,this.settings[H].radius,H)}}}if(this.settings.antiAlias){if(m>=o){if(o==-1){o=0}this.drawPixel(x,o,this.borderColour,100,(m-o+1),A,0,0)}}else{if(m>=r){this.drawPixel(x,(r+1),this.borderColour,100,(m-r),A,0,0)}}var u=this.borderColour}else{var u=this.boxColour;var m=r}if(this.settings.antiAlias){for(var w=(m+1);w<l;w++){this.drawPixel(x,w,u,(pixelFraction(x,w,L)*100),1,A,((this.borderWidth>0)?0:-1),this.settings[H].radius)}}}this.masterCorners[this.settings[H].radius]=A.cloneNode(true)}if(H!="br"){for(var E=0,K=A.childNodes.length;E<K;E++){var y=A.childNodes[E];var J=parseInt(y.style.top.substring(0,y.style.top.indexOf("px")));var O=parseInt(y.style.left.substring(0,y.style.left.indexOf("px")));var Q=parseInt(y.style.height.substring(0,y.style.height.indexOf("px")));if(H=="tl"||H=="bl"){y.style.left=this.settings[H].radius-O-1+"px"}if(H=="tr"||H=="tl"){y.style.top=this.settings[H].radius-Q-J+"px"}switch(H){case"tr":y.style.backgroundPosition="-"+Math.abs((this.boxWidth-this.settings[H].radius+this.borderWidth)+O)+"px -"+Math.abs(this.settings[H].radius-Q-J-this.borderWidth)+"px";break;case"tl":y.style.backgroundPosition="-"+Math.abs((this.settings[H].radius-O-1)-this.borderWidth)+"px -"+Math.abs(this.settings[H].radius-Q-J-this.borderWidth)+"px";break;case"bl":y.style.backgroundPosition="-"+Math.abs((this.settings[H].radius-O-1)-this.borderWidth)+"px -"+Math.abs((this.boxHeight+this.settings[H].radius+J)-this.borderWidth)+"px";break}}}}if(A){switch(H){case"tl":if(A.style.position=="absolute"){A.style.top="0px"}if(A.style.position=="absolute"){A.style.left="0px"}if(this.topContainer){this.topContainer.appendChild(A)}break;case"tr":if(A.style.position=="absolute"){A.style.top="0px"}if(A.style.position=="absolute"){A.style.right="0px"}if(this.topContainer){this.topContainer.appendChild(A)}break;case"bl":if(A.style.position=="absolute"){A.style.bottom="0px"}if(A.style.position=="absolute"){A.style.left="0px"}if(this.bottomContainer){this.bottomContainer.appendChild(A)}break;case"br":if(A.style.position=="absolute"){A.style.bottom="0px"}if(A.style.position=="absolute"){A.style.right="0px"}if(this.bottomContainer){this.bottomContainer.appendChild(A)}break}}}}var D=new Array();D.t=Math.abs(this.settings.tl.radius-this.settings.tr.radius);D.b=Math.abs(this.settings.bl.radius-this.settings.br.radius);for(z in D){if(z=="t"||z=="b"){if(D[z]){var N=((this.settings[z+"l"].radius<this.settings[z+"r"].radius)?z+"l":z+"r");var q=document.createElement("DIV");q.style.height=D[z]+"px";q.style.width=this.settings[N].radius+"px";q.style.position="absolute";q.style.fontSize="1px";q.style.overflow="hidden";q.style.backgroundColor=this.boxColour;switch(N){case"tl":q.style.bottom="0px";q.style.left="0px";q.style.borderLeft=this.borderString;this.topContainer.appendChild(q);break;case"tr":q.style.bottom="0px";q.style.right="0px";q.style.borderRight=this.borderString;this.topContainer.appendChild(q);break;case"bl":q.style.top="0px";q.style.left="0px";q.style.borderLeft=this.borderString;this.bottomContainer.appendChild(q);break;case"br":q.style.top="0px";q.style.right="0px";q.style.borderRight=this.borderString;this.bottomContainer.appendChild(q);break}}var s=document.createElement("DIV");s.style.position="relative";s.style.fontSize="1px";s.style.overflow="hidden";s.style.backgroundColor=this.boxColour;s.style.backgroundImage=this.backgroundImage;switch(z){case"t":if(this.topContainer){if(this.settings.tl.radius&&this.settings.tr.radius){s.style.height=v-this.borderWidth+"px";s.style.marginLeft=this.settings.tl.radius-this.borderWidth+"px";s.style.marginRight=this.settings.tr.radius-this.borderWidth+"px";s.style.borderTop=this.borderString;if(this.backgroundImage!=""){s.style.backgroundPosition="-"+(v+this.borderWidth)+"px 0px"}this.topContainer.appendChild(s)}this.box.style.backgroundPosition="0px -"+(v-this.borderWidth)+"px"}break;case"b":if(this.bottomContainer){if(this.settings.bl.radius&&this.settings.br.radius){s.style.height=C-this.borderWidth+"px";s.style.marginLeft=this.settings.bl.radius-this.borderWidth+"px";s.style.marginRight=this.settings.br.radius-this.borderWidth+"px";s.style.borderBottom=this.borderString;if(this.backgroundImage!=""){s.style.backgroundPosition="-"+(C+this.borderWidth)+"px -"+(this.boxHeight+(v+this.borderWidth))+"px"}this.bottomContainer.appendChild(s)}}break}}}if(this.settings.autoPad==true&&this.boxPadding>0){var F=document.createElement("DIV");F.style.position="relative";F.innerHTML=this.boxContent;F.className="autoPadDiv";var P=Math.abs(v-this.boxPadding);var R=Math.abs(C-this.boxPadding);if(v<this.boxPadding){F.style.paddingTop=P+"px"}if(C<this.boxPadding){F.style.paddingBottom=C+"px"}F.style.paddingLeft=this.boxPadding+"px";F.style.paddingRight=this.boxPadding+"px";this.contentDIV=this.box.appendChild(F)}};this.drawPixel=function(t,q,k,p,r,s,m,o){var l=document.createElement("DIV");l.style.height=r+"px";l.style.width="1px";l.style.position="absolute";l.style.fontSize="1px";l.style.overflow="hidden";var n=Math.max(this.settings.tr.radius,this.settings.tl.radius);if(m==-1&&this.backgroundImage!=""){l.style.backgroundImage=this.backgroundImage;l.style.backgroundPosition="-"+(this.boxWidth-(o-t)+this.borderWidth)+"px -"+((this.boxHeight+n+q)-this.borderWidth)+"px"}else{l.style.backgroundColor=k}if(p!=100){setOpacity(l,p)}l.style.top=q+"px";l.style.left=t+"px";s.appendChild(l)}}function insertAfter(b,c,a){b.insertBefore(c,a.nextSibling)}function BlendColour(n,l,g){var d=parseInt(n.substr(1,2),16);var m=parseInt(n.substr(3,2),16);var f=parseInt(n.substr(5,2),16);var c=parseInt(l.substr(1,2),16);var k=parseInt(l.substr(3,2),16);var e=parseInt(l.substr(5,2),16);if(g>1||g<0){g=1}var h=Math.round((d*g)+(c*(1-g)));if(h>255){h=255}if(h<0){h=0}var b=Math.round((m*g)+(k*(1-g)));if(b>255){b=255}if(b<0){b=0}var a=Math.round((f*g)+(e*(1-g)));if(a>255){a=255}if(a<0){a=0}return"#"+IntToHex(h)+IntToHex(b)+IntToHex(a)}function IntToHex(a){base=a/16;rem=a%16;base=base-(rem/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS+""+remS}function MakeHex(a){if((a>=0)&&(a<=9)){return a}else{switch(a){case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F"}}}function pixelFraction(h,g,a){var c=0;var b=new Array(1);var f=new Array(1);var k=0;var d="";var e=Math.sqrt((Math.pow(a,2)-Math.pow(h,2)));if((e>=g)&&(e<(g+1))){d="Left";b[k]=0;f[k]=e-g;k=k+1}var e=Math.sqrt((Math.pow(a,2)-Math.pow(g+1,2)));if((e>=h)&&(e<(h+1))){d=d+"Top";b[k]=e-h;f[k]=1;k=k+1}var e=Math.sqrt((Math.pow(a,2)-Math.pow(h+1,2)));if((e>=g)&&(e<(g+1))){d=d+"Right";b[k]=1;f[k]=e-g;k=k+1}var e=Math.sqrt((Math.pow(a,2)-Math.pow(g,2)));if((e>=h)&&(e<(h+1))){d=d+"Bottom";b[k]=e-h;f[k]=0}switch(d){case"LeftRight":c=Math.min(f[0],f[1])+((Math.max(f[0],f[1])-Math.min(f[0],f[1]))/2);break;case"TopRight":c=1-(((1-b[0])*(1-f[1]))/2);break;case"TopBottom":c=Math.min(b[0],b[1])+((Math.max(b[0],b[1])-Math.min(b[0],b[1]))/2);break;case"LeftBottom":c=(f[0]*b[1])/2;break;default:c=1}return c}function rgb2Hex(b){try{var c=rgb2Array(b);var h=parseInt(c[0]);var f=parseInt(c[1]);var a=parseInt(c[2]);var d="#"+IntToHex(h)+IntToHex(f)+IntToHex(a)}catch(g){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex")}return d}function rgb2Array(a){var c=a.substring(4,a.indexOf(")"));var b=c.split(", ");return b}function setOpacity(f,c){c=(c==100)?99.999:c;if(isSafari&&f.tagName!="IFRAME"){var b=rgb2Array(f.style.backgroundColor);var e=parseInt(b[0]);var d=parseInt(b[1]);var a=parseInt(b[2]);f.style.backgroundColor="rgba("+e+", "+d+", "+a+", "+c/100+")"}else{if(typeof(f.style.opacity)!="undefined"){f.style.opacity=c/100}else{if(typeof(f.style.MozOpacity)!="undefined"){f.style.MozOpacity=c/100}else{if(typeof(f.style.filter)!="undefined"){f.style.filter="alpha(opacity:"+c+")"}else{if(typeof(f.style.KHTMLOpacity)!="undefined"){f.style.KHTMLOpacity=c/100}}}}}}function inArray(c,b){for(var a=0;a<c.length;a++){if(c[a]===b){return a}}return false}function inArrayKey(b,a){for(key in b){if(key===a){return true}}return false}function addEvent(e,d,b,a){if(e.addEventListener){e.addEventListener(d,b,a);return true}else{if(e.attachEvent){var c=e.attachEvent("on"+d,b);return c}else{e["on"+d]=b}}}function removeEvent(e,d,b,a){if(e.removeEventListener){e.removeEventListener(d,b,a);return true}else{if(e.detachEvent){var c=e.detachEvent("on"+d,b);return c}else{alert("Handler could not be removed")}}}function format_colour(b){var a="#ffffff";if(b!=""&&b!="transparent"){if(b.substr(0,3)=="rgb"){a=rgb2Hex(b)}else{if(b.length==4){a="#"+b.substring(1,2)+b.substring(1,2)+b.substring(2,3)+b.substring(2,3)+b.substring(3,4)+b.substring(3,4)}else{a=b}}}return a}function get_style(obj,property,propertyNS){try{if(obj.currentStyle){var returnVal=eval("obj.currentStyle."+property)}else{if(isSafari&&obj.style.display=="none"){obj.style.display="";var wasHidden=true}var returnVal=document.defaultView.getComputedStyle(obj,"").getPropertyValue(propertyNS);if(isSafari&&wasHidden){obj.style.display="none"}}}catch(e){}return returnVal}function getElementsByClass(g,e,a){var d=new Array();if(e==null){e=document}if(a==null){a="*"}var c=e.getElementsByTagName(a);var b=c.length;var f=new RegExp("(^|s)"+g+"(s|$)");for(i=0,j=0;i<b;i++){if(f.test(c[i].className)){d[j]=c[i];j++}}return d}function newCurvyError(a){return new Error("curvyCorners Error:\n"+a)};