﻿
    function openPopup(url,w,h) {
        width = w;
        height = h;
        x = parseInt(screen.width / 2.0) - (width / 2.0);
        y = parseInt(screen.height / 2.0) - (height / 2.0);

        var win = window.open(url, "editorPopup", "top=" + y + ",left=" + x + ",scrollbars=no,dialog=yes,minimizable=no,modal=yes,width=" + width + ",height=" + height + ",resizable=no");
    }

    function deleteZoneContent(ZoneArea, PageID) {

        ret = vmcms.DeleteContent.DeleteZone(ZoneArea, PageID, OnComplete, OnTimeOut, OnError);
        return (true);

    }

    function OnComplete(args) {
        alert(args);
    }

    function OnTimeOut(args) {
        alert("ERROR : Service call timed out. Possbily content area has no content.");

    }

    function OnError(args) {
        alert("Error calling service method.");
    }

    function postwith(to, p) {
        var myForm = document.createElement("form");
        myForm.method = "post";
        myForm.action = to;
        myForm.setAttribute("target", '_blank');
        for (var k in p) {
            var myInput = document.createElement("input");
            myInput.setAttribute("name", k);
            myInput.setAttribute("value", p[k]);
            myForm.appendChild(myInput);
        }
        document.body.appendChild(myForm);
        myForm.submit();
        document.body.removeChild(myForm);
    }

    function postdata() {
        postwith("http://visitor.constantcontact.com/d.jsp", { ea: document.getElementById("ea").value, m: document.getElementById("m").value, p: document.getElementById("p").value });
    }

    function clearDefault(el) {
        if (el.defaultValue == el.value) el.value = ""
    }
