/** * justcorners.js 2.0 (10-Aug-2010) (c) by Christian Effenberger * All Rights Reserved. Source: corner.netzgesta.de * Distributed under Netzgestade Software License Agreement. * This license permits free of charge use on non-commercial * and private web sites only under special conditions. * Read more at... http://www.netzgesta.de/cvi/LICENSE.html * Commercial licenses available via... cvi[at]netzgesta[dot]de **/ var tmp = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0; if(tmp) var isIE = document.namespaces && !window.opera && ( !document.documentMode || document.documentMode < 9 ) ? 1 : 0; if(isIE) { if(document.namespaces['v']==null) { var e=["shape","shapetype","group","background","path","formulas","handles","fill","stroke","shadow","textbox","textpath","imagedata","line","polyline","curve","roundrect","oval","rect","arc","image"],s=document.createStyleSheet(); for(var i=0; i'].join('')); flt = image.currentStyle.styleFloat.toLowerCase(); display = (flt=='left'||flt=='right')?'inline':display; var path = "m 0," + radius; if(bl==1) {path += " l 0," + (image.height-radius) + (ibezel?" l ":" qy ") + radius + "," + image.height;}else {path += " l 0," + image.height;} if(br==1) {path += " l " + (image.width-radius) + "," + image.height + (ibezel?" l ":" qx ") + image.width + "," + (image.height-radius);}else {path += " l " + image.width + "," + image.height;} if(tr==1) {path += " l " + image.width + "," + radius + (ibezel?" l ":" qy ") + (image.width-radius) + ",0";}else {path += " l " + image.width + ",0";} if(tl==1) {path += " l " + radius + ",0 " +(ibezel?" l ":" qx ")+ " 0," + radius;}else {path += " l 0,0";} path += " x e"; data = ''; vml.innerHTML = [data ].join(''); vml.className = newClasses; vml.style.cssText = image.style.cssText; vml.style.visibility = 'visible'; vml.src = image.src; vml.alt = image.alt; if(image.id!='') vml.id = image.id; if(image.title!='') vml.title = image.title; if(image.getAttribute('onclick')!='') vml.setAttribute('onclick',image.getAttribute('onclick')); image.insertAdjacentElement('BeforeBegin',vml); if(image.getAttribute("usemap")) { object.style.position = 'relative'; object.style.height = image.height+'px'; object.style.width = image.width+'px'; image.left = 0; image.top = 0; image.style.position = 'absolute'; image.style.height = image.height+'px'; image.style.width = image.width+'px'; image.style.left = 0 + 'px'; image.style.top = 0 + 'px'; image.style.filter = "Alpha(opacity=0)"; }else { image.style.display = 'none'; } } } function addRoundedCorners() { var image, object, canvas, context, classNames, classes = ''; var iradius = 0, iborder = 0, icolor = '', ibezel = false, newClasses = ''; var maxdim = 0, mindim = 0, i, j, child, tmp = ''; var tl = 1, tr = 1, bl = 1, br = 1, color = ''; var children = document.getElementsByTagName('img'); var theimages = new Array(); for(i=0;i0) { roundedCorners(context,canvas.width,canvas.height,iradius,tl,tr,bl,br,ibezel); context.strokeStyle = '#'+color; context.lineWidth = iborder; context.stroke(); } canvas.style.visibility = 'visible'; } } } if(window.addEventListener) window.addEventListener("load",addRoundedCorners,false); else window.attachEvent("onload",addRoundedIECorners);