function styleit()
{for(var t=0;t<document.styleSheets.length;t++)
{var theRules=new Array();theRules=document.styleSheets[t].rules;for(var i=0;i<theRules.length;i++)
{var allR=theRules[i].style.CCborderRadius||0;var tR=theRules[i].style.CCborderRadiusTR||allR;var tL=theRules[i].style.CCborderRadiusTL||allR;var bR=theRules[i].style.CCborderRadiusBR||allR;var bL=theRules[i].style.CCborderRadiusBL||allR;if(allR||tR||tR||bR||bL)
{var s=theRules[i].selectorText;var settings={tl:{radius:makeInt(tL)},tr:{radius:makeInt(tR)},bl:{radius:makeInt(bL)},br:{radius:makeInt(bR)},antiAlias:true,autoPad:true,validTags:["div"]};$(s).corner(settings);}}}}
function opera_contains_border_radius(sheetnumber){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(sheetnumber).ownerNode.text);}
function makeInt(num){var re=new RegExp('([0-9]*)');var i=0;if(isNaN(num)){var a=re.exec(num);if(!isNaN(parseInt(a[1]))){i=a[1];}}
else{i=num;}
return i;}
(function($){$(function(){if($.browser.msie){styleit();}else if($.browser.opera){for(t=0;t<document.styleSheets.length;++t){if(opera_contains_border_radius(t)){var txt=document.styleSheets.item(t).ownerNode.text;txt=txt.replace(/\/\*(\n|\r|.)*?\*\//g,'');var pat=new RegExp("^([\\w.#][\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg");var matches;while((matches=pat.exec(txt))!==null){var pat2=new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g");var submatches;while((submatches=pat2.exec(matches[2]))!==null){if(submatches[1]!=="z-"){var tL,tR,bL,bR,tLu,tRu,bLu,bRu;if(!submatches[3]){tL=tR=bL=bR=parseInt(submatches[5]);}
else{propname=submatches[3].charAt(0)+submatches[4].charAt(0);this[propname+'R']=parseInt(submatches[5]);}
var settings={tl:{radius:tL},tr:{radius:tR},bl:{radius:bL},br:{radius:bR}};$(matches[1]).corner(settings);}}}}}}});$.fn.corner=function(options){var settings={tl:{radius:8},tr:{radius:8},bl:{radius:8},br:{radius:8},antiAlias:true,autoPad:true,validTags:["div"]};if(options&&typeof(options)!='string')
$.extend(settings,options);return this.each(function(){if(!$(this).is('.hasCorners')){applyCorners(this,settings);}});function applyCorners(box,settings)
{var $$=$(box);this.topContainer=null;this.bottomContainer=null;this.shell=null;this.masterCorners=new Array();this.contentDIV=null;this.x_bgi=$$.css("backgroundImage");this.x_bgi=(x_bgi!="none"&&x_bgi!="initial")?x_bgi:"";this.x_bgr=$$.css("backgroundRepeat");this.x_bgposX=strip_px($$.css("backgroundPositionX"))?strip_px($$.css("backgroundPositionX")):0;this.x_bgposY=strip_px($$.css("backgroundPositionY"))?strip_px($$.css("backgroundPositionY")):0;this.x_bgc=format_colour($$.css("backgroundColor"));var x_height=$$.css("height");if(typeof x_height=='undefined')x_height='auto';this.x_height=parseInt(((x_height!=""&&x_height!="auto"&&x_height.indexOf("%")==-1)?x_height.substring(0,x_height.indexOf("px")):box.offsetHeight));if($.browser.msie&&$.browser.version==6)
{this.x_width=strip_px(box.offsetWidth);}
else
{this.x_width=strip_px($$.css('width'));}
this.xp_height=strip_px($$.parent().css("height"))?strip_px($$.css("height")):'auto';this.x_bw=strip_px($$.css("borderTopWidth"))?strip_px($$.css("borderTopWidth")):0;this.x_bbw=strip_px($$.css("borderBottomWidth"))?strip_px($$.css("borderBottomWidth")):0;this.x_tbw=strip_px($$.css("borderTopWidth"))?strip_px($$.css("borderTopWidth")):0;this.x_lbw=strip_px($$.css("borderLeftWidth"))?strip_px($$.css("borderLeftWidth")):0;this.x_rbw=strip_px($$.css("borderRightWidth"))?strip_px($$.css("borderRightWidth")):0;this.x_bc=format_colour($$.css("borderTopColor"));this.x_bbc=format_colour($$.css("borderBottomColor"));this.x_tbc=format_colour($$.css("borderTopColor"));this.x_lbc=format_colour($$.css("borderLeftColor"));this.x_rbc=format_colour($$.css("borderRightColor"));this.borderString=this.x_bw+"px"+" solid "+this.x_bc;this.borderStringB=this.x_bbw+"px"+" solid "+this.x_bbc;this.borderStringR=this.x_rbw+"px"+" solid "+this.x_bc;this.borderStringL=this.x_lbw+"px"+" solid "+this.x_bbc;this.x_pad=strip_px($$.css("paddingTop"));this.x_tpad=strip_px($$.css("paddingTop"));this.x_bpad=strip_px($$.css("paddingBottom"));this.x_lpad=strip_px($$.css("paddingLeft"));this.x_rpad=strip_px($$.css("paddingRight"));this.topPaddingP=strip_px($$.parent().css("paddingTop"));this.bottomPaddingP=strip_px($$.parent().css("paddingBottom"));this.x_tmargin=strip_px($$.css("marginTop"));this.x_bmargin=strip_px($$.css("marginBottom"));this.topMaxRadius=Math.max(settings.tl?settings.tl.radius:0,settings.tr?settings.tr.radius:0);this.botMaxRadius=Math.max(settings.bl?settings.bl.radius:0,settings.br?settings.br.radius:0);$$.addClass('hasCorners').css({"padding":"0","border":"none","backgroundColor":"transparent","backgroundImage":"none",'overflow':"visible"});if(box.style.position!="absolute")$$.css("position","relative");$$.attr("id","ccoriginaldiv");var newMainContainer=document.createElement("div");$(newMainContainer).css({"padding":"0",width:'100%'}).attr('id','ccshell');this.shell=newMainContainer;for(var t=0;t<2;t++)
{switch(t)
{case 0:if(settings.tl||settings.tr)
{var newMainContainer=document.createElement("div");$(newMainContainer).css({width:'100%',"font-size":"1px",overflow:"hidden",position:"absolute",height:topMaxRadius+"px",top:0-topMaxRadius+"px","marginLeft":-parseInt(this.x_lbw+this.x_lpad)+"px","marginRight":-parseInt(this.x_rbw+this.x_rpad)+"px"}).attr('id','cctopcontainer');if($.browser.msie&&$.browser.version==6){$(newMainContainer).css({"paddingLeft":Math.abs(parseInt(this.x_lbw+this.x_lpad))+"px","paddingRight":Math.abs(parseInt(this.x_rbw+this.x_rpad))+"px"});}
this.topContainer=this.shell.appendChild(newMainContainer);}
break;case 1:if(settings.bl||settings.br)
{var newMainContainer=document.createElement("div");$(newMainContainer).css({width:'100%',"font-size":"1px","overflow":"hidden","position":"absolute",height:botMaxRadius+"px",bottom:0-botMaxRadius+"px","marginLeft":-parseInt(this.x_lbw+this.x_lpad)+"px","marginRight":-parseInt(this.x_rbw+this.x_rpad)+"px"}).attr('id','ccbottomcontainer');if($.browser.msie&&$.browser.version==6){$(newMainContainer).css({"paddingLeft":Math.abs(parseInt(this.x_lbw+this.x_lpad))+"px","paddingRight":Math.abs(parseInt(this.x_rbw+this.x_rpad))+"px"});}
this.bottomContainer=this.shell.appendChild(newMainContainer);}
break;}}
var corners=["tr","tl","br","bl"];for(var i in corners)
{if(i>-1<4)
{var cc=corners[i];if(cc=="tr"||cc=="tl")
{var bwidth=this.x_bw;var bcolor=this.x_bc;}else{var bwidth=this.x_bbw;var bcolor=this.x_bbc;}
var newCorner=document.createElement("div");$(newCorner).css({position:"absolute","font-size":"1px",overflow:"hidden"}).height(settings[cc].radius+"px").width(settings[cc].radius+"px");var borderRadius=parseInt(settings[cc].radius-bwidth);for(var intx=0,j=settings[cc].radius;intx<j;intx++)
{if((intx+1)>=borderRadius)
var y1=-1;else
var y1=(Math.floor(Math.sqrt(Math.pow(borderRadius,2)-Math.pow((intx+1),2)))-1);if(borderRadius!=j)
{if((intx)>=borderRadius)
var y2=-1;else
var y2=Math.ceil(Math.sqrt(Math.pow(borderRadius,2)-Math.pow(intx,2)));if((intx+1)>=j)
var y3=-1;else
var y3=(Math.floor(Math.sqrt(Math.pow(j,2)-Math.pow((intx+1),2)))-1);}
if((intx)>=j)
var y4=-1;else
var y4=Math.ceil(Math.sqrt(Math.pow(j,2)-Math.pow(intx,2)));if(y1>-1)drawPixel(intx,0,this.x_bgc,100,(y1+1),newCorner,-1,settings[cc].radius,0,this.x_bgi,this.x_width,this.x_height,this.x_bw,this.x_bgr);if(borderRadius!=j)
{for(var inty=(y1+1);inty<y2;inty++)
{if(settings.antiAlias)
{if(this.x_bgi!="")
{var borderFract=(pixelFraction(intx,inty,borderRadius)*100);if(borderFract<30)
{drawPixel(intx,inty,bcolor,100,1,newCorner,0,settings[cc].radius,0,this.x_bgi,this.x_width,this.x_height,bwidth,this.x_bgr);}
else
{drawPixel(intx,inty,bcolor,100,1,newCorner,-1,settings[cc].radius,0,this.x_bgi,this.x_width,this.x_height,bwidth,this.x_bgr);}}
else
{var pixelcolour=BlendColour(this.x_bgc,bcolor,pixelFraction(intx,inty,borderRadius));drawPixel(intx,inty,pixelcolour,100,1,newCorner,0,settings[cc].radius,0,this.x_bgi,this.x_width,this.x_height,bwidth,this.x_bgr);}}}
if(settings.antiAlias)
{if(y3>=y2)
{if(y2==-1)y2=0;drawPixel(intx,y2,bcolor,100,(y3-y2+1),newCorner,0,0,1,this.x_bgi,this.x_width,this.x_height,bwidth,this.x_bgr);}}
else
{if(y3>=y1)
{drawPixel(intx,(y1+1),bcolor,100,(y3-y1),newCorner,0,0,1,this.x_bgi,this.x_width,this.x_height,bwidth,this.x_bgr);}}
var outsideColour=bcolor;}
else
{var outsideColour=this.x_bgc;var y3=y1;}
if(settings.antiAlias)
{for(var inty=(y3+1);inty<y4;inty++)
{drawPixel(intx,inty,outsideColour,(pixelFraction(intx,inty,j)*100),1,newCorner,((bwidth>0)?0:-1),settings[cc].radius,0,this.x_bgi,this.x_width,this.x_height,bwidth);}}}
masterCorners[settings[cc].radius]=$(newCorner).clone();for(var t=0,k=newCorner.childNodes.length;t<k;t++)
{var pixelBar=newCorner.childNodes[t];var pixelBarTop=parseInt(pixelBar.style.top.substring(0,pixelBar.style.top.indexOf("px")));var pixelBarLeft=parseInt(pixelBar.style.left.substring(0,pixelBar.style.left.indexOf("px")));var pixelBarHeight=parseInt(pixelBar.style.height.substring(0,pixelBar.style.height.indexOf("px")));if(cc=="tl"||cc=="bl"){pixelBar.style.left=settings[cc].radius-pixelBarLeft-1+"px";}
if(cc=="tr"||cc=="tl"){pixelBar.style.top=settings[cc].radius-pixelBarHeight-pixelBarTop+"px";}
pixelBar.style.backgroundRepeat=this.x_bgr;switch(cc)
{case"tr":if($.browser.msie&&$.browser.version==6)var offset=this.x_lpad+this.x_rpad+this.x_lbw+this.x_rbw;else var offset=0;pixelBar.style.backgroundPosition=parseInt(this.x_bgposX-Math.abs(this.x_rbw-this.x_lbw+(this.x_width-settings[cc].radius+this.x_rbw)+pixelBarLeft)-settings.bl.radius-this.x_bw-settings.br.radius-this.x_bw)+offset+"px "+parseInt(this.x_bgposY-Math.abs(settings[cc].radius-pixelBarHeight-pixelBarTop-this.x_bw))+"px";break;case"tl":pixelBar.style.backgroundPosition=parseInt(this.x_bgposX-Math.abs((settings[cc].radius-pixelBarLeft-1)-this.x_lbw))+"px "+parseInt(this.x_bgposY-Math.abs(settings[cc].radius-pixelBarHeight-pixelBarTop-this.x_bw))+"px";break;case"bl":pixelBar.style.backgroundPosition=parseInt(this.x_bgposX-Math.abs((settings[cc].radius-pixelBarLeft-1)-this.x_lbw))+"px "+parseInt(this.x_bgposY-Math.abs((this.x_height+(this.x_bw+this.x_tpad+this.x_bpad)-settings[cc].radius+pixelBarTop)))+"px";break;case"br":if($.browser.msie&&$.browser.version==6)var offset=this.x_lpad+this.x_rpad+this.x_lbw+this.x_rbw;else var offset=0;pixelBar.style.backgroundPosition=parseInt(this.x_bgposX-Math.abs(this.x_rbw-this.x_lbw+(this.x_width-settings[cc].radius+this.x_rbw)+pixelBarLeft)-settings.bl.radius-this.x_bw-settings.br.radius-this.x_bw)+offset+"px "+parseInt(this.x_bgposY-Math.abs((this.x_height+(this.x_bw+this.x_tpad+this.x_bpad)-settings[cc].radius+pixelBarTop)))+"px";break;}}
switch(cc)
{case"tl":if(newCorner.style.position=="absolute")newCorner.style.top="0px";if(newCorner.style.position=="absolute")newCorner.style.left="0px";if(this.topContainer)temp=this.topContainer.appendChild(newCorner);$(temp).attr("id","cctl");break;case"tr":if(newCorner.style.position=="absolute")newCorner.style.top="0px";if(newCorner.style.position=="absolute")newCorner.style.right="0px";if(this.topContainer)temp=this.topContainer.appendChild(newCorner);$(temp).attr("id","cctr");break;case"bl":if(newCorner.style.position=="absolute")newCorner.style.bottom="0px";if(newCorner.style.position=="absolute")newCorner.style.left="0px";if(this.bottomContainer)temp=this.bottomContainer.appendChild(newCorner);$(temp).attr("id","ccbl");break;case"br":if(newCorner.style.position=="absolute")newCorner.style.bottom="0px";if(newCorner.style.position=="absolute")newCorner.style.right="0px";if(this.bottomContainer)temp=this.bottomContainer.appendChild(newCorner);$(temp).attr("id","ccbr");break;}}}
var radiusDiff=new Array();radiusDiff["t"]=Math.abs(settings.tl.radius-settings.tr.radius);radiusDiff["b"]=Math.abs(settings.bl.radius-settings.br.radius);for(z in radiusDiff)
{if(z=="t"||z=="b")
{if(radiusDiff[z])
{var smallerCornerType=((settings[z+"l"].radius<settings[z+"r"].radius)?z+"l":z+"r");var newFiller=document.createElement("DIV");newFiller.style.height=radiusDiff[z]+"px";newFiller.style.width=settings[smallerCornerType].radius+"px";newFiller.style.position="absolute";newFiller.style.fontSize="1px";newFiller.style.overflow="hidden";newFiller.style.backgroundColor=this.x_bgc;switch(smallerCornerType)
{case"tl":newFiller.style.bottom="0px";newFiller.style.left="0px";newFiller.style.borderLeft=this.borderString;temp=this.topContainer.appendChild(newFiller);temp.id="cctlfiller";break;case"tr":newFiller.style.bottom="0px";newFiller.style.right="0px";newFiller.style.borderRight=this.borderString;temp=this.topContainer.appendChild(newFiller);temp.id="cctrfiller";break;case"bl":newFiller.style.top="0px";newFiller.style.left="0px";newFiller.style.borderLeft=this.borderStringB;temp=this.bottomContainer.appendChild(newFiller);temp.id="ccblfiller";break;case"br":newFiller.style.top="0px";newFiller.style.right="0px";newFiller.style.borderRight=this.borderStringB;temp=this.bottomContainer.appendChild(newFiller);temp.id="ccbrfiller";break;}}
var newFillerBar=document.createElement("div");newFillerBar.style.position="relative";newFillerBar.style.fontSize="1px";newFillerBar.style.overflow="hidden";newFillerBar.style.backgroundColor=this.x_bgc;newFillerBar.style.backgroundImage=this.x_bgi;newFillerBar.style.backgroundRepeat=this.x_bgr;switch(z)
{case"t":if(this.topContainer)
{if(settings.tl.radius&&settings.tr.radius)
{newFillerBar.style.height=100+topMaxRadius-this.x_tbw+"px";newFillerBar.style.marginLeft=settings.tl.radius-this.x_lbw+this.x_rbw+"px";newFillerBar.style.marginRight=settings.tr.radius-this.x_lbw+this.x_rbw+"px";newFillerBar.style.borderTop=this.borderString;if(this.x_bgi!="")
newFillerBar.style.backgroundPosition=parseInt(this.x_bgposX-(topMaxRadius-this.x_lbw))+"px "+parseInt(this.x_bgposY)+"px";if($.browser.msie&&$.browser.version==6){$(newFillerBar).css({"marginLeft":-parseInt(this.x_lbw+this.x_lpad-settings.tl.radius)+"px","marginRight":-parseInt(this.x_rbw+this.x_rpad-settings.tr.radius)+"px"});if(this.x_bgi!="")
newFillerBar.style.backgroundPosition=parseInt(this.x_bgposX+this.x_lbw-(topMaxRadius))+"px "+parseInt(this.x_bgposY)+"px";}
temp=this.topContainer.appendChild(newFillerBar);$(temp).attr("id","cctopmiddlefiller");$(this.shell).css("backgroundPosition",parseInt(this.x_bgposX)+"px "+parseInt(this.x_bgposY-(topMaxRadius-this.x_lbw))+"px");}}
break;case"b":if(this.bottomContainer)
{if(settings.bl.radius&&settings.br.radius)
{newFillerBar.style.height=botMaxRadius-this.x_bbw+"px";newFillerBar.style.marginLeft=settings.bl.radius-this.x_lbw+this.x_rbw+"px";newFillerBar.style.marginRight=settings.br.radius-this.x_lbw+this.x_rbw+"px";newFillerBar.style.borderBottom=this.borderStringB;if(this.x_bgi!="")
newFillerBar.style.backgroundPosition=parseInt(this.x_bgposX-(botMaxRadius-this.x_lbw))+"px "+parseInt(this.x_bgposY-(this.x_height+this.x_tpad+this.x_bbw+this.x_bpad-botMaxRadius))+"px";if($.browser.msie&&$.browser.version==6){$(newFillerBar).css({"marginLeft":-parseInt(this.x_lbw+this.x_lpad-settings.bl.radius)+"px","marginRight":-parseInt(this.x_rbw+this.x_rpad-settings.br.radius)+"px"});if(this.x_bgi!="")
newFillerBar.style.backgroundPosition=parseInt(this.x_bgposX-(botMaxRadius-this.x_lbw))+"px "+parseInt(this.x_bgposY-(this.x_height+this.x_tpad+this.x_bbw+this.x_bpad-botMaxRadius))+"px";}
temp=this.bottomContainer.appendChild(newFillerBar);$(temp).attr("id","ccbottommiddlefiller");}}
break;}}}
var contentContainer=document.createElement("div");var pd=0;contentContainer.className="autoPadDiv";var topPadding=Math.abs(this.x_bw+this.x_pad);var botPadding=Math.abs(this.x_bbw+this.x_bpad);if(topMaxRadius<this.boxPadding)
{contentContainer.style.paddingTop=Math.abs(parseInt(pd+topPadding))+"px";}
else
{contentContainer.style.paddingTop="0";}
if(botMaxRadius<this.x_pad)
{contentContainer.style.paddingBottom=Math.abs(parseInt(botPadding-botMaxRadius))+"px";}else
{contentContainer.style.paddingBottom="0";}
$(contentContainer).css({"marginLeft":-parseInt(this.x_lbw+this.x_lpad)+"px","marginRight":-parseInt(this.x_rbw+this.x_rpad)+"px","marginTop":"-"+Math.abs(parseInt(this.x_tbw+(this.x_tpad-topMaxRadius)))+"px","marginBottom":"-"+Math.abs(parseInt(this.x_bbw+(this.x_bpad-botMaxRadius)))+"px","border-left":this.borderStringL,"border-right":this.borderStringR,"border-top":this.borderString,"border-bottom":this.borderStringB,"borderTopWidth":"0","borderBottomWidth":"0","height":"100%","width":"100%","paddingLeft":Math.abs(parseInt(this.x_lpad))+"px","paddingRight":Math.abs(parseInt(this.x_rpad))+"px","paddingTop":Math.abs(parseInt(this.x_tbw+(this.x_tpad-topMaxRadius)))+"px","paddingBottom":Math.abs(parseInt(this.x_bbw+(this.x_bpad-botMaxRadius)))+"px"});$$.css({"paddingLeft":Math.abs(parseInt(this.x_lbw+this.x_lpad))+"px","paddingRight":Math.abs(parseInt(this.x_rbw+this.x_rpad))+"px","paddingTop":Math.abs(parseInt(this.x_tbw+(this.x_tpad-topMaxRadius)))+"px","paddingBottom":Math.abs(parseInt(this.x_bbw+(this.x_bpad-botMaxRadius)))+"px","backgroundColor":this.x_bgc,"backgroundImage":this.x_bgi,"backgroundPosition":this.x_bw+'px -'+Math.abs(parseInt(topMaxRadius-this.x_bw))+"px",'margin-top':0,'margin-bottom':0});if($$.html()=="")$$.html('&nbsp;');$$.wrapInner(contentContainer);$$.prepend(this.shell);var wrapper=document.createElement("div");$(wrapper).css({'margin-top':parseInt(this.x_tmargin)+"px",'margin-bottom':parseInt(this.x_bmargin)+"px",'padding-top':topMaxRadius+"px",'padding-bottom':botMaxRadius+"px",'overflow':'hidden'}).addClass('ccwrapper');$$.wrap(wrapper);$$.after('<div class="clear" style="height:0;line-height:0px;">&nbsp;</div>');}
function drawPixel(intx,inty,colour,transAmount,height,newCorner,image,cornerRadius,isBorder,bgImage,x_width,x_height,x_bw,repeat){var pixel=document.createElement("div");$(pixel).css({"height":height,"width":"1px","position":"absolute","font-size":"1px","overflow":"hidden","top":inty+"px","left":intx+"px","background-color":colour});var topMaxRadius=Math.max(settings.tl?settings.tl.radius:0,settings.tr?settings.tr.radius:0);if(image==-1&&bgImage!="")
{$(pixel).css({"background-position":"-"+Math.abs(x_width-(cornerRadius-intx)+x_bw)+"px -"+Math.abs((x_height+topMaxRadius+inty)-x_bw)+"px","background-image":bgImage,"background-repeat":repeat});}
else
{if(!isBorder)$(pixel).addClass('hasBackgroundColor');}
if(transAmount!=100)
$(pixel).css({opacity:(transAmount/100)});newCorner.appendChild(pixel);};function BlendColour(Col1,Col2,Col1Fraction)
{var red1=parseInt(Col1.substr(1,2),16);var green1=parseInt(Col1.substr(3,2),16);var blue1=parseInt(Col1.substr(5,2),16);var red2=parseInt(Col2.substr(1,2),16);var green2=parseInt(Col2.substr(3,2),16);var blue2=parseInt(Col2.substr(5,2),16);if(Col1Fraction>1||Col1Fraction<0)Col1Fraction=1;var endRed=Math.round((red1*Col1Fraction)+(red2*(1-Col1Fraction)));if(endRed>255)endRed=255;if(endRed<0)endRed=0;var endGreen=Math.round((green1*Col1Fraction)+(green2*(1-Col1Fraction)));if(endGreen>255)endGreen=255;if(endGreen<0)endGreen=0;var endBlue=Math.round((blue1*Col1Fraction)+(blue2*(1-Col1Fraction)));if(endBlue>255)endBlue=255;if(endBlue<0)endBlue=0;return"#"+IntToHex(endRed)+IntToHex(endGreen)+IntToHex(endBlue);}
function IntToHex(strNum)
{rem=strNum%16;base=Math.floor(strNum/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS+''+remS;}
function MakeHex(x)
{if((x>=0)&&(x<=9))
{return x;}
else
{switch(x)
{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(x,y,r)
{var pixelfraction=0;var xvalues=new Array(1);var yvalues=new Array(1);var point=0;var whatsides="";var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(x,2)));if((intersect>=y)&&(intersect<(y+1)))
{whatsides="Left";xvalues[point]=0;yvalues[point]=intersect-y;point=point+1;}
var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(y+1,2)));if((intersect>=x)&&(intersect<(x+1)))
{whatsides=whatsides+"Top";xvalues[point]=intersect-x;yvalues[point]=1;point=point+1;}
var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(x+1,2)));if((intersect>=y)&&(intersect<(y+1)))
{whatsides=whatsides+"Right";xvalues[point]=1;yvalues[point]=intersect-y;point=point+1;}
var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(y,2)));if((intersect>=x)&&(intersect<(x+1)))
{whatsides=whatsides+"Bottom";xvalues[point]=intersect-x;yvalues[point]=0;}
switch(whatsides)
{case"LeftRight":pixelfraction=Math.min(yvalues[0],yvalues[1])+((Math.max(yvalues[0],yvalues[1])-Math.min(yvalues[0],yvalues[1]))/2);break;case"TopRight":pixelfraction=1-(((1-xvalues[0])*(1-yvalues[1]))/2);break;case"TopBottom":pixelfraction=Math.min(xvalues[0],xvalues[1])+((Math.max(xvalues[0],xvalues[1])-Math.min(xvalues[0],xvalues[1]))/2);break;case"LeftBottom":pixelfraction=(yvalues[0]*xvalues[1])/2;break;default:pixelfraction=1;}
return pixelfraction;}
function rgb2Hex(rgbColour)
{try{var rgbArray=rgb2Array(rgbColour);var red=parseInt(rgbArray[0]);var green=parseInt(rgbArray[1]);var blue=parseInt(rgbArray[2]);var hexColour="#"+IntToHex(red)+IntToHex(green)+IntToHex(blue);}
catch(e){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex");}
return hexColour;}
function rgb2Array(rgbColour)
{var rgbValues=rgbColour.substring(4,rgbColour.indexOf(")"));var rgbArray=rgbValues.split(", ");return rgbArray;}
function format_colour(colour)
{var returnColour="#ffffff";if(colour!=""&&colour!="transparent")
{if(colour.substr(0,3)=="rgb"&&colour.substr(0,4)!="rgba")
{returnColour=rgb2Hex(colour);}
else if(colour.length==4)
{returnColour="#"+colour.substring(1,2)+colour.substring(1,2)+colour.substring(2,3)+colour.substring(2,3)+colour.substring(3,4)+colour.substring(3,4);}
else
{returnColour=colour;}}
return returnColour;}
function strip_px(value)
{if(typeof(value)!='string')return value;return parseInt(((value!="auto"&&value.indexOf("%")==-1&&value!=""&&value.indexOf("px")!==-1)?Math.round(value.slice(0,value.indexOf("px"))):0))}};})(jQuery);
