﻿var TargetID = "";
var IsTextEditor = false;
var msgToken = "";
function showMessageToken(targetID, ModalPopupExtenderID, targetType) {
   
    TargetID = targetID;
    IsTextEditor = targetType;
    showModalPopup(ModalPopupExtenderID);
}

function AddMessageToken(msgTokenID, ModalPopupExtenderID) {
 
    if (IsTextEditor) {
        var fckEditorClientID = document.getElementById(TargetID);
        oEditor = FCKeditorAPI.GetInstance(fckEditorClientID.id);
        oEditor.InsertHtml(msgToken)
    }
    else {
        var hash = "#";
        var txtID = hash + TargetID;
        $(txtID).val($(txtID).val() + msgToken)
    }
    hideModalPopup(ModalPopupExtenderID);
}

function clearFCKEditor(FCKEditorID) {
    var fckEditorClientID = document.getElementById(FCKEditorID);
    oEditor = FCKeditorAPI.GetInstance(fckEditorClientID.id);
}
function setMessageToken(val) {
    msgToken = val;
}