xcpweb

diff interface/border-radius.htc @ 6:fa572caf2edc

The interface template and the login part almost ready :)
author Nikola Nikov <nikolanikov@webconnect.bg>
date Tue Jun 15 00:35:25 2010 +0300 (2010-06-15)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/interface/border-radius.htc	Tue Jun 15 00:35:25 2010 +0300
     1.3 @@ -0,0 +1,620 @@
     1.4 +<public:attach event="oncontentready" onevent="oncontentready('v08vnSVo78t4JfjH')" />
     1.5 +<script type="text/javascript">
     1.6 +/*--Do not remove this if you are using--
     1.7 +Original Author: Remiz Rahnas
     1.8 +Original Author URL: http://www.htmlremix.com
     1.9 +Published date: 2008/09/24
    1.10 +
    1.11 +Changes by Nick Fetchak:
    1.12 +- IE8 standards mode compatibility
    1.13 +- VML elements now positioned behind original box rather than inside of it - should be less prone to breakage
    1.14 +Published date : 2009/11/18
    1.15 +*/
    1.16 +
    1.17 +// functions to take the width and height of hidden elements
    1.18 +// taken from: http://blog.strictly-software.com/2009/10/correctly-measuring-element-dimensions.html
    1.19 +    // Functions for converting properties from camelCase to CSS-Property format and vice versa
    1.20 +    function toCamelCase(name){
    1.21 +        var camelCase = name.replace(/\-(\w)/g, function(all, letter){
    1.22 +            return letter.toUpperCase();
    1.23 +        });
    1.24 +        return camelCase
    1.25 +    }
    1.26 +    function toCSSProp(name){
    1.27 +        return name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
    1.28 +    }
    1.29 +
    1.30 +    //returns the current style of an element with no conversions of units
    1.31 +    function getStyle(el,style){
    1.32 +        var ret = 0;
    1.33 +        var	elem = (typeof(el)=="string")?G(el):el;
    1.34 +        var val = "", doc = (elem.ownerDocument||elem.document||document);
    1.35 +
    1.36 +        // Make sure we have both formats for JS and CSS styles
    1.37 +        var camelCase = toCamelCase(style); //convert to camelCase
    1.38 +        var CSSProp = toCSSProp(style); //convert to css-property
    1.39 +
    1.40 +        // Try for computed style first as this will return the actual value converted to px
    1.41 +        if (typeof doc.defaultView !== 'undefined' && typeof doc.defaultView.getComputedStyle !== 'undefined'){
    1.42 +            // We only require the word float for computedStyle
    1.43 +            if ( style.match( /float/i ) )
    1.44 +                style = "float";
    1.45 +
    1.46 +            var computedStyle = doc.defaultView.getComputedStyle( elem, null );
    1.47 +            //Standard Compliant function that will return the true computed size in px
    1.48 +            if ( computedStyle ){
    1.49 +                ret = computedStyle.getPropertyValue( CSSProp );
    1.50 +            }
    1.51 +        } else if ( elem.currentStyle ) {
    1.52 +            //IE only
    1.53 +            ret = elem.currentStyle[ camelCase ];
    1.54 +        } else if(elem.style && elem.style[ camelCase ] ){
    1.55 +            //Default to style if its been set by JS or inline styling
    1.56 +            ret = elem.style[ camelCase ];
    1.57 +        }
    1.58 +
    1.59 +        return ret
    1.60 +    }
    1.61 +
    1.62 +    function G(i){ return document.getElementById(i) }
    1.63 +
    1.64 +    // returns an array of elements that need to be made visible to carry out a measurement of an element
    1.65 +    function getVisibleObj(elem){
    1.66 +        arrEls = []; // holds array of elements we need to make visible to measure X
    1.67 +
    1.68 +        while(elem && elem!==document){
    1.69 +            var es = getStyle(elem,"display"); // method returns current/computed/style value
    1.70 +
    1.71 +            if(es == 'none'){
    1.72 +                arrEls.push(elem);
    1.73 +            }
    1.74 +
    1.75 +            elem = elem.parentNode;
    1.76 +        }
    1.77 +        return arrEls; //null;
    1.78 +    }
    1.79 +
    1.80 +    // swap styles in and out for an accurate measurment. Taken from jQuery and tweaked by myself to
    1.81 +    // handle multiple elements.
    1.82 +    function Swap(elem, els, styles, callback){
    1.83 +        var obj;
    1.84 +
    1.85 +        for(var x=0,l=els.length;x<l;x++){
    1.86 +             // create hash on element to hold old styles so we can revert later
    1.87 +             obj = els[x];
    1.88 +             obj.old = {};
    1.89 +
    1.90 +             // Remember the old values, and insert the new ones
    1.91 +             for ( var name in styles ) {
    1.92 +                 obj.old[ name ] = obj.style[ name ];
    1.93 +                 obj.style[ name ] = styles[ name ];
    1.94 +             }
    1.95 +        }
    1.96 +
    1.97 +        // call the function passing in any element that needs scope
    1.98 +        callback.call( elem );
    1.99 +
   1.100 +        for(var x=0,l=els.length;x<l;x++){
   1.101 +            obj = els[x];
   1.102 +
   1.103 +            // Revert the old values
   1.104 +            for ( var name in styles ){
   1.105 +                obj.style[ name ] = obj.old[ name ];
   1.106 +            }
   1.107 +            // delete the hash from the element
   1.108 +            try{ delete obj.old; }catch(e){ obj.old=null}
   1.109 +        }
   1.110 +    }
   1.111 +
   1.112 +    // offsetWidth/Height is element.width/height +border+padding (standard box model)
   1.113 +    // clientWidth/Height is element.width/height +padding (if overflow:scroll then -16px)
   1.114 +    function getElementDimensions(el){
   1.115 +        el = (typeof(el)=="string")?G(el):el; //return a reference to the element
   1.116 +
   1.117 +        var w=0,h=0,cw=0,ch=0,x=0,y=0;
   1.118 +
   1.119 +        // if element is currently hidden we won't be able to get measurements so we need to find out whether this or
   1.120 +        // any other parent objects are hiding this element from the flow
   1.121 +        var arrEls = getVisibleObj(el); //returns array of objects we need to show to meaure our element
   1.122 +
   1.123 +        // create function to do the measuring
   1.124 +        function getElDim(){
   1.125 +            // get style object
   1.126 +            var els = el.style;
   1.127 +
   1.128 +            var pos = findPos(el);
   1.129 +            // get dimensions
   1.130 +            w = el.offsetWidth, h = el.offsetHeight, cw = el.clientWidth, ch = el.clientHeight,y = pos.y,x = pos.x;
   1.131 +        }
   1.132 +
   1.133 +        // do we need to toggle other objects before getting our dimensions
   1.134 +        if(arrEls && arrEls.length>0){
   1.135 +            // call function to swap over properties so we can accuratley measure this element
   1.136 +            var styles = {visibility: "hidden",display:"block"};
   1.137 +            Swap(el, arrEls, styles, getElDim);
   1.138 +        }else{
   1.139 +            getElDim();
   1.140 +        }
   1.141 +
   1.142 +        // create object
   1.143 +        var ret = {
   1.144 +            "width":w,  //total width (element+border+padding)
   1.145 +            "height":h,
   1.146 +            "clientWidth":cw, //element+padding
   1.147 +            "clientHeight":ch,
   1.148 +            "x":x,
   1.149 +            "y":y
   1.150 +        }
   1.151 +
   1.152 +        return ret;
   1.153 +    }
   1.154 +// end width/height functons
   1.155 +
   1.156 +// findPos() borrowed from http://www.quirksmode.org/js/findpos.html
   1.157 +function findPos(obj) {
   1.158 +    var curleft = curtop = 0;
   1.159 +
   1.160 +    if (obj.offsetParent) {
   1.161 +        do {
   1.162 +            curleft += obj.offsetLeft;
   1.163 +            curtop += obj.offsetTop;
   1.164 +        } while (obj = obj.offsetParent);
   1.165 +    }
   1.166 +
   1.167 +    return({
   1.168 +        'x': curleft,
   1.169 +        'y': curtop
   1.170 +    });
   1.171 +}
   1.172 +
   1.173 +// get the four arc radiuses
   1.174 +function getarcs(elem) {
   1.175 +    var corners = {topRight: 0, bottomRight: 0, bottomLeft: 0, topLeft: 0}
   1.176 +
   1.177 +    var arcSize = parseInt(elem.currentStyle['-moz-border-radius'] ||
   1.178 +                           elem.currentStyle['-webkit-border-radius'] ||
   1.179 +                           elem.currentStyle['border-radius'] ||
   1.180 +                           elem.currentStyle['-khtml-border-radius']);
   1.181 +    if (!isNaN(arcSize)) {
   1.182 +        corners = {topRight: arcSize, bottomRight: arcSize, bottomLeft: arcSize, topLeft: arcSize}
   1.183 +    }
   1.184 +
   1.185 +    var topRightArc = parseInt(elem.currentStyle['-moz-border-radius-topright'] ||
   1.186 +                               elem.currentStyle['-webkit-border-top-right-radius'] ||
   1.187 +                               elem.currentStyle['border-top-right-radius'] ||
   1.188 +                               elem.currentStyle['-khtml-border-top-right-radius']);
   1.189 +
   1.190 +    if (!isNaN(topRightArc)) {
   1.191 +        corners.topRight = topRightArc;
   1.192 +    }
   1.193 +
   1.194 +    var bottomRightArc = parseInt(elem.currentStyle['-moz-border-radius-bottomright'] ||
   1.195 +                                  elem.currentStyle['-webkit-border-bottom-right-radius'] ||
   1.196 +                                  elem.currentStyle['border-bottom-right-radius'] ||
   1.197 +                                  elem.currentStyle['-khtml-border-bottom-right-radius']);
   1.198 +
   1.199 +    if (!isNaN(bottomRightArc)) {
   1.200 +        corners.bottomRight = bottomRightArc;
   1.201 +    }
   1.202 +
   1.203 +    var bottomLeftArc = parseInt(elem.currentStyle['-moz-border-radius-bottomleft'] ||
   1.204 +                                 elem.currentStyle['-webkit-border-bottom-left-radius'] ||
   1.205 +                                 elem.currentStyle['border-bottom-left-radius'] ||
   1.206 +                                 elem.currentStyle['-khtml-border-bottom-left-radius']);
   1.207 +
   1.208 +    if (!isNaN(bottomLeftArc)) {
   1.209 +        corners.bottomLeft = bottomLeftArc;
   1.210 +    }
   1.211 +
   1.212 +    var topLeftArc = parseInt(elem.currentStyle['-moz-border-radius-topleft'] ||
   1.213 +                              elem.currentStyle['-webkit-border-top-left-radius'] ||
   1.214 +                              elem.currentStyle['border-top-left-radius'] ||
   1.215 +                              elem.currentStyle['-khtml-border-top-left-radius']);
   1.216 +
   1.217 +    if (!isNaN(topLeftArc)) {
   1.218 +        corners.topLeft = topLeftArc;
   1.219 +    }
   1.220 +
   1.221 +    return corners;
   1.222 +}
   1.223 +
   1.224 +// limiting corners depending on the size of the box
   1.225 +function fixCorners(corners,rect_size) {
   1.226 +    // left side
   1.227 +    if (corners.topLeft + corners.bottomLeft >= rect_size.height) {
   1.228 +        if (corners.topLeft <= rect_size.height/2) {
   1.229 +            corners.bottomLeft = rect_size.height - corners.topLeft;
   1.230 +        } else if (corners.bottomLeft <= rect_size.height/2) {
   1.231 +            corners.topLeft = rect_size.height - corners.bottomLeft;
   1.232 +        } else {
   1.233 +            corners.bottomLeft = Math.floor(rect_size.height/2);
   1.234 +            corners.topLeft = Math.floor(rect_size.height/2);
   1.235 +        }
   1.236 +    }
   1.237 +    // alert(corners.bottomLeft);
   1.238 +    // right side
   1.239 +    if (corners.topRight + corners.bottomRight >= rect_size.height) {
   1.240 +        if (corners.topRight <= rect_size.height/2) {
   1.241 +            corners.bottomRight = rect_size.height - corners.topRight;
   1.242 +        } else if (corners.bottomRight <= rect_size.height/2) {
   1.243 +            corners.topRight = rect_size.height - corners.bottomRight;
   1.244 +        } else {
   1.245 +            corners.bottomRight = Math.floor(rect_size.height/2);
   1.246 +            corners.topRight = Math.floor(rect_size.height/2);
   1.247 +        }
   1.248 +    }
   1.249 +    // top side
   1.250 +    if (corners.topRight + corners.topLeft >= rect_size.width) {
   1.251 +        if (corners.topRight <= rect_size.width/2) {
   1.252 +            corners.topLeft = rect_size.width - corners.topRight;
   1.253 +        } else if (corners.topLeft <= rect_size.width/2) {
   1.254 +            corners.topRight = rect_size.width - corners.topLeft;
   1.255 +        } else {
   1.256 +            corners.topLeft = Math.floor(rect_size.width/2);
   1.257 +            corners.topRight = Math.floor(rect_size.width/2);
   1.258 +        }
   1.259 +    }
   1.260 +    // bottom side
   1.261 +    if (corners.bottomRight + corners.bottomLeft >= rect_size.width) {
   1.262 +        if (corners.bottomRight <= rect_size.width/2) {
   1.263 +            corners.bottomLeft = rect_size.width - corners.bottomRight;
   1.264 +        } else if (corners.bottomLeft <= rect_size.width/2) {
   1.265 +            corners.bottomRight = rect_size.width - corners.bottomLeft;
   1.266 +        } else {
   1.267 +            corners.bottomLeft = Math.floor(rect_size.width/2);
   1.268 +            corners.bottomRight = Math.floor(rect_size.width/2);
   1.269 +        }
   1.270 +    }
   1.271 +    return corners;
   1.272 +}
   1.273 +
   1.274 +// check if VML shape and fill are already defined in CSS and do not define them again
   1.275 +function addVMLCss() {
   1.276 +    var hasVMLShape = false;
   1.277 +    var hasVMLFill = false;
   1.278 +    var sheets = window.document.styleSheets, l = sheets.length;
   1.279 +    for(var i=0; i<l; i++) {
   1.280 +        var rules = (sheets[i]).rules;
   1.281 +        for(var j=0; j<l; j++) {
   1.282 +            if (rules[j] != undefined && rules[j].selectorText != null
   1.283 +                && (rules[j].selectorText == 'v:shape' || rules[j].selectorText == 'v\\:shape')
   1.284 +                ) {
   1.285 +                hasVMLShape = true;
   1.286 +            }
   1.287 +            if (rules[j] != undefined && rules[j].selectorText != null
   1.288 +                && (rules[j].selectorText == 'v:fill' || rules[j].selectorText == 'v\\:fill')
   1.289 +                ) {
   1.290 +                hasVMLFill = true;
   1.291 +            }
   1.292 +        }
   1.293 +    }
   1.294 +    if (!hasVMLShape || !hasVMLFill) {
   1.295 +        var css = window.document.createStyleSheet();
   1.296 +    }
   1.297 +    if (!hasVMLShape) {
   1.298 +        css.addRule("v\\:shape", "behavior: url(#default#VML)");
   1.299 +    }
   1.300 +    if (!hasVMLFill) {
   1.301 +        css.addRule("v\\:fill", "behavior: url(#default#VML)");
   1.302 +    }
   1.303 +}
   1.304 +
   1.305 +function makeShape(target,classID,colors) {
   1.306 +    if (target.className.match(classID)) {
   1.307 +        var tmpClassName = target.className;
   1.308 +        target.className = tmpClassName.substring(0,tmpClassName.indexOf(classID))+tmpClassName.substring((tmpClassName.lastIndexOf(classID)+classID.length),tmpClassName.length)
   1.309 +        // return(false);
   1.310 +    }
   1.311 +    target.className = target.className.concat(' ', classID);
   1.312 +    var corners = getarcs(target);
   1.313 +    if (colors == null) {
   1.314 +        var fillColor = target.currentStyle.backgroundColor;
   1.315 +        var fillSrc = target.currentStyle.backgroundImage.replace(/^url\("(.+)"\)$/, '$1');
   1.316 +        var strokeColor = target.currentStyle.borderColor;
   1.317 +    } else {
   1.318 +        var fillColor = colors.backgroundColor;
   1.319 +        var fillSrc = colors.backgroundImage;
   1.320 +        var strokeColor = colors.borderColor;
   1.321 +    }
   1.322 +    var strokeWeight = parseInt(target.currentStyle.borderWidth);
   1.323 +    var stroked = 'true';
   1.324 +    if (isNaN(strokeWeight)) {
   1.325 +        strokeWeight = 0;
   1.326 +        strokeColor = fillColor;
   1.327 +        stroked = 'false';
   1.328 +    }
   1.329 +    target.style.background = 'transparent';
   1.330 +    target.style.borderColor = 'transparent';
   1.331 +
   1.332 +    // Find which element provides position:relative for the target element (default to BODY)
   1.333 +    var el = target;
   1.334 +    var limit = 100, i = 0;
   1.335 +    // added absolute positioning also
   1.336 +    while ((typeof(el) != 'unknown') && (el.currentStyle.position != 'relative') && (el.currentStyle.position != 'absolute') && (el.tagName != 'BODY')) {
   1.337 +        el = el.parentElement;
   1.338 +        i++;
   1.339 +        if (i >= limit) { return(false); }
   1.340 +    }
   1.341 +    var el_zindex = parseInt(el.currentStyle.zIndex);
   1.342 +    if (isNaN(el_zindex)) { el_zindex = 0; }
   1.343 +    //alert('got tag '+ el.tagName +' with pos '+ el.currentStyle.position);
   1.344 +
   1.345 +    var rect_size = {
   1.346 +        'width': target.offsetWidth - strokeWeight,
   1.347 +        'height': target.offsetHeight - strokeWeight
   1.348 +    };
   1.349 +    // if sizes are <= 0 (when the element is hidden) use the function to get them
   1.350 +    if (rect_size.width <= 0 && rect_size.height <= 0) {
   1.351 +        var dimensions = getElementDimensions(target);
   1.352 +        rect_size.width = dimensions.clientWidth;
   1.353 +        rect_size.height = dimensions.clientHeight;
   1.354 +    }
   1.355 +
   1.356 +    corners = fixCorners(corners,rect_size);
   1.357 +
   1.358 +    var el_pos = findPos(el);
   1.359 +    var target_pos = findPos(target);
   1.360 +
   1.361 +    // if positions are <= 0 (when the element is hidden - happened on IE8 only) get the function to get them
   1.362 +    if (el_pos.x <= 0 && el_pos.y <= 0) {
   1.363 +        el_pos = getElementDimensions(el);
   1.364 +    }
   1.365 +    if (target_pos.x <= 0 && target_pos.y <= 0) {
   1.366 +        target_pos = getElementDimensions(target);
   1.367 +    }
   1.368 +    target_pos.y = target_pos.y + (0.5 * strokeWeight) - el_pos.y;
   1.369 +    target_pos.x = target_pos.x + (0.5 * strokeWeight) - el_pos.x;
   1.370 +
   1.371 +    var rect = document.createElement('v:shape');
   1.372 +    rect.coordorigin="0 0";
   1.373 +    rect.coordsize = rect_size.width+" "+rect_size.height;
   1.374 +    var topRightPoint = (rect_size.width - corners.topRight);
   1.375 +    if (topRightPoint < 0) {
   1.376 +        topRightPoint = corners.topLeft;
   1.377 +    }
   1.378 +    topRightPoint += ',0';
   1.379 +    var rightTopPoint = rect_size.width+','+corners.topRight;
   1.380 +    var rightBottomPoint = (rect_size.height - corners.bottomRight);
   1.381 +    if (rightBottomPoint < 0) {
   1.382 +        rightBottomPoint = corners.topRight;
   1.383 +    }
   1.384 +    rightBottomPoint = rect_size.width+','+rightBottomPoint;
   1.385 +    var bottomRightPoint = (rect_size.width - corners.bottomRight)+','+rect_size.height;
   1.386 +    var bottomLeftPoint = corners.bottomLeft+','+rect_size.height;
   1.387 +    var leftBottomPoint = '0,'+(rect_size.height - corners.bottomLeft);
   1.388 +    var leftTopPoint = '0,'+corners.topLeft;
   1.389 +    var topLeftPoint = corners.topLeft+',0';
   1.390 +
   1.391 +    var rightTopArc = '';
   1.392 +    if (corners.topRight != 0) {
   1.393 +        rightTopArc = 'c '+(rect_size.width-Math.ceil(corners.topRight/2))+',0 '+
   1.394 +            rect_size.width+','+(Math.ceil(corners.topRight/2))+' '+
   1.395 +            rightTopPoint+' ';
   1.396 +    }
   1.397 +    var rightBottomArc = '';
   1.398 +    if (corners.bottomRight != 0) {
   1.399 +        rightBottomArc = 'c '+(rect_size.width)+','+(rect_size.height - Math.ceil(corners.bottomRight/2))+' '+
   1.400 +            (rect_size.width - Math.ceil(corners.bottomRight/2))+','+(rect_size.height)+' '+
   1.401 +            bottomRightPoint+' ';
   1.402 +    }
   1.403 +    var leftBottomArc = '';
   1.404 +    if (corners.bottomLeft != 0) {
   1.405 +        leftBottomArc = 'c '+(Math.ceil(corners.bottomLeft/2))+','+rect_size.height+' '+
   1.406 +            '0,'+(rect_size.height - Math.ceil(corners.bottomLeft/2))+' '+
   1.407 +            leftBottomPoint+' ';
   1.408 +    }
   1.409 +    var topLeftArc = '';
   1.410 +    if (corners.topLeft != 0) {
   1.411 +        topLeftArc = 'c '+
   1.412 +            '0,'+(Math.ceil(corners.topLeft/2))+' '+
   1.413 +            (Math.ceil(corners.topLeft/2))+',0 '+
   1.414 +            topLeftPoint+' ';
   1.415 +    }
   1.416 +
   1.417 +    rect.path = 'm '+topLeftPoint+                          // start point
   1.418 +        'l '+topRightPoint+' '+                             // top line
   1.419 +        rightTopArc+                                        // top right arc
   1.420 +        'l '+ rightBottomPoint+' '+                         // right line
   1.421 +        rightBottomArc+                                     // bottom right arc
   1.422 +        'l '+bottomLeftPoint+' '+                           // bottom line
   1.423 +        leftBottomArc+                                      // bottom left arc
   1.424 +        'l '+leftTopPoint+' '+                              // left line
   1.425 +        topLeftArc+                                         // top left arc
   1.426 +        ' x e';
   1.427 +
   1.428 +    rect.strokecolor = strokeColor;
   1.429 +    rect.strokeWeight = strokeWeight +'px';
   1.430 +    rect.stroked = stroked;
   1.431 +    rect.style.display = 'block';
   1.432 +    rect.style.position = 'absolute';
   1.433 +    rect.style.top = target_pos.y +'px';
   1.434 +    rect.style.left = target_pos.x +'px';
   1.435 +    rect.style.width = rect_size.width +'px';
   1.436 +    rect.style.height = rect_size.height +'px';
   1.437 +    rect.style.antialias = true;
   1.438 +    rect.style.zIndex = el_zindex - 1;
   1.439 +    // debug(rect.style.zIndex);
   1.440 +
   1.441 +    var fill = document.createElement('v:fill');
   1.442 +    fill.color = fillColor;
   1.443 +    fill.src = fillSrc;
   1.444 +    fill.type = 'tile';
   1.445 +
   1.446 +    rect.appendChild(fill);
   1.447 +    el.appendChild(rect);
   1.448 +
   1.449 +    isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
   1.450 +    // IE6 doesn't support transparent borders, use padding to offset original element
   1.451 +    if (isIE6 && (strokeWeight > 0)) {
   1.452 +        target.style.borderStyle = 'none';
   1.453 +        target.style.paddingTop = parseInt(target.currentStyle.paddingTop || 0) + strokeWeight;
   1.454 +        target.style.paddingBottom = parseInt(target.currentStyle.paddingBottom || 0) + strokeWeight;
   1.455 +    }
   1.456 +    target.vml = rect;
   1.457 +}
   1.458 +
   1.459 +
   1.460 +function getRulesFor(target) {
   1.461 +    var classes = target.className;
   1.462 +    classes = classes.split(' ');
   1.463 +    var classesTmp = new Array();
   1.464 +    for (i = 0;i < classes.length;i++) {
   1.465 +        if (classes[i] != '') {
   1.466 +            classesTmp.push(classes[i]);
   1.467 +        }
   1.468 +    }
   1.469 +    classes = classesTmp;
   1.470 +
   1.471 +    var sheets = window.document.styleSheets, l = sheets.length;
   1.472 +    var rules = new Array();
   1.473 +    for(var i=0; i<l; i++) {
   1.474 +        rules = getRules(sheets[i],classes,rules);
   1.475 +    }
   1.476 +    return rules;
   1.477 +}
   1.478 +
   1.479 +function getRules(sheet,classes,rulesExt) {
   1.480 +    if(sheet.imports) {
   1.481 +        try {
   1.482 +            var imports = sheet.imports, l = imports.length;
   1.483 +            for(var i=0; i<l; i++) getRules(sheet.imports[i],classes,rulesExt);
   1.484 +        } catch(securityException){}
   1.485 +    }
   1.486 +
   1.487 +    var rules = (currentSheet = sheet).rules, l = rules.length;
   1.488 +    for(var j=0; j<l; j++) {
   1.489 +        var rule = rules[j];
   1.490 +        for (k = 0;k < classes.length;k++) {
   1.491 +            if ('.'+classes[k] == rule.selectorText ||
   1.492 +                '.'+classes[k]+':hover' == rule.selectorText
   1.493 +                ) {
   1.494 +                rulesExt.push(rule);
   1.495 +            }
   1.496 +        }
   1.497 +    }
   1.498 +    return rulesExt;
   1.499 +}
   1.500 +
   1.501 +function hoverSupport(target,classID,unhoverBackgroundColor,unhoverBackgroundImage,unhoverBorderColor) {
   1.502 +    // return false;
   1.503 +    var hoverRule;
   1.504 +    var hoverBackgroundColor;
   1.505 +    var hoverBackgroundImage;
   1.506 +    var hoverBorderColor;
   1.507 +
   1.508 +    function hover() {
   1.509 +        var rules = getRulesFor(target);
   1.510 +        for (i = 0;i < rules.length;i++) {
   1.511 +            if (rules[i].selectorText.match(':hover')) {
   1.512 +                hoverRule = rules[i];
   1.513 +            }
   1.514 +        }
   1.515 +        if (hoverRule == undefined) {
   1.516 +            return false;
   1.517 +        }
   1.518 +
   1.519 +        // remove the whatever:hover class if it is there
   1.520 +        isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
   1.521 +        if (isIE6) {
   1.522 +            var removeClass = hoverRule.selectorText.substring(1,hoverRule.selectorText.indexOf(':hover'))+'onhover';
   1.523 +            if (target.className.match(removeClass)) {
   1.524 +                var tmpClassName = target.className;
   1.525 +                target.className = tmpClassName.substring(0,tmpClassName.indexOf(removeClass))+tmpClassName.substring((tmpClassName.lastIndexOf(removeClass)+removeClass.length),tmpClassName.length)
   1.526 +            }
   1.527 +        }
   1.528 +
   1.529 +        hoverBackgroundColor = hoverRule.style.backgroundColor;
   1.530 +        hoverBackgroundImage = hoverRule.style.backgroundImage;
   1.531 +        hoverBorderColor = hoverRule.style.borderColor;
   1.532 +        var colors = {'backgroundColor':hoverBackgroundColor,
   1.533 +            'backgroundImage':hoverBackgroundImage,
   1.534 +            'borderColor':hoverBorderColor};
   1.535 +
   1.536 +        var rect = target.vml;
   1.537 +        var offsetParent = rect.offsetParent;
   1.538 +        offsetParent.removeChild(rect);
   1.539 +
   1.540 +        makeShape(target,classID,colors);
   1.541 +        hoverRule.style.backgroundColor = 'transparent';
   1.542 +        hoverRule.style.backgroundImage = '';
   1.543 +        hoverRule.style.borderColor = 'transparent';
   1.544 +
   1.545 +    }
   1.546 +    function unHover() {
   1.547 +        var rules = getRulesFor(target);
   1.548 +        for (i = 0;i < rules.length;i++) {
   1.549 +            if (rules[i].selectorText.match(':hover')) {
   1.550 +                hoverRule = rules[i];
   1.551 +            }
   1.552 +        }
   1.553 +
   1.554 +        if (hoverRule == undefined) {
   1.555 +            return false;
   1.556 +        }
   1.557 +
   1.558 +        target.style.backgroundColor = unhoverBackgroundColor;
   1.559 +        target.style.backgroundImage = unhoverBackgroundImage;
   1.560 +        target.style.borderColor = unhoverBorderColor;
   1.561 +
   1.562 +        var rect = target.vml;
   1.563 +        var offsetParent = rect.offsetParent;
   1.564 +        offsetParent.removeChild(rect);
   1.565 +        makeShape(target,classID);
   1.566 +
   1.567 +        hoverRule.style.backgroundColor = hoverBackgroundColor;
   1.568 +        hoverRule.style.backgroundImage = hoverBackgroundImage;
   1.569 +        hoverRule.style.borderColor = hoverBorderColor;
   1.570 +    }
   1.571 +    target.attachEvent('onmouseenter', function() {setTimeout(hover,0)});
   1.572 +    target.attachEvent('onmouseleave', function() {setTimeout(unHover,0)});
   1.573 +}
   1.574 +
   1.575 +function oncontentready(classID) {
   1.576 +    if (!document.namespaces.v) { document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); }
   1.577 +    var target = this.element;
   1.578 +
   1.579 +    var unhoverBackgroundColor = target.currentStyle.backgroundColor;
   1.580 +    var unhoverBackgroundImage = target.currentStyle.backgroundImage;
   1.581 +    var unhoverBorderColor = target.currentStyle.borderColor;
   1.582 +
   1.583 +    makeShape(target,classID);
   1.584 +
   1.585 +    // :hover support
   1.586 +    hoverSupport(target,classID,unhoverBackgroundColor,unhoverBackgroundImage,unhoverBorderColor);
   1.587 +
   1.588 +    addVMLCss()
   1.589 +
   1.590 +    if (typeof(window.rounded_elements) == 'undefined') {
   1.591 +        window.rounded_elements = new Array();
   1.592 +
   1.593 +        if (typeof(window.onresize) == 'function') { window.previous_onresize = window.onresize; }
   1.594 +        window.onresize = window_resize;
   1.595 +    }
   1.596 +    window.rounded_elements.push(target);
   1.597 +}
   1.598 +
   1.599 +function window_resize() {
   1.600 +    var classID = 'v08vnSVo78t4JfjH';
   1.601 +    if (typeof(window.rounded_elements) == 'undefined') { return(false); }
   1.602 +
   1.603 +    for (var i in window.rounded_elements) {
   1.604 +        var target = window.rounded_elements[i];
   1.605 +        var rect = target.vml;
   1.606 +
   1.607 +        // since the target colors has been set to transparent, we need to supply the right colors. We can read then from the shape element and its fill element.
   1.608 +        var fill = rect.childNodes[0];
   1.609 +        var fillColor = new String(fill.color);
   1.610 +        var fillSrc = new String(fill.src);
   1.611 +        var borderColor = rect.strokeColor;
   1.612 +        var colors = {'backgroundColor':fillColor,
   1.613 +                      'backgroundImage':fillSrc,
   1.614 +                      'borderColor':borderColor};
   1.615 +
   1.616 +        var offsetParent = rect.offsetParent;
   1.617 +        offsetParent.removeChild(rect);
   1.618 +
   1.619 +        makeShape(target,classID,colors);
   1.620 +    }
   1.621 +    if (typeof(window.previous_onresize) == 'function') { window.previous_onresize(); }
   1.622 +}
   1.623 +</script>