--Do not remove this if you are using--
Original Author:Remiz Rahnas
Original Author URL:http:Published date:2008/09/24
Changes by Nick Fetchak:-IE8 standards mode compatibility
-VML elements now positioned behind original box rather than inside of it-should be less prone to breakage
-Added partial support for'box-shadow'style
-Checks for VML support before doing anything
-Updates VML element size and position via timer and also via window resize event
-lots of other small things
Published date:2010/03/14
http:Thanks to TheBrightLines.com(http:<public:attach event="ondocumentready"onevent="ondocumentready('v08vnSVo78t4JfjH')"/><script type="text/javascript">timer_length=200;border_opacity=false;function supportsVml(){if(typeof supportsVml.supported=="undefined"){var a=document.body.appendChild(document.createElement('div'));a.innerHTML='<v:shape id="vml_flag1" adj="1" />';var b=a.firstChild;b.style.behavior="url(#default#VML)";supportsVml.supported=b?typeof b.adj=="object":true;a.parentNode.removeChild(a);}
return supportsVml.supported}
function findPos(obj){var curleft=curtop=0;if(obj.offsetParent){do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}while(obj=obj.offsetParent);}
return({'x':curleft,'y':curtop});}
function createBoxShadow(element,vml_parent){var style=element.currentStyle['iecss3-box-shadow']||element.currentStyle['-moz-box-shadow']||element.currentStyle['-webkit-box-shadow']||element.currentStyle['box-shadow']||'';var match=style.match(/^(\d+)px (\d+)px (\d+)px/);if(!match){return(false);}
var shadow=document.createElement('v:roundrect');shadow.userAttrs={'x':parseInt(RegExp.$1||0),'y':parseInt(RegExp.$2||0),'radius':parseInt(RegExp.$3||0)/2};shadow.position_offset={'y':(0-vml_parent.pos_ieCSS3.y-shadow.userAttrs.radius+shadow.userAttrs.y),'x':(0-vml_parent.pos_ieCSS3.x-shadow.userAttrs.radius+shadow.userAttrs.x)};shadow.size_offset={'width':0,'height':0};shadow.arcsize=element.arcSize+'px';shadow.style.display='block';shadow.style.position='absolute';nshadow.style.top=(element.pos_ieCSS3.y+shadow.position_offset.y)+'px';shadow.style.left=(element.pos_ieCSS3.x+shadow.position_offset.x)+'px';shadow.style.width=element.offsetWidth+'px';shadow.style.height=element.offsetHeight+'px';shadow.style.antialias=true;shadow.className='vml_box_shadow';shadow.style.zIndex=element.zIndex-1;shadow.style.filter='progid:DXImageTransform.Microsoft.Blur(pixelRadius='+shadow.userAttrs.radius+',makeShadow=true,shadowOpacity=.35)';element.parentNode.appendChild(shadow);element.vml.push(shadow);return(true);}
function ondocumentready(classID){if(!supportsVml()){return(false);}
if(this.className.match(classID)){return(false);}
this.className=this.className.concat(' ',classID);if(!document.namespaces.v){document.namespaces.add("v","urn:schemas-microsoft-com:vml");}
if(typeof(window.ieCSS3)=='undefined'){window.ieCSS3={'vmlified_elements':new Array(),'update_timer':setInterval(updatePositionAndSize,timer_length)};if(typeof(window.onresize)=='function'){window.ieCSS3.previous_onresize=window.onresize;}
window.onresize=updatePositionAndSize;}
this.element.vml=new Array();this.zIndex=parseInt(this.currentStyle.zIndex);if(isNaN(this.zIndex)){this.zIndex=0;}
vml_parent=this;var limit=100,i=0;do{vml_parent=vml_parent.parentElement;i++;if(i>=limit){return(false);}}while((typeof(vml_parent)!='undefined')&&(vml_parent.currentStyle.position!='relative')&&(vml_parent.tagName!='BODY'));vml_parent.pos_ieCSS3=findPos(vml_parent);this.pos_ieCSS3=findPos(this);var rv1=createBoxShadow(this,vml_parent);if(rv1){window.ieCSS3.vmlified_elements.push(this.element);}
if(typeof(vml_parent.document.ieCSS3_stylesheet)=='undefined'){vml_parent.document.ieCSS3_stylesheet=vml_parent.document.createStyleSheet();vml_parent.document.ieCSS3_stylesheet.addRule("v\\:roundrect","behavior: url(#default#VML)");vml_parent.document.ieCSS3_stylesheet.addRule("v\\:fill","behavior: url(#default#VML)");vml_parent.document.ieCSS3_stylesheet.ie7=true;}}
function updatePositionAndSize(){if(typeof(window.ieCSS3.vmlified_elements)!='object'){return(false);}
for(var i in window.ieCSS3.vmlified_elements){var el=window.ieCSS3.vmlified_elements[i];if(typeof(el.vml)!='object'){continue;}
for(var z in el.vml){var new_pos=findPos(el);new_pos.x=(new_pos.x+el.vml[z].position_offset.x)+'px';new_pos.y=(new_pos.y+el.vml[z].position_offset.y)+'px';if(el.vml[z].style.left!=new_pos.x){el.vml[z].style.left=new_pos.x;}
if(el.vml[z].style.top!=new_pos.y){el.vml[z].style.top=new_pos.y;}
var new_size={'width':parseInt(el.offsetWidth+el.vml[z].size_offset.width),'height':parseInt(el.offsetHeight+el.vml[z].size_offset.height)}
if(el.vml[z].offsetWidth!=new_size.width){el.vml[z].style.width=new_size.width+'px';}
if(el.vml[z].offsetHeight!=new_size.height){el.vml[z].style.height=new_size.height+'px';}}}
if(event&&(event.type=='resize')&&typeof(window.ieCSS3.previous_onresize)=='function'){window.ieCSS3.previous_onresize();}}</script>