﻿/****************************************************************
*                                                              *
*  JQuery Curvy Corners by Mike Jolley                         *
*  http://blue-anvil.com                                       *
*  http://code.google.com/p/jquerycurvycorners/                *
*  ==========================================================  *
*                                                              *
*  Version 2.1.1 (Based on CC 2.1 beta)                          *
*                                                              *
*  Original by: Terry Riegel, Cameron Cooke and Tim Hutchison  *
*  Website: http://www.curvycorners.net                        *
*                                                              *
*  This library is free software; you can redistribute         *
*  it and/or modify it under the terms of the GNU              *
*  Lesser General Public License as published by the           *
*  Free Software Foundation; either version 2.1 of the         *
*  License, or (at your option) any later version.             *
*                                                              *
*  This library is distributed in the hope that it will        *
*  be useful, but WITHOUT ANY WARRANTY; without even the       *
*  implied warranty of MERCHANTABILITY or FITNESS FOR A        *
*  PARTICULAR PURPOSE. See the GNU Lesser General Public       *
*  License for more details.                                   *
*                                                              *
*  You should have received a copy of the GNU Lesser           *
*  General Public License along with this library;             *
*  Inc., 59 Temple Place, Suite 330, Boston,                   *
*  MA 02111-1307 USA                                           *
*                                                              *
****************************************************************/
(function ($) {
    function curvyCnrSpec(selText) { this.selectorText = selText; this.tlR = this.trR = this.blR = this.brR = 0; this.tlu = this.tru = this.blu = this.bru = ""; this.antiAlias = true; }; curvyCnrSpec.prototype.setcorner = function (tb, lr, radius, unit) { if (!tb) { this.tlR = this.trR = this.blR = this.brR = parseInt(radius); this.tlu = this.tru = this.blu = this.bru = unit; } else { propname = tb.charAt(0) + lr.charAt(0); this[propname + 'R'] = parseInt(radius); this[propname + 'u'] = unit; } }; curvyCnrSpec.prototype.get = function (prop) {
        if (/^(t|b)(l|r)(R|u)$/.test(prop)) return this[prop]; if (/^(t|b)(l|r)Ru$/.test(prop)) { var pname = prop.charAt(0) + prop.charAt(1); return this[pname + 'R'] + this[pname + 'u']; }
        if (/^(t|b)Ru?$/.test(prop)) {
            var tb = prop.charAt(0); tb += this[tb + 'lR'] > this[tb + 'rR'] ? 'l' : 'r'; var retval = this[tb + 'R']; if (prop.length === 3 && prop.charAt(2) === 'u')
                retval += this[tb = 'u']; return retval;
        }
        throw new Error('Don\'t recognize property ' + prop);
    }; curvyCnrSpec.prototype.radiusdiff = function (tb) { if (tb !== 't' && tb !== 'b') throw new Error("Param must be 't' or 'b'"); return Math.abs(this[tb + 'lR'] - this[tb + 'rR']); }; curvyCnrSpec.prototype.setfrom = function (obj) { this.tlu = this.tru = this.blu = this.bru = 'px'; if ('tl' in obj) this.tlR = obj.tl.radius; if ('tr' in obj) this.trR = obj.tr.radius; if ('bl' in obj) this.blR = obj.bl.radius; if ('br' in obj) this.brR = obj.br.radius; if ('antiAlias' in obj) this.antiAlias = obj.antiAlias; }; curvyCnrSpec.prototype.cloneOn = function (box) {
        var props = ['tl', 'tr', 'bl', 'br']; var converted = 0; var i, propu; for (i in props) if (!isNaN(i)) { propu = this[props[i] + 'u']; if (propu !== '' && propu !== 'px') { converted = new curvyCnrSpec; break; } }
        if (!converted)
            converted = this; else {
            var propi, propR, save = curvyBrowser.get_style(box, 'left'); for (i in props) if (!isNaN(i)) {
                propi = props[i]; propu = this[propi + 'u']; propR = this[propi + 'R']; if (propu !== 'px') { var save = box.style.left; box.style.left = propR + propu; propR = box.style.pixelLeft; box.style.left = save; }
                converted[propi + 'R'] = propR; converted[propi + 'u'] = 'px';
            }
            box.style.left = save;
        }
        return converted;
    }; curvyCnrSpec.prototype.radiusSum = function (tb) { if (tb !== 't' && tb !== 'b') throw new Error("Param must be 't' or 'b'"); return this[tb + 'lR'] + this[tb + 'rR']; }; curvyCnrSpec.prototype.radiusCount = function (tb) { var count = 0; if (this[tb + 'lR']) ++count; if (this[tb + 'rR']) ++count; return count; }; curvyCnrSpec.prototype.cornerNames = function () { var ret = []; if (this.tlR) ret.push('tl'); if (this.trR) ret.push('tr'); if (this.blR) ret.push('bl'); if (this.brR) ret.push('br'); return ret; }; if (typeof redrawList === 'undefined') redrawList = new Array; $.fn.corner = function (options) {
        var nativeCornersSupported = false; var checkWebkit, checkMozilla, checkStandard; try { checkWebkit = (document.body.style.WebkitBorderRadius !== undefined); } catch (err) { }
        try { checkMozilla = (document.body.style.MozBorderRadius !== undefined); } catch (err) { }
        try { checkStandard = (document.body.style.BorderRadius !== undefined); } catch (err) { }
        if (checkWebkit || checkMozilla || checkStandard) nativeCornersSupported = true; if (options instanceof curvyCnrSpec) { settings = options; }
        else { var options = jQuery.extend({ tl: { radius: 8 }, tr: { radius: 8 }, bl: { radius: 8 }, br: { radius: 8 }, antiAlias: true }, options); var settings = new curvyCnrSpec(this); settings.setfrom(options); }
        function curvyObject() {
            this.box = arguments[1]; this.settings = arguments[0]; var $$ = $(this.box); var boxDisp; this.masterCorners = new Array(); this.topContainer = this.bottomContainer = this.shell = boxDisp = null; var boxWidth = $$.innerWidth(); if ($$.is('table'))
                throw new Error("You cannot apply corners to " + this.box.tagName + " elements.", "Error"); if ($$.css('display') === 'inline') { $$.css('display', 'inline-block'); }
            if (!boxWidth) { this.applyCorners = function () { }; return; }
            if (arguments[0] instanceof curvyCnrSpec) { this.spec = arguments[0].cloneOn(this.box); } else { this.spec = new curvyCnrSpec(''); this.spec.setfrom(this.settings); }
            var borderWidth = $$.css("borderTopWidth") ? $$.css("borderTopWidth") : 0; var borderWidthB = $$.css("borderBottomWidth") ? $$.css("borderBottomWidth") : 0; var borderWidthL = $$.css("borderLeftWidth") ? $$.css("borderLeftWidth") : 0; var borderWidthR = $$.css("borderRightWidth") ? $$.css("borderRightWidth") : 0; var borderColour = $$.css("borderTopColor"); var borderColourB = $$.css("borderBottomColor"); var borderColourL = $$.css("borderLeftColor"); var borderColourR = $$.css("borderRightColor"); var borderStyle = $$.css("borderTopStyle"); var borderStyleB = $$.css("borderBottomStyle"); var borderStyleL = $$.css("borderLeftStyle"); var borderStyleR = $$.css("borderRightStyle"); var boxColour = $$.css("backgroundColor"); var backgroundImage = $$.css("backgroundImage"); var backgroundRepeat = $$.css("backgroundRepeat"); var backgroundPosX, backgroundPosY; backgroundPosX = $$.css("backgroundPositionX") ? $$.css("backgroundPositionX") : 0; backgroundPosY = $$.css("backgroundPositionY") ? $$.css("backgroundPositionY") : 0; var boxPosition = $$.css("position"); var topPadding = $$.css("paddingTop"); var bottomPadding = $$.css("paddingBottom"); var leftPadding = $$.css("paddingLeft"); var rightPadding = $$.css("paddingRight"); var border = $$.css("border"); var filter = jQuery.browser.version > 7 && $.browser.msie ? $$.css("filter") : null; var topMaxRadius = this.spec.get('tR'); var botMaxRadius = this.spec.get('bR'); var styleToNPx = function (val) { if (typeof val === 'number') return val; if (typeof val !== 'string') throw new Error('unexpected styleToNPx type ' + typeof val); var matches = /^[-\d.]([a-z]+)$/.exec(val); if (matches && matches[1] != 'px') throw new Error('Unexpected unit ' + matches[1]); if (isNaN(val = parseInt(val))) val = 0; return val; }; var min0Px = function (val) { return val <= 0 ? "0" : val + "px"; }; try { this.borderWidth = styleToNPx(borderWidth); this.borderWidthB = styleToNPx(borderWidthB); this.borderWidthL = styleToNPx(borderWidthL); this.borderWidthR = styleToNPx(borderWidthR); this.boxColour = curvyObject.format_colour(boxColour); this.topPadding = styleToNPx(topPadding); this.bottomPadding = styleToNPx(bottomPadding); this.leftPadding = styleToNPx(leftPadding); this.rightPadding = styleToNPx(rightPadding); this.boxWidth = boxWidth; this.boxHeight = $$.innerHeight(); this.borderColour = curvyObject.format_colour(borderColour); this.borderColourB = curvyObject.format_colour(borderColourB); this.borderColourL = curvyObject.format_colour(borderColourL); this.borderColourR = curvyObject.format_colour(borderColourR); this.borderString = this.borderWidth + "px" + " " + borderStyle + " " + this.borderColour; this.borderStringB = this.borderWidthB + "px" + " " + borderStyleB + " " + this.borderColourB; this.borderStringL = this.borderWidthL + "px" + " " + borderStyleL + " " + this.borderColourL; this.borderStringR = this.borderWidthR + "px" + " " + borderStyleR + " " + this.borderColourR; this.backgroundImage = (backgroundImage != "none" && backgroundImage != "initial") ? backgroundImage : ""; this.backgroundRepeat = backgroundRepeat; }
            catch (e) { }
            var clientHeight = this.boxHeight; var clientWidth = boxWidth; if ($.browser.opera) {
                backgroundPosX = styleToNPx(backgroundPosX); backgroundPosY = styleToNPx(backgroundPosY); if (backgroundPosX) { var t = clientWidth + this.borderWidthL + this.borderWidthR; if (backgroundPosX > t) backgroundPosX = t; backgroundPosX = (t / backgroundPosX * 100) + '%'; }
                if (backgroundPosY) { var t = clientHeight + this.borderWidth + this.borderWidthB; if (backgroundPosY > t) backgroundPosY = t; backgroundPosY = (t / backgroundPosY * 100) + '%'; } 
            }
            this.contentContainer = document.createElement("div"); if (filter) this.contentContainer.style.filter = filter; while (this.box.firstChild) this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild)); if (boxPosition != "absolute") $$.css("position", "relative"); this.box.style.padding = '0'; this.box.style.border = this.box.style.backgroundImage = 'none'; this.box.style.backgroundColor = 'transparent'; this.box.style.width = (clientWidth + this.borderWidthL + this.borderWidthR) + 'px'; this.box.style.height = (clientHeight + this.borderWidth + this.borderWidthB) + 'px'; var newMainContainer = document.createElement("div"); $(newMainContainer).css({ width: clientWidth + 'px', 'padding': "0", position: "absolute", height: min0Px(clientHeight + this.borderWidth + this.borderWidthB - topMaxRadius - botMaxRadius), top: topMaxRadius + "px", left: "0", 'backgroundColor': boxColour, 'backgroundImage': this.backgroundImage, 'backgroundRepeat': this.backgroundRepeat, 'direction': 'ltr' }); if (filter) $(newMainContainer).css('filter', 'filter'); if (this.borderWidthL)
                $(newMainContainer).css('borderLeft', this.borderStringL); if (this.borderWidth && !topMaxRadius)
                $(newMainContainer).css('borderTop', this.borderString); if (this.borderWidthR)
                $(newMainContainer).css('borderRight', this.borderStringR); if (this.borderWidthB && !botMaxRadius)
                $(newMainContainer).css('borderBottom', this.borderStringB); this.shell = this.box.appendChild(newMainContainer); boxWidth = $(this.shell).css("width"); if (boxWidth === "" || boxWidth === "auto" || boxWidth.indexOf("%") !== -1) throw Error('Shell width is ' + boxWidth); this.boxWidth = (boxWidth != "" && boxWidth != "auto" && boxWidth.indexOf("%") == -1) ? parseInt(boxWidth) : $(this.shell).width(); this.applyCorners = function () {
                    this.backgroundPosX = this.backgroundPosY = 0; if (this.backgroundObject) { var bgOffset = function (style, imglen, boxlen) { if (style === 0) return 0; var retval; if (style === 'right' || style === 'bottom') return boxlen - imglen; if (style === 'center') return (boxlen - imglen) / 2; if (style.indexOf('%') > 0) return (boxlen - imglen) / (100 / parseInt(style)); return styleToNPx(style); }; this.backgroundPosX = bgOffset(backgroundPosX, this.backgroundObject.width, clientWidth); this.backgroundPosY = bgOffset(backgroundPosY, this.backgroundObject.height, clientHeight); }
                    else if (this.backgroundImage) { this.backgroundPosX = styleToNPx(backgroundPosX); this.backgroundPosY = styleToNPx(backgroundPosY); }
                    if (topMaxRadius) { newMainContainer = document.createElement("div"); $(newMainContainer).css({ width: this.boxWidth + "px", 'fontSize': "1px", overflow: "hidden", position: "absolute", 'paddingLeft': this.borderWidth + "px", 'paddingRight': this.borderWidth + "px", height: topMaxRadius + "px", top: -topMaxRadius + "px", left: -this.borderWidthL + "px" }); this.topContainer = this.shell.appendChild(newMainContainer); }
                    if (botMaxRadius) { var newMainContainer = document.createElement("div"); $(newMainContainer).css({ width: this.boxWidth + "px", 'fontSize': "1px", overflow: "hidden", position: "absolute", 'paddingLeft': this.borderWidthB + "px", 'paddingRight': this.borderWidthB + "px", height: botMaxRadius + "px", bottom: -botMaxRadius + "px", left: -this.borderWidthL + "px" }); this.bottomContainer = this.shell.appendChild(newMainContainer); }
                    var corners = this.spec.cornerNames(); for (var i in corners) if (!isNaN(i)) {
                        var cc = corners[i]; var specRadius = this.spec[cc + 'R']; var bwidth, bcolor, borderRadius, borderWidthTB; if (cc == "tr" || cc == "tl") { bwidth = this.borderWidth; bcolor = this.borderColour; borderWidthTB = this.borderWidth; } else { bwidth = this.borderWidthB; bcolor = this.borderColourB; borderWidthTB = this.borderWidthB; }
                        borderRadius = specRadius - borderWidthTB; var newCorner = document.createElement("div"); $(newCorner).css({ position: "absolute", "font-size": "1px", overflow: "hidden" }).height(this.spec.get(cc + 'Ru')).width(this.spec.get(cc + 'Ru')); var intx, inty, outsideColour; var trans = filter ? parseInt(/alpha\(opacity.(\d+)\)/.exec(filter)[1]) : 100; for (intx = 0; intx < specRadius; ++intx) {
                            var y1 = (intx + 1 >= borderRadius) ? -1 : Math.floor(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow(intx + 1, 2))) - 1; if (borderRadius != specRadius) { var y2 = (intx >= borderRadius) ? -1 : Math.ceil(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow(intx, 2))); var y3 = (intx + 1 >= specRadius) ? -1 : Math.floor(Math.sqrt(Math.pow(specRadius, 2) - Math.pow((intx + 1), 2))) - 1; }
                            var y4 = (intx >= specRadius) ? -1 : Math.ceil(Math.sqrt(Math.pow(specRadius, 2) - Math.pow(intx, 2))); if (y1 > -1) this.drawPixel(intx, 0, this.boxColour, trans, (y1 + 1), newCorner, true, specRadius); if (borderRadius != specRadius) {
                                if (this.spec.antiAlias) {
                                    for (inty = y1 + 1; inty < y2; ++inty) {
                                        if (this.backgroundImage != "") { var borderFract = curvyObject.pixelFraction(intx, inty, borderRadius) * 100; this.drawPixel(intx, inty, bcolor, trans, 1, newCorner, borderFract >= 30, specRadius); }
                                        else if (this.boxColour !== 'transparent') { var pixelcolour = curvyObject.BlendColour(this.boxColour, bcolor, curvyObject.pixelFraction(intx, inty, borderRadius)); this.drawPixel(intx, inty, pixelcolour, trans, 1, newCorner, false, specRadius); }
                                        else this.drawPixel(intx, inty, bcolor, trans >> 1, 1, newCorner, false, specRadius);
                                    }
                                    if (y3 >= y2) { if (y2 == -1) y2 = 0; this.drawPixel(intx, y2, bcolor, trans, (y3 - y2 + 1), newCorner, false, 0); }
                                    outsideColour = bcolor; inty = y3;
                                }
                                else { if (y3 > y1) { this.drawPixel(intx, (y1 + 1), bcolor, trans, (y3 - y1), newCorner, false, 0); } } 
                            }
                            else { outsideColour = this.boxColour; inty = y1; }
                            if (this.spec.antiAlias && this.boxColour !== 'transparent') { while (++inty < y4) { this.drawPixel(intx, inty, outsideColour, (curvyObject.pixelFraction(intx, inty, specRadius) * trans), 1, newCorner, borderWidthTB <= 0, specRadius); } } 
                        }
                        for (var t = 0, k = newCorner.childNodes.length; t < k; ++t) {
                            var pixelBar = newCorner.childNodes[t]; var pixelBarTop = parseInt($(pixelBar).css('top')); var pixelBarLeft = parseInt($(pixelBar).css('left')); var pixelBarHeight = parseInt($(pixelBar).css('height')); if (cc == "tl" || cc == "bl") { $(pixelBar).css('left', (specRadius - pixelBarLeft - 1) + "px"); }
                            if (cc == "tr" || cc == "tl") { $(pixelBar).css('top', (specRadius - pixelBarHeight - pixelBarTop) + "px"); }
                            $(pixelBar).css('backgroundRepeat', this.backgroundRepeat); if (this.backgroundImage) switch (cc) { case "tr": $(pixelBar).css('backgroundPosition', (this.backgroundPosX - this.borderWidthL + specRadius - clientWidth - pixelBarLeft) + "px " + (this.backgroundPosY + pixelBarHeight + pixelBarTop + this.borderWidth - specRadius) + "px"); break; case "tl": $(pixelBar).css('backgroundPosition', (this.backgroundPosX - specRadius + pixelBarLeft + 1 + this.borderWidthL) + "px " + (this.backgroundPosY - specRadius + pixelBarHeight + pixelBarTop + this.borderWidth) + "px"); break; case "bl": $(pixelBar).css('backgroundPosition', (this.backgroundPosX - specRadius + pixelBarLeft + 1 + this.borderWidthL) + "px " + (this.backgroundPosY - clientHeight - this.borderWidth + (!jQuery.support.boxModel ? pixelBarTop : -pixelBarTop) + specRadius) + "px"); break; case "br": if (!jQuery.support.boxModel) { $(pixelBar).css('backgroundPosition', (this.backgroundPosX - this.borderWidthL - clientWidth + specRadius - pixelBarLeft) + "px " + (this.backgroundPosY - clientHeight - this.borderWidth + pixelBarTop + specRadius) + "px"); } else { $(pixelBar).css('backgroundPosition', (this.backgroundPosX - this.borderWidthL - clientWidth + specRadius - pixelBarLeft) + "px " + (this.backgroundPosY - clientHeight - this.borderWidth + specRadius - pixelBarTop) + "px"); } } 
                        }
                        switch (cc) { case "tl": $(newCorner).css('top', newCorner.style.left = "0"); this.topContainer.appendChild(newCorner); break; case "tr": $(newCorner).css('top', newCorner.style.right = "0"); this.topContainer.appendChild(newCorner); break; case "bl": $(newCorner).css('bottom', newCorner.style.left = "0"); this.bottomContainer.appendChild(newCorner); break; case "br": $(newCorner).css('bottom', newCorner.style.right = "0"); this.bottomContainer.appendChild(newCorner); } 
                    }
                    var radiusDiff = { t: this.spec.radiusdiff('t'), b: this.spec.radiusdiff('b') }; for (z in radiusDiff) {
                        if (typeof z === 'function') continue; if (!this.spec.get(z + 'R')) continue; if (radiusDiff[z]) { var smallerCornerType = (this.spec[z + "lR"] < this.spec[z + "rR"]) ? z + "l" : z + "r"; var newFiller = document.createElement("div"); $(newFiller).css({ 'height': radiusDiff[z] + "px", 'width': this.spec.get(smallerCornerType + 'Ru'), 'position': "absolute", 'fontSize': "1px", 'overflow': "hidden", 'backgroundColor': this.boxColour, 'backgroundImage': this.backgroundImage, 'backgroundRepeat': this.backgroundRepeat }); if (filter) $(newFiller).css('filter', 'filter'); switch (smallerCornerType) { case "tl": $(newFiller).css({ 'bottom': '', 'left': '0', 'borderLeft': this.borderStringL, 'backgroundPosition': this.backgroundPosX + "px " + (this.borderWidth + this.backgroundPosY - this.spec.tlR) + "px" }); this.topContainer.appendChild(newFiller); break; case "tr": $(newFiller).css({ 'bottom': '', 'right': '0', 'borderRight': this.borderStringR, 'backgroundPosition': (this.backgroundPosX - this.boxWidth + this.spec.trR) + "px " + (this.borderWidth + this.backgroundPosY - this.spec.trR) + "px" }); this.topContainer.appendChild(newFiller); break; case "bl": $(newFiller).css({ 'top': '', 'left': '0', 'borderLeft': this.borderStringL, 'backgroundPosition': this.backgroundPosX + "px " + (this.backgroundPosY - this.borderWidth - this.boxHeight + radiusDiff[z] + this.spec.blR) + "px" }); this.bottomContainer.appendChild(newFiller); break; case "br": $(newFiller).css({ 'top': '', 'right': '0', 'borderRight': this.borderStringR, 'backgroundPosition': (this.borderWidthL + this.backgroundPosX - this.boxWidth + this.spec.brR) + "px " + (this.backgroundPosY - this.borderWidth - this.boxHeight + radiusDiff[z] + this.spec.brR) + "px" }); this.bottomContainer.appendChild(newFiller); } }
                        var newFillerBar = document.createElement("div"); if (filter) $(newFillerBar).css('filter', 'filter'); $(newFillerBar).css({ 'position': "relative", 'fontSize': "1px", 'overflow': "hidden", 'width': this.fillerWidth(z), 'backgroundColor': this.boxColour, 'backgroundImage': this.backgroundImage, 'backgroundRepeat': this.backgroundRepeat }); switch (z) {
                            case "t": if (this.topContainer) {
                                    if (!jQuery.support.boxModel) { $(newFillerBar).css('height', 100 + topMaxRadius + "px"); } else { $(newFillerBar).css('height', 100 + topMaxRadius - this.borderWidth + "px"); }
                                    $(newFillerBar).css('marginLeft', this.spec.tlR ? (this.spec.tlR - this.borderWidthL) + "px" : "0"); $(newFillerBar).css('borderTop', this.borderString); if (this.backgroundImage) { var x_offset = this.spec.tlR ? (this.borderWidthL + this.backgroundPosX - this.spec.tlR) + "px " : this.backgroundPosX + "px "; $(newFillerBar).css('backgroundPosition', x_offset + this.backgroundPosY + "px"); $(this.shell).css('backgroundPosition', this.backgroundPosX + "px " + (this.backgroundPosY - topMaxRadius + this.borderWidthL) + "px"); }
                                    this.topContainer.appendChild(newFillerBar);
                                }
                                break; case "b": if (this.bottomContainer) {
                                    if (!jQuery.support.boxModel) { $(newFillerBar).css('height', botMaxRadius + "px"); } else { $(newFillerBar).css('height', botMaxRadius - this.borderWidthB + "px"); }
                                    $(newFillerBar).css('marginLeft', this.spec.blR ? (this.spec.blR - this.borderWidthL) + "px" : "0"); $(newFillerBar).css('borderBottom', this.borderStringB); if (this.backgroundImage) { var x_offset = this.spec.blR ? (this.backgroundPosX + this.borderWidthL - this.spec.blR) + "px " : this.backgroundPosX + "px "; $(newFillerBar).css('backgroundPosition', x_offset + (this.backgroundPosY - clientHeight - this.borderWidth + botMaxRadius) + "px"); }
                                    this.bottomContainer.appendChild(newFillerBar);
                                } 
                        } 
                    }
                    z = clientWidth; if (jQuery.support.boxModel) z -= this.leftPadding + this.rightPadding; $(this.contentContainer).css({ 'position': 'absolute', 'left': this.borderWidthL + "px", 'paddingTop': this.topPadding + "px", 'top': this.borderWidth + "px", 'paddingLeft': this.leftPadding + "px", 'paddingRight': this.rightPadding + "px", 'width': z + "px", 'textAlign': $$.css('textAlign') }).addClass('autoPadDiv'); $$.css('textAlign', 'left').addClass('hasCorners'); this.box.appendChild(this.contentContainer); if (boxDisp) $(boxDisp).css('display', boxDispSave);
                }; if (this.backgroundImage) { backgroundPosX = this.backgroundCheck(backgroundPosX); backgroundPosY = this.backgroundCheck(backgroundPosY); if (this.backgroundObject) { this.backgroundObject.holdingElement = this; this.dispatch = this.applyCorners; this.applyCorners = function () { if (this.backgroundObject.complete) this.dispatch(); else this.backgroundObject.onload = new Function('$(this.holdingElement).dispatch();'); }; } } 
        }; curvyObject.prototype.backgroundCheck = function (style) {
            if (style === 'top' || style === 'left' || parseInt(style) === 0) return 0; if (!(/^[-\d.]+px$/.test(style)) && !this.backgroundObject) { this.backgroundObject = new Image; var imgName = function (str) { var matches = /url\("?([^'"]+)"?\)/.exec(str); return (matches ? matches[1] : str); }; this.backgroundObject.src = imgName(this.backgroundImage); }
            return style;
        }; curvyObject.prototype.drawPixel = function (intx, inty, colour, transAmount, height, newCorner, image, cornerRadius) {
            var pixel = document.createElement("div"); $(pixel).css({ "height": height + "px", "width": "1px", "position": "absolute", "font-size": "1px", "overflow": "hidden", "top": inty + "px", "left": intx + "px", "background-color": colour }); var topMaxRadius = this.spec.get('tR'); if (image && this.backgroundImage != "")
            { $(pixel).css({ "background-position": "-" + (this.boxWidth - (cornerRadius - intx) + this.borderWidth) + "px -" + ((this.boxHeight + topMaxRadius + inty) - this.borderWidth) + "px", "background-image": this.backgroundImage }); }
            if (transAmount != 100)
                $(pixel).css({ opacity: (transAmount / 100) }); newCorner.appendChild(pixel);
        }; curvyObject.prototype.fillerWidth = function (tb) {
            var b_width, f_width; b_width = !jQuery.support.boxModel ? 0 : this.spec.radiusCount(tb) * this.borderWidthL; if ((f_width = this.boxWidth - this.spec.radiusSum(tb) + b_width) < 0)
                throw Error("Radius exceeds box width"); return f_width + 'px';
        }; curvyObject.getComputedColour = function (colour) {
            var d = document.createElement('DIV'); d.style.backgroundColor = colour; document.body.appendChild(d); if (window.getComputedStyle) { var rtn = document.defaultView.getComputedStyle(d, null).getPropertyValue('background-color'); d.parentNode.removeChild(d); if (rtn.substr(0, 3) === "rgb") rtn = curvyObject.rgb2Hex(rtn); return rtn; }
            else { var rng = document.body.createTextRange(); rng.moveToElementText(d); rng.execCommand('ForeColor', false, colour); var iClr = rng.queryCommandValue('ForeColor'); var rgb = "rgb(" + (iClr & 0xFF) + ", " + ((iClr & 0xFF00) >> 8) + ", " + ((iClr & 0xFF0000) >> 16) + ")"; d.parentNode.removeChild(d); rng = null; return curvyObject.rgb2Hex(rgb); } 
        }; curvyObject.BlendColour = function (Col1, Col2, Col1Fraction) {
            if (Col1 === 'transparent' || Col2 === 'transparent') throw Error('Cannot blend with transparent'); if (Col1.charAt(0) !== '#') { Col1 = curvyObject.format_colour(Col1); }
            if (Col2.charAt(0) !== '#') { Col2 = curvyObject.format_colour(Col2); }
            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 "#" + curvyObject.IntToHex(endRed) + curvyObject.IntToHex(endGreen) + curvyObject.IntToHex(endBlue);
        }; curvyObject.IntToHex = function (strNum)
        { var hexdig = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']; return hexdig[strNum >>> 4] + '' + hexdig[strNum & 15]; }; curvyObject.pixelFraction = function (x, y, r) {
            var fraction; var rsquared = r * r; var xvalues = new Array(2); var yvalues = new Array(2); var point = 0; var whatsides = ""; var intersect = Math.sqrt(rsquared - Math.pow(x, 2)); if (intersect >= y && intersect < (y + 1)) { whatsides = "Left"; xvalues[point] = 0; yvalues[point] = intersect - y; ++point; }
            intersect = Math.sqrt(rsquared - Math.pow(y + 1, 2)); if (intersect >= x && intersect < (x + 1)) { whatsides += "Top"; xvalues[point] = intersect - x; yvalues[point] = 1; ++point; }
            intersect = Math.sqrt(rsquared - Math.pow(x + 1, 2)); if (intersect >= y && intersect < (y + 1)) { whatsides += "Right"; xvalues[point] = 1; yvalues[point] = intersect - y; ++point; }
            intersect = Math.sqrt(rsquared - Math.pow(y, 2)); if (intersect >= x && intersect < (x + 1)) { whatsides += "Bottom"; xvalues[point] = intersect - x; yvalues[point] = 0; }
            switch (whatsides) { case "LeftRight": fraction = Math.min(yvalues[0], yvalues[1]) + ((Math.max(yvalues[0], yvalues[1]) - Math.min(yvalues[0], yvalues[1])) / 2); break; case "TopRight": fraction = 1 - (((1 - xvalues[0]) * (1 - yvalues[1])) / 2); break; case "TopBottom": fraction = Math.min(xvalues[0], xvalues[1]) + ((Math.max(xvalues[0], xvalues[1]) - Math.min(xvalues[0], xvalues[1])) / 2); break; case "LeftBottom": fraction = yvalues[0] * xvalues[1] / 2; break; default: fraction = 1; }
            return fraction;
        }; curvyObject.rgb2Hex = function (rgbColour) {
            try { var rgbArray = curvyObject.rgb2Array(rgbColour); var red = parseInt(rgbArray[0]); var green = parseInt(rgbArray[1]); var blue = parseInt(rgbArray[2]); var hexColour = "#" + curvyObject.IntToHex(red) + curvyObject.IntToHex(green) + curvyObject.IntToHex(blue); }
            catch (e) { alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex"); }
            return hexColour;
        }; curvyObject.rgb2Array = function (rgbColour)
        { var rgbValues = rgbColour.substring(4, rgbColour.indexOf(")")); return rgbValues.split(", "); }; curvyObject.format_colour = function (colour) {
            if (colour != "" && colour != "transparent") {
                if (colour.substr(0, 3) === "rgb") { colour = curvyObject.rgb2Hex(colour); }
                else if (colour.charAt(0) !== '#') { colour = getComputedColour(colour); }
                else if (colour.length === 4) { colour = "#" + colour.charAt(1) + colour.charAt(1) + colour.charAt(2) + colour.charAt(2) + colour.charAt(3) + colour.charAt(3); } 
            }
            return colour;
        }; return this.each(function () {
            if (!$(this).is('.hasCorners')) {
                if (nativeCornersSupported) {
                    if (settings.get('tlR')) { $(this).css({ 'border-top-left-radius': settings.get('tlR') + 'px', '-moz-border-radius-topleft': settings.get('tlR') + 'px', '-webkit-border-top-left-radius': settings.get('tlR') + 'px' }); }
                    if (settings.get('trR')) { $(this).css({ 'border-top-right-radius': settings.get('trR') + 'px', '-moz-border-radius-topright': settings.get('trR') + 'px', '-webkit-border-top-right-radius': settings.get('trR') + 'px' }); }
                    if (settings.get('blR')) { $(this).css({ 'border-bottom-left-radius': settings.get('blR') + 'px', '-moz-border-radius-bottomleft': settings.get('blR') + 'px', '-webkit-border-bottom-left-radius': settings.get('blR') + 'px' }); }
                    if (settings.get('brR')) { $(this).css({ 'border-bottom-right-radius': settings.get('brR') + 'px', '-moz-border-radius-bottomright': settings.get('brR') + 'px', '-webkit-border-bottom-right-radius': settings.get('brR') + 'px' }); } 
                } else {
                    if (!$(this).is('.drawn')) {
                        $(this).addClass('drawn'); thestyles = $(this).attr('style'); if (thestyles == 'undefined') { thestyles = ''; }
                        redrawList.push({ node: this, spec: settings, style: thestyles, copy: $(this).clone(true) });
                    }
                    var obj = new curvyObject(settings, this); obj.applyCorners();
                } 
            } 
        });
    }; $.fn.removeCorners = function () { return this.each(function (i, e) { thisdiv = e; $.each(redrawList, function (intIndex, list) { if (list.node == thisdiv && $('.autoPadDiv', thisdiv).size() > 0) { $(thisdiv).html($(thisdiv).children('.autoPadDiv:first').contents()); style = list.style == 'undefined' ? list.style : ''; $(thisdiv).removeClass('hasCorners').attr('style', style); return false; } }); }); }; $.fn.redrawCorners = function () { return this.each(function (i, e) { thisdiv = e; $.each(redrawList, function (intIndex, list) { if (list.node == thisdiv) { $(thisdiv).corner(list.spec); return false; } }); }); }; $.fn.dispatch = function () { return this.each(function (i, e) { obj = e; if ('dispatch' in obj) obj.dispatch(); else throw Error('No dispatch function') }); }; $(function () {
        if ($.browser.msie) {
            try { document.execCommand("BackgroundImageCache", false, true); } catch (e) { }; function units(num) { if (!parseInt(num)) return 'px'; var matches = /^[\d.]+(\w+)$/.exec(num); return matches[1]; }; var t, i, j; function procIEStyles(rule) {
                var style = rule.style; if (jQuery.browser.version > 6.0) { var allR = style['-moz-border-radius'] || 0; var tR = style['-moz-border-radius-topright'] || 0; var tL = style['-moz-border-radius-topleft'] || 0; var bR = style['-moz-border-radius-bottomright'] || 0; var bL = style['-moz-border-radius-bottomleft'] || 0; }
                else { var allR = style['moz-border-radius'] || 0; var tR = style['moz-border-radius-topright'] || 0; var tL = style['moz-border-radius-topleft'] || 0; var bR = style['moz-border-radius-bottomright'] || 0; var bL = style['moz-border-radius-bottomleft'] || 0; }
                if (allR) { var t = allR.split('/'); t = t[0].split(/\s+/); if (t[t.length - 1] === '') t.pop(); switch (t.length) { case 3: tL = t[0]; tR = bL = t[1]; bR = t[2]; allR = false; break; case 2: tL = bR = t[0]; tR = bL = t[1]; allR = false; case 1: break; case 4: tL = t[0]; tR = t[1]; bR = t[2]; bL = t[3]; allR = false; break; default: alert('Illegal corners specification: ' + allR); } }
                if (allR || tL || tR || bR || bL) {
                    var settings = new curvyCnrSpec(rule.selectorText); if (allR)
                        settings.setcorner(null, null, parseInt(allR), units(allR)); else { if (tR) settings.setcorner('t', 'r', parseInt(tR), units(tR)); if (tL) settings.setcorner('t', 'l', parseInt(tL), units(tL)); if (bL) settings.setcorner('b', 'l', parseInt(bL), units(bL)); if (bR) settings.setcorner('b', 'r', parseInt(bR), units(bR)); }
                    $(rule.selectorText).corner(settings);
                } 
            }
            for (t = 0; t < document.styleSheets.length; ++t) {
                try {
                    if (document.styleSheets[t].imports) { for (i = 0; i < document.styleSheets[t].imports.length; ++i) { for (j = 0; j < document.styleSheets[t].imports[i].rules.length; ++j) { procIEStyles(document.styleSheets[t].imports[i].rules[j]); } } }
                    for (i = 0; i < document.styleSheets[t].rules.length; ++i)
                        procIEStyles(document.styleSheets[t].rules[i]);
                }
                catch (e) { } 
            } 
        } else if ($.browser.opera) {
            try { checkStandard = (document.body.style.BorderRadius !== undefined); } catch (err) { }
            if (!checkStandard) {
                function opera_contains_border_radius(sheetnumber) { return /border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(sheetnumber).ownerNode.text); }; rules = []; for (t = 0; t < document.styleSheets.length; ++t) {
                    if (opera_contains_border_radius(t)) {
                        var txt = document.styleSheets.item(sheetnumber).ownerNode.text; txt = txt.replace(/\/\*(\n|\r|.)*?\*\//g, ''); var pat = new RegExp("^\\s*([\\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, cornerspec = new curvyCnrSpec(matches[1]); while ((submatches = pat2.exec(matches[2])) !== null) {
                                if (submatches[1] !== "z-")
                                    cornerspec.setcorner(submatches[3], submatches[4], submatches[5], submatches[6]); rules.push(cornerspec);
                            } 
                        } 
                    } 
                }
                for (i in rules) if (!isNaN(i))
                    $(rules[i].selectorText).corner(rules[i]);
            } 
        } 
    });
})(jQuery);



//function browserdetect() { var A = navigator.userAgent.toLowerCase(); this.isIE = A.indexOf("msie") > -1; this.ieVer = this.isIE ? /msie\s(\d\.\d)/.exec(A)[1] : 0; this.isMoz = A.indexOf("firefox") != -1; this.isSafari = A.indexOf("safari") != -1; this.quirksMode = this.isIE && (!document.compatMode || document.compatMode.indexOf("BackCompat") > -1); this.isOp = "opera" in window; this.isWebKit = A.indexOf("webkit") != -1; if (this.isIE) { this.get_style = function (D, F) { if (!(F in D.currentStyle)) { return "" } var C = /^([\d.]+)(\w*)/.exec(D.currentStyle[F]); if (!C) { return D.currentStyle[F] } if (C[1] == 0) { return "0" } if (C[2] && C[2] !== "px") { var B = D.style.left; var E = D.runtimeStyle.left; D.runtimeStyle.left = D.currentStyle.left; D.style.left = C[1] + C[2]; C[0] = D.style.pixelLeft; D.style.left = B; D.runtimeStyle.left = E } return C[0] } } else { this.get_style = function (B, C) { C = C.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); return document.defaultView.getComputedStyle(B, "").getPropertyValue(C) } } } var curvyBrowser = new browserdetect; if (curvyBrowser.isIE) { try { document.execCommand("BackgroundImageCache", false, true) } catch (e) { } } function curvyCnrSpec(A) { this.selectorText = A; this.tlR = this.trR = this.blR = this.brR = 0; this.tlu = this.tru = this.blu = this.bru = ""; this.antiAlias = true } curvyCnrSpec.prototype.setcorner = function (B, C, A, D) { if (!B) { this.tlR = this.trR = this.blR = this.brR = parseInt(A); this.tlu = this.tru = this.blu = this.bru = D } else { propname = B.charAt(0) + C.charAt(0); this[propname + "R"] = parseInt(A); this[propname + "u"] = D } }; curvyCnrSpec.prototype.get = function (D) { if (/^(t|b)(l|r)(R|u)$/.test(D)) { return this[D] } if (/^(t|b)(l|r)Ru$/.test(D)) { var C = D.charAt(0) + D.charAt(1); return this[C + "R"] + this[C + "u"] } if (/^(t|b)Ru?$/.test(D)) { var B = D.charAt(0); B += this[B + "lR"] > this[B + "rR"] ? "l" : "r"; var A = this[B + "R"]; if (D.length === 3 && D.charAt(2) === "u") { A += this[B = "u"] } return A } throw new Error("Don't recognize property " + D) }; curvyCnrSpec.prototype.radiusdiff = function (A) { if (A !== "t" && A !== "b") { throw new Error("Param must be 't' or 'b'") } return Math.abs(this[A + "lR"] - this[A + "rR"]) }; curvyCnrSpec.prototype.setfrom = function (A) { this.tlu = this.tru = this.blu = this.bru = "px"; if ("tl" in A) { this.tlR = A.tl.radius } if ("tr" in A) { this.trR = A.tr.radius } if ("bl" in A) { this.blR = A.bl.radius } if ("br" in A) { this.brR = A.br.radius } if ("antiAlias" in A) { this.antiAlias = A.antiAlias } }; curvyCnrSpec.prototype.cloneOn = function (G) { var E = ["tl", "tr", "bl", "br"]; var H = 0; var C, A; for (C in E) { if (!isNaN(C)) { A = this[E[C] + "u"]; if (A !== "" && A !== "px") { H = new curvyCnrSpec; break } } } if (!H) { H = this } else { var B, D, F = curvyBrowser.get_style(G, "left"); for (C in E) { if (!isNaN(C)) { B = E[C]; A = this[B + "u"]; D = this[B + "R"]; if (A !== "px") { var F = G.style.left; G.style.left = D + A; D = G.style.pixelLeft; G.style.left = F } H[B + "R"] = D; H[B + "u"] = "px" } } G.style.left = F } return H }; curvyCnrSpec.prototype.radiusSum = function (A) { if (A !== "t" && A !== "b") { throw new Error("Param must be 't' or 'b'") } return this[A + "lR"] + this[A + "rR"] }; curvyCnrSpec.prototype.radiusCount = function (A) { var B = 0; if (this[A + "lR"]) { ++B } if (this[A + "rR"]) { ++B } return B }; curvyCnrSpec.prototype.cornerNames = function () { var A = []; if (this.tlR) { A.push("tl") } if (this.trR) { A.push("tr") } if (this.blR) { A.push("bl") } if (this.brR) { A.push("br") } return A }; function operasheet(C) { var A = document.styleSheets.item(C).ownerNode.text; A = A.replace(/\/\*(\n|\r|.)*?\*\//g, ""); var D = new RegExp("^s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}", "mg"); var G; this.rules = []; while ((G = D.exec(A)) !== null) { var F = new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)", "g"); var E, B = new curvyCnrSpec(G[1]); while ((E = F.exec(G[2])) !== null) { if (E[1] !== "z-") { B.setcorner(E[3], E[4], E[5], E[6]) } } this.rules.push(B) } } operasheet.contains_border_radius = function (A) { return /border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(A).ownerNode.text) }; function curvyCorners() { var G, D, E, B, J; if (typeof arguments[0] !== "object") { throw curvyCorners.newError("First parameter of curvyCorners() must be an object.") } if (arguments[0] instanceof curvyCnrSpec) { B = arguments[0]; if (!B.selectorText && typeof arguments[1] === "string") { B.selectorText = arguments[1] } } else { if (typeof arguments[1] !== "object" && typeof arguments[1] !== "string") { throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.") } D = arguments[1]; if (typeof D !== "string") { D = "" } if (D !== "" && D.charAt(0) !== "." && "autoPad" in arguments[0]) { D = "." + D } B = new curvyCnrSpec(D); B.setfrom(arguments[0]) } if (B.selectorText) { J = 0; var I = B.selectorText.replace(/\s+$/, "").split(/,\s*/); E = new Array; function A(M) { var L = M.split("#"); return (L.length === 2 ? "#" : "") + L.pop() } for (G = 0; G < I.length; ++G) { var K = A(I[G]); var H = K.split(" "); switch (K.charAt(0)) { case "#": D = H.length === 1 ? K : H[0]; D = document.getElementById(D.substr(1)); if (D === null) { curvyCorners.alert("No object with ID " + K + " exists yet.\nCall curvyCorners(settings, obj) when it is created.") } else { if (H.length === 1) { E.push(D) } else { E = E.concat(curvyCorners.getElementsByClass(H[1], D)) } } break; default: if (H.length === 1) { E = E.concat(curvyCorners.getElementsByClass(K)) } else { var C = curvyCorners.getElementsByClass(H[0]); for (D = 0; D < C.length; ++D) { E = E.concat(curvyCorners.getElementsByClass(H[1], C)) } } } } } else { J = 1; E = arguments } for (G = J, D = E.length; G < D; ++G) { if (E[G] && (!("IEborderRadius" in E[G].style) || E[G].style.IEborderRadius != "set")) { if (E[G].className && E[G].className.indexOf("curvyRedraw") !== -1) { if (typeof curvyCorners.redrawList === "undefined") { curvyCorners.redrawList = new Array } curvyCorners.redrawList.push({ node: E[G], spec: B, copy: E[G].cloneNode(false) }) } E[G].style.IEborderRadius = "set"; var F = new curvyObject(B, E[G]); F.applyCorners() } } } curvyCorners.prototype.applyCornersToAll = function () { curvyCorners.alert("This function is now redundant. Just call curvyCorners(). See documentation.") }; curvyCorners.redraw = function () { if (!curvyBrowser.isOp && !curvyBrowser.isIE) { return } if (!curvyCorners.redrawList) { throw curvyCorners.newError("curvyCorners.redraw() has nothing to redraw.") } var E = curvyCorners.bock_redraw; curvyCorners.block_redraw = true; for (var A in curvyCorners.redrawList) { if (isNaN(A)) { continue } var D = curvyCorners.redrawList[A]; if (!D.node.clientWidth) { continue } var B = D.copy.cloneNode(false); for (var C = D.node.firstChild; C != null; C = C.nextSibling) { if (C.className === "autoPadDiv") { break } } if (!C) { curvyCorners.alert("Couldn't find autoPad DIV"); break } D.node.parentNode.replaceChild(B, D.node); while (C.firstChild) { B.appendChild(C.removeChild(C.firstChild)) } D = new curvyObject(D.spec, D.node = B); D.applyCorners() } curvyCorners.block_redraw = E }; curvyCorners.adjust = function (obj, prop, newval) { if (curvyBrowser.isOp || curvyBrowser.isIE) { if (!curvyCorners.redrawList) { throw curvyCorners.newError("curvyCorners.adjust() has nothing to adjust.") } var i, j = curvyCorners.redrawList.length; for (i = 0; i < j; ++i) { if (curvyCorners.redrawList[i].node === obj) { break } } if (i === j) { throw curvyCorners.newError("Object not redrawable") } obj = curvyCorners.redrawList[i].copy } if (prop.indexOf(".") === -1) { obj[prop] = newval } else { eval("obj." + prop + "='" + newval + "'") } }; curvyCorners.handleWinResize = function () { if (!curvyCorners.block_redraw) { curvyCorners.redraw() } }; curvyCorners.setWinResize = function (A) { curvyCorners.block_redraw = !A }; curvyCorners.newError = function (A) { return new Error("curvyCorners Error:\n" + A) }; curvyCorners.alert = function (A) { if (typeof curvyCornersVerbose === "undefined" || curvyCornersVerbose) { alert(A) } }; function curvyObject() {
//    var U; this.box = arguments[1]; this.settings = arguments[0]; this.topContainer = this.bottomContainer = this.shell = U = null; var K = this.box.clientWidth; if (!K && curvyBrowser.isIE) { this.box.style.zoom = 1; K = this.box.clientWidth } if (!K) {
//        if (!this.box.parentNode) { throw this.newError("box has no parent!") }
//        for (U = this.box; ; U = U.parentNode) {
//            if (!U || U.tagName === "BODY") { this.applyCorners = function () { }; curvyCorners.alert(this.errmsg("zero-width box with no accountable parent", "warning")); return }
// if (U.style.display === "none") { break } } U.style.display = "block"; K = this.box.clientWidth } if (arguments[0] instanceof curvyCnrSpec) { this.spec = arguments[0].cloneOn(this.box) } else { this.spec = new curvyCnrSpec(""); this.spec.setfrom(this.settings) } var b = curvyBrowser.get_style(this.box, "borderTopWidth"); var J = curvyBrowser.get_style(this.box, "borderBottomWidth"); var D = curvyBrowser.get_style(this.box, "borderLeftWidth"); var B = curvyBrowser.get_style(this.box, "borderRightWidth"); var I = curvyBrowser.get_style(this.box, "borderTopColor"); var G = curvyBrowser.get_style(this.box, "borderBottomColor"); var A = curvyBrowser.get_style(this.box, "borderLeftColor"); var E = curvyBrowser.get_style(this.box, "backgroundColor"); var C = curvyBrowser.get_style(this.box, "backgroundImage"); var Y = curvyBrowser.get_style(this.box, "backgroundRepeat"); if (this.box.currentStyle && this.box.currentStyle.backgroundPositionX) { var R = curvyBrowser.get_style(this.box, "backgroundPositionX"); var P = curvyBrowser.get_style(this.box, "backgroundPositionY") } else { var R = curvyBrowser.get_style(this.box, "backgroundPosition"); R = R.split(" "); var P = R[1]; R = R[0] } var O = curvyBrowser.get_style(this.box, "position"); var Z = curvyBrowser.get_style(this.box, "paddingTop"); var c = curvyBrowser.get_style(this.box, "paddingBottom"); var Q = curvyBrowser.get_style(this.box, "paddingLeft"); var a = curvyBrowser.get_style(this.box, "paddingRight"); var S = curvyBrowser.get_style(this.box, "border"); filter = curvyBrowser.ieVer > 7 ? curvyBrowser.get_style(this.box, "filter") : null; var H = this.spec.get("tR"); var M = this.spec.get("bR"); var W = function (f) { if (typeof f === "number") { return f } if (typeof f !== "string") { throw new Error("unexpected styleToNPx type " + typeof f) } var d = /^[-\d.]([a-z]+)$/.exec(f); if (d && d[1] != "px") { throw new Error("Unexpected unit " + d[1]) } if (isNaN(f = parseInt(f))) { f = 0 } return f }; var T = function (d) { return d <= 0 ? "0" : d + "px" }; try { this.borderWidth = W(b); this.borderWidthB = W(J); this.borderWidthL = W(D); this.borderWidthR = W(B); this.boxColour = curvyObject.format_colour(E); this.topPadding = W(Z); this.bottomPadding = W(c); this.leftPadding = W(Q); this.rightPadding = W(a); this.boxWidth = K; this.boxHeight = this.box.clientHeight; this.borderColour = curvyObject.format_colour(I); this.borderColourB = curvyObject.format_colour(G); this.borderColourL = curvyObject.format_colour(A); this.borderString = this.borderWidth + "px solid " + this.borderColour; this.borderStringB = this.borderWidthB + "px solid " + this.borderColourB; this.backgroundImage = ((C != "none") ? C : ""); this.backgroundRepeat = Y } catch (X) { throw this.newError("getMessage" in X ? X.getMessage() : X.message) } var F = this.boxHeight; var V = K; if (curvyBrowser.isOp) { R = W(R); P = W(P); if (R) { var N = V + this.borderWidthL + this.borderWidthR; if (R > N) { R = N } R = (N / R * 100) + "%" } if (P) { var N = F + this.borderWidth + this.borderWidthB; if (P > N) { P = N } P = (N / P * 100) + "%" } } if (curvyBrowser.quirksMode) { } else { this.boxWidth -= this.leftPadding + this.rightPadding; this.boxHeight -= this.topPadding + this.bottomPadding } this.contentContainer = document.createElement("div"); if (filter) { this.contentContainer.style.filter = filter } while (this.box.firstChild) { this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild)) } if (O != "absolute") { this.box.style.position = "relative" } this.box.style.padding = "0"; this.box.style.border = this.box.style.backgroundImage = "none"; this.box.style.backgroundColor = "transparent"; this.box.style.width = (V + this.borderWidthL + this.borderWidthR) + "px"; this.box.style.height = (F + this.borderWidth + this.borderWidthB) + "px"; var L = document.createElement("div"); L.style.position = "absolute"; if (filter) { L.style.filter = filter } if (curvyBrowser.quirksMode) { L.style.width = (V + this.borderWidthL + this.borderWidthR) + "px" } else { L.style.width = V + "px" } L.style.height = T(F + this.borderWidth + this.borderWidthB - H - M); L.style.padding = "0"; L.style.top = H + "px"; L.style.left = "0"; if (this.borderWidthL) { L.style.borderLeft = this.borderWidthL + "px solid " + this.borderColourL } if (this.borderWidth && !H) { L.style.borderTop = this.borderWidth + "px solid " + this.borderColour } if (this.borderWidthR) { L.style.borderRight = this.borderWidthR + "px solid " + this.borderColourL } if (this.borderWidthB && !M) { L.style.borderBottom = this.borderWidthB + "px solid " + this.borderColourB } L.style.backgroundColor = E; L.style.backgroundImage = this.backgroundImage; L.style.backgroundRepeat = this.backgroundRepeat; this.shell = this.box.appendChild(L); K = curvyBrowser.get_style(this.shell, "width"); if (K === "" || K === "auto" || K.indexOf("%") !== -1) { throw this.newError("Shell width is " + K) } this.boxWidth = (K != "" && K != "auto" && K.indexOf("%") == -1) ? parseInt(K) : this.shell.clientWidth; this.applyCorners = function () { if (this.backgroundObject) { var w = function (AO, i, t) { if (AO === 0) { return 0 } var k; if (AO === "right" || AO === "bottom") { return t - i } if (AO === "center") { return (t - i) / 2 } if (AO.indexOf("%") > 0) { return (t - i) * 100 / parseInt(AO) } return W(AO) }; this.backgroundPosX = w(R, this.backgroundObject.width, V); this.backgroundPosY = w(P, this.backgroundObject.height, F) } else { if (this.backgroundImage) { this.backgroundPosX = W(R); this.backgroundPosY = W(P) } } if (H) { v = document.createElement("div"); v.style.width = this.boxWidth + "px"; v.style.fontSize = "1px"; v.style.overflow = "hidden"; v.style.position = "absolute"; v.style.paddingLeft = this.borderWidth + "px"; v.style.paddingRight = this.borderWidth + "px"; v.style.height = H + "px"; v.style.top = -H + "px"; v.style.left = -this.borderWidthL + "px"; this.topContainer = this.shell.appendChild(v) } if (M) { var v = document.createElement("div"); v.style.width = this.boxWidth + "px"; v.style.fontSize = "1px"; v.style.overflow = "hidden"; v.style.position = "absolute"; v.style.paddingLeft = this.borderWidthB + "px"; v.style.paddingRight = this.borderWidthB + "px"; v.style.height = M + "px"; v.style.bottom = -M + "px"; v.style.left = -this.borderWidthL + "px"; this.bottomContainer = this.shell.appendChild(v) } var AG = this.spec.cornerNames(); for (var AK in AG) { if (!isNaN(AK)) { var AC = AG[AK]; var AD = this.spec[AC + "R"]; var AE, AH, j, AF; if (AC == "tr" || AC == "tl") { AE = this.borderWidth; AH = this.borderColour; AF = this.borderWidth } else { AE = this.borderWidthB; AH = this.borderColourB; AF = this.borderWidthB } j = AD - AF; var u = document.createElement("div"); u.style.height = this.spec.get(AC + "Ru"); u.style.width = this.spec.get(AC + "Ru"); u.style.position = "absolute"; u.style.fontSize = "1px"; u.style.overflow = "hidden"; var r, q, p; var n = filter ? parseInt(/alpha\(opacity.(\d+)\)/.exec(filter)[1]) : 100; for (r = 0; r < AD; ++r) { var m = (r + 1 >= j) ? -1 : Math.floor(Math.sqrt(Math.pow(j, 2) - Math.pow(r + 1, 2))) - 1; if (j != AD) { var h = (r >= j) ? -1 : Math.ceil(Math.sqrt(Math.pow(j, 2) - Math.pow(r, 2))); var f = (r + 1 >= AD) ? -1 : Math.floor(Math.sqrt(Math.pow(AD, 2) - Math.pow((r + 1), 2))) - 1 } var d = (r >= AD) ? -1 : Math.ceil(Math.sqrt(Math.pow(AD, 2) - Math.pow(r, 2))); if (m > -1) { this.drawPixel(r, 0, this.boxColour, n, (m + 1), u, true, AD) } if (j != AD) { if (this.spec.antiAlias) { for (q = m + 1; q < h; ++q) { if (this.backgroundImage != "") { var g = curvyObject.pixelFraction(r, q, j) * 100; this.drawPixel(r, q, AH, n, 1, u, g >= 30, AD) } else { if (this.boxColour !== "transparent") { var AB = curvyObject.BlendColour(this.boxColour, AH, curvyObject.pixelFraction(r, q, j)); this.drawPixel(r, q, AB, n, 1, u, false, AD) } else { this.drawPixel(r, q, AH, n >> 1, 1, u, false, AD) } } } if (f >= h) { if (h == -1) { h = 0 } this.drawPixel(r, h, AH, n, (f - h + 1), u, false, 0) } p = AH; q = f } else { if (f > m) { this.drawPixel(r, (m + 1), AH, n, (f - m), u, false, 0) } } } else { p = this.boxColour; q = m } if (this.spec.antiAlias) { while (++q < d) { this.drawPixel(r, q, p, (curvyObject.pixelFraction(r, q, AD) * n), 1, u, AF <= 0, AD) } } } for (var y = 0, AJ = u.childNodes.length; y < AJ; ++y) { var s = u.childNodes[y]; var AI = parseInt(s.style.top); var AM = parseInt(s.style.left); var AN = parseInt(s.style.height); if (AC == "tl" || AC == "bl") { s.style.left = (AD - AM - 1) + "px" } if (AC == "tr" || AC == "tl") { s.style.top = (AD - AN - AI) + "px" } s.style.backgroundRepeat = this.backgroundRepeat; if (this.backgroundImage) { switch (AC) { case "tr": s.style.backgroundPosition = (this.backgroundPosX - this.borderWidthL + AD - V - AM) + "px " + (this.backgroundPosY + AN + AI + this.borderWidth - AD) + "px"; break; case "tl": s.style.backgroundPosition = (this.backgroundPosX - AD + AM + this.borderWidthL) + "px " + (this.backgroundPosY - AD + AN + AI + this.borderWidth) + "px"; break; case "bl": s.style.backgroundPosition = (this.backgroundPosX - AD + AM + 1 + this.borderWidthL) + "px " + (this.backgroundPosY - F - this.borderWidth + (curvyBrowser.quirksMode ? AI : -AI) + AD) + "px"; break; case "br": if (curvyBrowser.quirksMode) { s.style.backgroundPosition = (this.backgroundPosX + this.borderWidthL - V + AD - AM) + "px " + (this.backgroundPosY - F - this.borderWidth + AI + AD) + "px" } else { s.style.backgroundPosition = (this.backgroundPosX - this.borderWidthL - V + AD - AM) + "px " + (this.backgroundPosY - F - this.borderWidth + AD - AI) + "px" } } } } switch (AC) { case "tl": u.style.top = u.style.left = "0"; this.topContainer.appendChild(u); break; case "tr": u.style.top = u.style.right = "0"; this.topContainer.appendChild(u); break; case "bl": u.style.bottom = u.style.left = "0"; this.bottomContainer.appendChild(u); break; case "br": u.style.bottom = u.style.right = "0"; this.bottomContainer.appendChild(u) } } } var x = { t: this.spec.radiusdiff("t"), b: this.spec.radiusdiff("b") }; for (z in x) { if (typeof z === "function") { continue } if (!this.spec.get(z + "R")) { continue } if (x[z]) { if (this.backgroundImage && this.spec.radiusSum(z) !== x[z]) { curvyCorners.alert(this.errmsg("Not supported: unequal non-zero top/bottom radii with background image")) } var AL = (this.spec[z + "lR"] < this.spec[z + "rR"]) ? z + "l" : z + "r"; var l = document.createElement("div"); l.style.height = x[z] + "px"; l.style.width = this.spec.get(AL + "Ru"); l.style.position = "absolute"; l.style.fontSize = "1px"; l.style.overflow = "hidden"; l.style.backgroundColor = this.boxColour; switch (AL) { case "tl": l.style.bottom = l.style.left = "0"; l.style.borderLeft = this.borderString; this.topContainer.appendChild(l); break; case "tr": l.style.bottom = l.style.right = "0"; l.style.borderRight = this.borderString; this.topContainer.appendChild(l); break; case "bl": l.style.top = l.style.left = "0"; l.style.borderLeft = this.borderStringB; this.bottomContainer.appendChild(l); break; case "br": l.style.top = l.style.right = "0"; l.style.borderRight = this.borderStringB; this.bottomContainer.appendChild(l) } } var o = document.createElement("div"); if (filter) { o.style.filter = filter } o.style.position = "relative"; o.style.fontSize = "1px"; o.style.overflow = "hidden"; o.style.width = this.fillerWidth(z); o.style.backgroundColor = this.boxColour; o.style.backgroundImage = this.backgroundImage; o.style.backgroundRepeat = this.backgroundRepeat; switch (z) { case "t": if (this.topContainer) { if (curvyBrowser.quirksMode) { o.style.height = 100 + H + "px" } else { o.style.height = 100 + H - this.borderWidth + "px" } o.style.marginLeft = this.spec.tlR ? (this.spec.tlR - this.borderWidthL) + "px" : "0"; o.style.borderTop = this.borderString; if (this.backgroundImage) { var AA = this.spec.tlR ? (this.backgroundPosX - (H - this.borderWidthL)) + "px " : "0 "; o.style.backgroundPosition = AA + this.backgroundPosY + "px"; this.shell.style.backgroundPosition = this.backgroundPosX + "px " + (this.backgroundPosY - H + this.borderWidthL) + "px" } this.topContainer.appendChild(o) } break; case "b": if (this.bottomContainer) { if (curvyBrowser.quirksMode) { o.style.height = M + "px" } else { o.style.height = M - this.borderWidthB + "px" } o.style.marginLeft = this.spec.blR ? (this.spec.blR - this.borderWidthL) + "px" : "0"; o.style.borderBottom = this.borderStringB; if (this.backgroundImage) { var AA = this.spec.blR ? (this.backgroundPosX + this.borderWidthL - M) + "px " : this.backgroundPosX + "px "; o.style.backgroundPosition = AA + (this.backgroundPosY - F - this.borderWidth + M) + "px" } this.bottomContainer.appendChild(o) } } } this.contentContainer.style.position = "absolute"; this.contentContainer.className = "autoPadDiv"; this.contentContainer.style.left = this.borderWidthL + "px"; this.contentContainer.style.paddingTop = this.topPadding + "px"; this.contentContainer.style.top = this.borderWidth + "px"; this.contentContainer.style.paddingLeft = this.leftPadding + "px"; this.contentContainer.style.paddingRight = this.rightPadding + "px"; z = V; if (!curvyBrowser.quirksMode) { z -= this.leftPadding + this.rightPadding } this.contentContainer.style.width = z + "px"; this.contentContainer.style.textAlign = curvyBrowser.get_style(this.box, "textAlign"); this.box.style.textAlign = "left"; this.box.appendChild(this.contentContainer); if (U) { U.style.display = "none" } }; if (this.backgroundImage) { R = this.backgroundCheck(R); P = this.backgroundCheck(P); if (this.backgroundObject) { this.backgroundObject.holdingElement = this; this.dispatch = this.applyCorners; this.applyCorners = function () { if (this.backgroundObject.complete) { this.dispatch() } else { this.backgroundObject.onload = new Function("curvyObject.dispatch(this.holdingElement);") } } } } } curvyObject.prototype.backgroundCheck = function (B) { if (B === "top" || B === "left" || parseInt(B) === 0) { return 0 } if (!(/^[-\d.]+px$/.test(B)) && !this.backgroundObject) { this.backgroundObject = new Image; var A = function (D) { var C = /url\("?([^'"]+)"?\)/.exec(D); return (C ? C[1] : D) }; this.backgroundObject.src = A(this.backgroundImage) } return B }; curvyObject.dispatch = function (A) { if ("dispatch" in A) { A.dispatch() } else { throw A.newError("No dispatch function") } }; curvyObject.prototype.drawPixel = function (J, G, A, F, H, I, C, E) { var B = document.createElement("div"); B.style.height = H + "px"; B.style.width = "1px"; B.style.position = "absolute"; B.style.fontSize = "1px"; B.style.overflow = "hidden"; var D = this.spec.get("tR"); B.style.backgroundColor = A; if (C && this.backgroundImage != "") { B.style.backgroundImage = this.backgroundImage; B.style.backgroundPosition = "-" + (this.boxWidth - (E - J) + this.borderWidth) + "px -" + ((this.boxHeight + D + G) - this.borderWidth) + "px" } if (F != 100) { curvyObject.setOpacity(B, F) } B.style.top = G + "px"; B.style.left = J + "px"; I.appendChild(B) }; curvyObject.prototype.fillerWidth = function (A) { var B = curvyBrowser.quirksMode ? 0 : this.spec.radiusCount(A) * this.borderWidthL; return (this.boxWidth - this.spec.radiusSum(A) + B) + "px" }; curvyObject.prototype.errmsg = function (C, D) { var B = "\ntag: " + this.box.tagName; if (this.box.id) { B += "\nid: " + this.box.id } if (this.box.className) { B += "\nclass: " + this.box.className } var A; if ((A = this.box.parentNode) === null) { B += "\n(box has no parent)" } else { B += "\nParent tag: " + A.tagName; if (A.id) { B += "\nParent ID: " + A.id } if (A.className) { B += "\nParent class: " + A.className } } if (D === undefined) { D = "warning" } return "curvyObject " + D + ":\n" + C + B }; curvyObject.prototype.newError = function (A) { return new Error(this.errmsg(A, "exception")) }; curvyObject.IntToHex = function (B) { var A = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; return A[B >>> 4] + "" + A[B & 15] }; curvyObject.BlendColour = function (L, J, G) { if (L === "transparent" || J === "transparent") { throw this.newError("Cannot blend with transparent") } if (L.charAt(0) !== "#") { L = curvyObject.format_colour(L) } if (J.charAt(0) !== "#") { J = curvyObject.format_colour(J) } var D = parseInt(L.substr(1, 2), 16); var K = parseInt(L.substr(3, 2), 16); var F = parseInt(L.substr(5, 2), 16); var C = parseInt(J.substr(1, 2), 16); var I = parseInt(J.substr(3, 2), 16); var E = parseInt(J.substr(5, 2), 16); if (G > 1 || G < 0) { G = 1 } var H = Math.round((D * G) + (C * (1 - G))); if (H > 255) { H = 255 } if (H < 0) { H = 0 } var B = Math.round((K * G) + (I * (1 - G))); if (B > 255) { B = 255 } if (B < 0) { B = 0 } var A = Math.round((F * G) + (E * (1 - G))); if (A > 255) { A = 255 } if (A < 0) { A = 0 } return "#" + curvyObject.IntToHex(H) + curvyObject.IntToHex(B) + curvyObject.IntToHex(A) }; curvyObject.pixelFraction = function (H, G, A) { var J; var E = A * A; var B = new Array(2); var F = new Array(2); var I = 0; var C = ""; var D = Math.sqrt(E - Math.pow(H, 2)); if (D >= G && D < (G + 1)) { C = "Left"; B[I] = 0; F[I] = D - G; ++I } D = Math.sqrt(E - Math.pow(G + 1, 2)); if (D >= H && D < (H + 1)) { C += "Top"; B[I] = D - H; F[I] = 1; ++I } D = Math.sqrt(E - Math.pow(H + 1, 2)); if (D >= G && D < (G + 1)) { C += "Right"; B[I] = 1; F[I] = D - G; ++I } D = Math.sqrt(E - Math.pow(G, 2)); if (D >= H && D < (H + 1)) { C += "Bottom"; B[I] = D - H; F[I] = 0 } switch (C) { case "LeftRight": J = Math.min(F[0], F[1]) + ((Math.max(F[0], F[1]) - Math.min(F[0], F[1])) / 2); break; case "TopRight": J = 1 - (((1 - B[0]) * (1 - F[1])) / 2); break; case "TopBottom": J = Math.min(B[0], B[1]) + ((Math.max(B[0], B[1]) - Math.min(B[0], B[1])) / 2); break; case "LeftBottom": J = F[0] * B[1] / 2; break; default: J = 1 } return J }; curvyObject.rgb2Array = function (A) { var B = A.substring(4, A.indexOf(")")); return B.split(", ") }; curvyObject.rgb2Hex = function (B) { try { var C = curvyObject.rgb2Array(B); var G = parseInt(C[0]); var E = parseInt(C[1]); var A = parseInt(C[2]); var D = "#" + curvyObject.IntToHex(G) + curvyObject.IntToHex(E) + curvyObject.IntToHex(A) } catch (F) { var H = "getMessage" in F ? F.getMessage() : F.message; throw new Error("Error (" + H + ") converting RGB value to Hex in rgb2Hex") } return D }; curvyObject.setOpacity = function (F, C) { C = (C == 100) ? 99.999 : C; if (curvyBrowser.isSafari && F.tagName != "IFRAME") { var B = curvyObject.rgb2Array(F.style.backgroundColor); var E = parseInt(B[0]); var D = parseInt(B[1]); var A = parseInt(B[2]); F.style.backgroundColor = "rgba(" + E + ", " + D + ", " + A + ", " + C / 100 + ")" } else { if (typeof F.style.opacity !== "undefined") { F.style.opacity = C / 100 } else { if (typeof F.style.MozOpacity !== "undefined") { F.style.MozOpacity = C / 100 } else { if (typeof F.style.filter != "undefined") { F.style.filter = "alpha(opacity=" + C + ")" } else { if (typeof F.style.KHTMLOpacity != "undefined") { F.style.KHTMLOpacity = C / 100 } } } } } }; function addEvent(D, C, B, A) { if (D.addEventListener) { D.addEventListener(C, B, A); return true } if (D.attachEvent) { return D.attachEvent("on" + C, B) } D["on" + C] = B; return false } curvyObject.getComputedColour = function (E) { var F = document.createElement("DIV"); F.style.backgroundColor = E; document.body.appendChild(F); if (window.getComputedStyle) { var D = document.defaultView.getComputedStyle(F, null).getPropertyValue("background-color"); F.parentNode.removeChild(F); if (D.substr(0, 3) === "rgb") { D = curvyObject.rgb2Hex(D) } return D } else { var A = document.body.createTextRange(); A.moveToElementText(F); A.execCommand("ForeColor", false, E); var B = A.queryCommandValue("ForeColor"); var C = "rgb(" + (B & 255) + ", " + ((B & 65280) >> 8) + ", " + ((B & 16711680) >> 16) + ")"; F.parentNode.removeChild(F); A = null; return curvyObject.rgb2Hex(C) } }; curvyObject.format_colour = function (A) { if (A != "" && A != "transparent") { if (A.substr(0, 3) === "rgb") { A = curvyObject.rgb2Hex(A) } else { if (A.charAt(0) !== "#") { A = curvyObject.getComputedColour(A) } else { if (A.length === 4) { A = "#" + A.charAt(1) + A.charAt(1) + A.charAt(2) + A.charAt(2) + A.charAt(3) + A.charAt(3) } } } } return A }; curvyCorners.getElementsByClass = function (H, F) { var E = new Array; if (F === undefined) { F = document } H = H.split("."); var A = "*"; if (H.length === 1) { A = H[0]; H = false } else { if (H[0]) { A = H[0] } H = H[1] } var D, C, B; if (A.charAt(0) === "#") { C = document.getElementById(A.substr(1)); if (C) { E.push(C) } } else { C = F.getElementsByTagName(A); B = C.length; if (H) { var G = new RegExp("(^|\\s)" + H + "(\\s|$)"); for (D = 0; D < B; ++D) { if (G.test(C[D].className)) { E.push(C[D]) } } } else { for (D = 0; D < B; ++D) { E.push(C[D]) } } } return E }; if (curvyBrowser.isMoz || curvyBrowser.isWebKit) { var curvyCornersNoAutoScan = true } else { curvyCorners.scanStyles = function () { function B(F) { var G = /^[\d.]+(\w+)$/.exec(F); return G[1] } var E, D, C; if (curvyBrowser.isIE) { function A(L) { var J = L.style; if (curvyBrowser.ieVer > 6) { var H = J["-webkit-border-radius"] || 0; var K = J["-webkit-border-top-right-radius"] || 0; var F = J["-webkit-border-top-left-radius"] || 0; var G = J["-webkit-border-bottom-right-radius"] || 0; var M = J["-webkit-border-bottom-left-radius"] || 0 } else { var H = J["webkit-border-radius"] || 0; var K = J["webkit-border-top-right-radius"] || 0; var F = J["webkit-border-top-left-radius"] || 0; var G = J["webkit-border-bottom-right-radius"] || 0; var M = J["webkit-border-bottom-left-radius"] || 0 } if (H || F || K || G || M) { var I = new curvyCnrSpec(L.selectorText); if (H) { I.setcorner(null, null, parseInt(H), B(H)) } else { if (K) { I.setcorner("t", "r", parseInt(K), B(K)) } if (F) { I.setcorner("t", "l", parseInt(F), B(F)) } if (M) { I.setcorner("b", "l", parseInt(M), B(M)) } if (G) { I.setcorner("b", "r", parseInt(G), B(G)) } } curvyCorners(I) } } for (E = 0; E < document.styleSheets.length; ++E) { if (document.styleSheets[E].imports) { for (D = 0; D < document.styleSheets[E].imports.length; ++D) { for (C = 0; C < document.styleSheets[E].imports[D].rules.length; ++C) { A(document.styleSheets[E].imports[D].rules[C]) } } } for (D = 0; D < document.styleSheets[E].rules.length; ++D) { A(document.styleSheets[E].rules[D]) } } } else { if (curvyBrowser.isOp) { for (E = 0; E < document.styleSheets.length; ++E) { if (operasheet.contains_border_radius(E)) { C = new operasheet(E); for (D in C.rules) { if (!isNaN(D)) { curvyCorners(C.rules[D]) } } } } } else { curvyCorners.alert("Scanstyles does nothing in Webkit/Firefox") } } }; curvyCorners.init = function () { if (arguments.callee.done) { return } arguments.callee.done = true; if (curvyBrowser.isWebKit && curvyCorners.init.timer) { clearInterval(curvyCorners.init.timer); curvyCorners.init.timer = null } curvyCorners.scanStyles() } } if (typeof curvyCornersNoAutoScan === "undefined" || curvyCornersNoAutoScan === false) { if (curvyBrowser.isOp) { document.addEventListener("DOMContentLoaded", curvyCorners.init, false) } else { addEvent(window, "load", curvyCorners.init, false) } };
