﻿function roundCorners(radius) {
    var ua = $.browser;
    var vchar = ua.version.slice(0, 1);
    if ((ua.msie && (vchar == '8' || vchar == '7'))) {
        var search = $('#header div#site_search');
        if ($(search).length != 0) {
            $(search).each(function () {
                var w = $(this).width();
                var h = $(this).height();
                $(search).css('border', '0 none transparent');
                $(search).css('background-color', 'transparent');
                $(search).css('background', 'url("/Sitefinity/WebsiteTemplates/MyTemplate/App_Themes/MiroiTheme_1/Images/searchbox.png") no-repeat 0 0');
                $(search).css('width', w + 2);
                $(search).css('height', h + 2);
            });
        }
        if ($('.RoundedCorners').length != 0) {
            $('.RoundedCorners').each(function () {
                var back = $(this).css('background-color');
                var backimg = $(this).css('background-image');

                if (((typeof (back) != 'undefined' && back != 'transparent') || back == 'White') || (typeof (backimg) != 'undefined' && backimg != 'none')) {
                    var testrad = $(this).css('border-radius');
                    if (typeof (testrad) != 'undefined' && testrad != '') {
                        $(this).corner(testrad);
                    }
                    else {
                        $(this).corner(radius);
                    }
                }
            });
        }
    }
    else {
        if ($('.RoundedCorners').length != 0) {
            $('.RoundedCorners').corner(radius);
        }
    }

}

