﻿// JScript File

function WebEditor_GetValue(frm,txt)
{
    var edt = document.getElementById(frm);
    var val = document.getElementById(txt);
    if (null == edt){
        return;
    }
    if (null==val)
    {
        return;
    }
    var str;
    if (edt.contentWindow.document.getElementById('cbxEditMode') && edt.contentWindow.document.getElementById('cbxEditMode').checked)
        val.value = (edt.contentWindow.frames[0].document.body.innerText)?edt.contentWindow.frames[0].document.body.innerText : edt.contentWindow.frames[0].document.body.textContent;
    else
        val.value = edt.contentWindow.frames[0].document.body.innerHTML;
}

function WebEditor_SetValue(frm,txt)
{
    var edt = document.getElementById(frm);
    var val = document.getElementById(txt);
    if (null == edt){
        return;
    }
    if (null==val)
    {
        return;
    }
    if (edt.contentWindow.frames[0].document.body)
        edt.contentWindow.frames[0].document.body.innerHTML = val.value;
    else setTimeout("WebEditor_SetValue('"+frm+"', '"+txt+"')", 100);
}
