﻿function setBorder(id, border) {
    var obj = document.getElementById(id);

    if (obj != null) {
        obj.style.border = border;
    }
}

function togglePlayImage(obj) {
    toggleImage(obj, "/client/images/control_play.png", "/client/images/control_pause.png");
}

function toggleImage(obj, srcOn, srcOff) {
    obj.src = (obj.src.match(srcOn) ? srcOff : srcOn);
}

function OnEditorClientCommandExecuting(editor, args) {
    var name = args.get_name();
    var val = args.get_value();

    if (name == "DynamicDropdown") {
        editor.pasteHtml(val + new Date().getTime() + "\" />");
        //Cancel the further execution of the command as such a command does not exist in the editor command list
        args.set_cancel(true);
    }
}

