var CuteWebUIMouse_isfixed = 0;
var CuteWebUIMouse_times_try = 0;

function CuteWebUIMouseOver_fix() {
    $('#imgUploaderInsert').removeClass("btn-darkBlue");
    $('#imgUploaderInsert').addClass("btn-blue");
}
function CuteWebUIMouseOut_fix() {
    $('#imgUploaderInsert').removeClass("btn-blue");
    $('#imgUploaderInsert').addClass("btn-darkBlue");
}


function doCuteWebUIfix() {
    // alert(CuteWebUIMouse_times_try);
    if ($("object[type='application/x-silverlight-2']").parent().length > 0) CuteWebUIMouse_isfixed = 1;
    if ($("embed").parent().length > 0) CuteWebUIMouse_isfixed = 1;
    if ($("object").length > 0) CuteWebUIMouse_isfixed = 1;
    CuteWebUIMouse_times_try++;

    if ($("object[type='application/x-silverlight-2']").parent().length > 0) {
        $("object[type='application/x-silverlight-2']").parent().mouseover(CuteWebUIMouseOver_fix);
        $("object[type='application/x-silverlight-2']").parent().mouseout(CuteWebUIMouseOut_fix);
    } else if ($("embed").parent().length > 0) {
        $("embed").parent().mouseover(CuteWebUIMouseOver_fix);
        $("embed").parent().mouseout(CuteWebUIMouseOut_fix);
    } else if ($("object").length > 0) {
        $("object").wrap('<div class="newDivCuteWebUI_fix" />');
        $(".newDivCuteWebUI_fix").mouseover(CuteWebUIMouseOver_fix);
        $(".newDivCuteWebUI_fix").mouseout(CuteWebUIMouseOut_fix);
    }

    if (CuteWebUIMouse_isfixed == 0 && CuteWebUIMouse_times_try < 120) setTimeout(doCuteWebUIfix, 1000);

}

$(document).ready(function () {
    doCuteWebUIfix();
});

