﻿$(document).ready(function() {

    modifyCss();


    if ($.browser.msie)
        return; //applyCurvyCorners();
    //else
        applyRounding();
    //applyCurvyCorners();

});
function modifyCss() {

    
    $(".main-menu .selected a").addClass("top-rounded-wrap");
    $(".document-templates-menu a").addClass("top-rounded-wrap-small");
    $(".inside-menu a").addClass("top-rounded-wrap-small");
    $(".inside-menu").addClass("rounded");
    $(".new-application-menu .step1 a").addClass("tl-rounded");
    $(".new-application-menu .step5 a").addClass("tr-rounded");
// $(".new-application-menu .selected a").removeClass("top-rounded-wrap");

    //$(".tab-menu .selected a").addClass("top-rounded-wrap");


    $(".side-menu .item div").addClass("tl-rounded");
    $(".side-menu .item div").addClass("bl-rounded");

    $(".side-menu .selected .item div").addClass("tl-rounded");
    $(".side-menu .selected .item div").addClass("bl-rounded");

    $("body").addClass("bottom-very-rounded");
    $(".editable-view-box .box-content div").addClass("bottom-rounded");
    $(".editable-view-box .box-content div").addClass("tl-rounded");
    $("iframe.defaultModal").addClass("rounded");
    //$(".textbox").addClass("rounded");
    //$(".ctrlNumber").addClass("rounded");
    //$(".number-box").addClass("rounded");
    //$(".waterMark").addClass("rounded");
    //$("select").addClass("rounded");
    //$("div.search").addClass("rounded");
    $("div.rounded .box-content").addClass("rounded");

    $(".image-button").addClass("rounded");
    //$(".box-with-header .box-content").addClass("rounded");
    

}
function applyRounding() {
    $("a.rounded").corner("5px");
    $("div.rounded").corner("10px");
    $("span.rounded").corner("10px");
    $("div.top-rounded").corner("top 10px");
    $("h2.top-rounded").corner("top 10px");
    $("h3.top-rounded").corner("top 10px");
    $("a.top-rounded").corner("top 5px");
    $("a.top-rounded-wrap").corner("top 10px cc:transparent");
    $("a.top-rounded-wrap-small").corner("top 5px cc:transparent");
    $("a.tl-rounded").corner("tl 10px cc:transparent");
    $("a.tr-rounded").corner("tr 10px cc:transparent");
    $("a.bl-rounded").corner("bl 10px");
    $("a.br-rounded").corner("br 10px");

    $("div.tl-rounded").corner("tl 10px");
    $("div.tr-rounded").corner("tr 10px");

    $("span.tl-rounded a").corner("tl 10px");
    $("span.tr-rounded a").corner("tr 10px");
    
    $("div.bl-rounded").corner("bl 10px");
    $("div.br-rounded").corner("br 10px");
    $("div.bottom-rounded").corner("bottom 10px");

    $("div.bottom-very-rounded").corner("bottom 15px");
    $("form").corner("15px");
    $("div.footer").corner("bottom 15px");
    $("input.rounded").corner("5px");
    $("img.rounded").corner("5px");
    $("textarea.rounded").corner("5px");
    $("select.rounded").corner("5px");

}



function applyCurvyCorners() {
    RoundCorners(5, 5, 5, 5, "a.rounded");
    RoundCorners(10,10,10,10,"div.rounded");
    RoundCorners(10,10,10,10,"span.rounded");
    RoundCorners(10,10,0,0,"div.top-rounded");
    RoundCorners(10,10,0,0,"h2.top-rounded");
    RoundCorners(10,10,0,0,"h3.top-rounded");
    RoundCorners(5,5,0,0,"a.top-rounded");
    RoundCorners(5, 5, 0, 0, "a.top-rounded-wrap");
    //RoundCorners(10,10,0,10,"a.tl-rounded").corner("tl 10px cc:transparent");
    //RoundCorners(10,10,0,10,"a.tr-rounded").corner("tr 10px cc:transparent");
    //RoundCorners(10,10,10,10,"a.bl-rounded").corner("bl 10px");
    //RoundCorners(10,10,10,10,"a.br-rounded").corner("br 10px");

    //RoundCorners(10,10,10,10,"div.tl-rounded").corner("tl 10px");
    //RoundCorners(10,10,10,10,"div.tr-rounded").corner("tr 10px");

    //RoundCorners(10,10,10,10,"span.tl-rounded a").corner("tl 10px");
    //RoundCorners(10,10,10,10,"span.tr-rounded a").corner("tr 10px");

    //RoundCorners(10,10,10,10,"div.bl-rounded").corner("bl 10px");
    //RoundCorners(10,10,10,10,"div.br-rounded").corner("br 10px");
    RoundCorners(0,0,10,10,"div.bottom-rounded");

    RoundCorners(0,0,15,15,"div.bottom-very-rounded");
    RoundCorners(15,15,15,15,"form");
    RoundCorners(0,0,15,15,"div.footer");
    RoundCorners(5,5,5,5,"input.rounded");
    RoundCorners(5,5,5,5,"textarea.rounded");
    //RoundCorners(2,2,2,2,"select.rounded");

}
function RoundCorners(tl, tr, bl, br, cls) {
    curvyCorners({ tl: { radius: tl }, tr: { radius: tr }, bl: { radius: bl }, br: { radius: br }, antiAlias: true }, cls);
}
