var DD_roundies={ns:"DD_roundies",createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml");}},createVmlStyleSheet:function(){var A=document.createElement("style");document.documentElement.firstChild.insertBefore(A,document.documentElement.firstChild.firstChild);if(A.styleSheet){var B=A.styleSheet;B.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");B.addRule(this.ns+"\\:shape","position:absolute; left:0px; top:0px;  z-index:-1;");this.styleSheet=B;}else{this.styleSheet=A;}},addRule:function(B,A,C){if(this.styleSheet.addRule){this.styleSheet.addRule(B,"behavior:expression(DD_roundies.roundifyElement.call(this, "+A+"))");}else{this.styleSheet.appendChild(document.createTextNode(B+" {border-radius:"+A+"px; -moz-border-radius:"+A+"px; -webkit-border-radius:"+A+"px;}"));}},roundifyElement:function(A){this.style.behavior="none";this.style.zoom=1;if(this.currentStyle.position=="static"){this.style.position="relative";}this.vml=document.createElement(DD_roundies.ns+":shape");var B=this;this.interceptPropertyChanges=function(){switch(event.propertyName){case"style.border":case"style.borderWidth":case"style.padding":B.applyVML.call(B);break;case"style.borderColor":B.updateVmlStrokeColor.call(B);break;case"style.backgroundColor":B.updateVmlFill.call(B);}};this.applyVML=function(){this.runtimeStyle.cssText="";this.updateVmlFill();this.updateVmlStrokeWeight();this.updateVmlStrokeColor();this.updateVmlDimensions();this.updateVmlPath();this.hideSourceBorder();};this.hideSourceBorder=function(){this.runtimeStyle.border="none";var D=["Top","Left","Right","Bottom"];for(var C=0;C<4;C++){this.runtimeStyle["padding"+D[C]]=parseInt(this.currentStyle["padding"+D[C]],10)+parseInt(this.realBorderWidth,10)+"px";}};this.updateVmlStrokeWeight=function(){this.realBorderWidth=parseInt(this.currentStyle.borderWidth,10);if(this.realBorderWidth.toString()=="NaN"){this.realBorderWidth=0;}this.halfRealBorderWidth=Math.floor(this.realBorderWidth/2);this.vml.strokeweight=this.realBorderWidth+"px";this.vml.stroked=!(this.realBorderWidth===0);};this.updateVmlStrokeColor=function(){this.vml.strokecolor=this.currentStyle.borderColor;};this.updateVmlFill=function(){this.runtimeStyle.backgroundColor="";if(this.currentStyle&&(this.currentStyle.backgroundImage!="none"||(this.currentStyle.backgroundColor&&this.currentStyle.backgroundColor!="transparent"))){this.vml.filled=true;if(!this.vml.filler){this.vml.filler=document.createElement(DD_roundies.ns+":fill");this.vml.appendChild(this.vml.filler);}if(this.currentStyle.backgroundImage){var C=this.currentStyle.backgroundImage;this.vml.filler.src=C.substr(5,C.lastIndexOf('")')-5);this.vml.filler.type="tile";}if(this.currentStyle.backgroundColor){this.vml.filler.color=this.currentStyle.backgroundColor;}this.runtimeStyle.background="none";}else{this.vml.filled=false;}};this.updateVmlDimensions=function(){if(!this.dim){this.dim={};}this.dim.w=this.offsetWidth;this.dim.h=this.offsetHeight;this.vml.style.width=this.dim.w;this.vml.style.height=this.dim.h;this.vml.coordorigin=-this.halfRealBorderWidth+" "+-this.halfRealBorderWidth;this.vml.coordsize=(this.dim.w+this.realBorderWidth)+" "+(this.dim.h+this.realBorderWidth);};this.updateVmlPath=function(){this.vml.path="m0,"+A+"qy"+A+",0l"+(this.dim.w-A)+",0qx"+this.dim.w+","+A+"l"+this.dim.w+","+(this.dim.h-A)+"qy"+(this.dim.w-A)+","+this.dim.h+"l"+A+","+this.dim.h+"qx0,"+(this.dim.h-A)+"xe";};this.handlePseudoHover=function(){setTimeout(function(){B.runtimeStyle.backgroundColor="";B.updateVmlFill.call(B);B.updateVmlStrokeColor.call(B);},1);};this.insertBefore(this.vml,this.firstChild);this.applyVML();if(this.nodeName=="A"){this.attachEvent("onmouseleave",this.handlePseudoHover);this.attachEvent("onmouseenter",this.handlePseudoHover);}this.attachEvent("onpropertychange",this.interceptPropertyChanges);this.attachEvent("onresize",function(){B.updateVmlDimensions.call(B);B.updateVmlPath.call(B);});}};DD_roundies.createVmlNameSpace();DD_roundies.createVmlStyleSheet();