function showWait() {

    var cancelButton = {};
    cancelButton[strClose] = function() { $(this).dialog('close'); };
    
    var $dialog = $('#InProgressDialog').dialog(
    {
        autoOpen: false,
        modal: true,
        width: 310,
        height: 200,
        buttons: cancelButton,
        title: inProgress 
    });
    $dialog.dialog('open');
}

/* hides the wait inprogress dialog*/

function hideWait() {
    $('#InProgressDialog').dialog("close");
}

function remove(id) {
    var d = document.getElementById(id);
    if (d) {
        //d.style = "display:none";
        if (d.parentNode)
            d.parentNode.removeChild(d);
    }
}

function confirmpost(o) {
    var c = document.getElementById('hdnConfirmPost');
    if (c) {
        var m;
        if (o.value)
            m = c.value + "\n	++" + o.value + "++";
        else
            m = c.value;
        if (confirm(m)) {
            return true
        }
    }
    return false;
}

function comment(o, d) {
    var c = document.getElementById(d)
    if (c) {
        if (c.className == "show") {
            c.className = "hide";
        }
        else
            c.className = "show";
    }
}


function confirmedit(o) {
    var c = document.getElementById('hdnConfirmExitEdit');
    if (c) {
        var hrf = window.location.href;
        if (hrf.indexOf("view=Edit") != -1) {
            if (confirm(c.value)) {
                return true
            }
        }
        else
            return true;
    }
    return false;
}


function toggleview(i, d, h) {
    var c = document.getElementById(d);
    var m = document.getElementById(i);
    var s = document.getElementById(h);
    if (c) {
        if (c.className == "show") {
            c.className = "hide";
            if (m)
                m.src = "Images/plus.gif";
            if (s)
                s.value = "Closed";
        }
        else {
            c.className = "show";
            if (m)
                m.src = "Images/minus.gif";
            if (s)
                s.value = "Open";
        }
    }
}

function copyto(f1, f2, t1, t2) {
    var s, d;
    try {
        s = document.getElementById(f1);
        d = document.getElementById(t1);
        if (s && d)
            d.value = s.value;
        s = document.getElementById(f2);
        d = document.getElementById(t2);
        if (s && d)
            d.value = s.value;
    }
    catch (e) {
        alert(e);
    }
}


function showtooltip(e, i) {
    try {
        var tp = document.getElementById(i);
        if (tp && e) {
            tp.className = "tooltip";
            x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
            y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY;
            if (tp != null) {
                tp.style.left = (x + 15) + "px";
                tp.style.top = (y + 15) + "px";
            }
            tp.style.visibility = "visible";
            tp.style.display = "block";
        }
    }
    catch (e) {
        alert(e);
    }
}
function hidetooltip(i) {
    var tp = document.getElementById(i);
    if (tp) {
        tp.style.visibility = "hidden";
        tp.style.display = "none";
    }
}

function toggleenabled(d, i) {
    var c = document.getElementById(d)
    if (c) {
        c.disabled = i;
    }
}

function moveactions() {
    var w = document.getElementById("divContentMgt");
    var x = document.getElementById("divElementMgt");
    if (w) {
        if (document.body && document.body.scrollTop > 171) {
            w.style.position = "absolute";
            w.style.top = document.body.scrollTop + "px";
        }
        else
            w.style.position = "static";
    }
    else if (x) {
        if (document.body && document.body.scrollTop > 171) {
            x.style.position = "absolute";
            x.style.top = document.body.scrollTop + "px";
        }
        else
            x.style.position = "static";
    }
}
