
function popup_send_data( element_id, pval )
{
        var strIDs = "";
        var i = 0;

        try {

                window.opener.popup_callback( element_id, pval );

                // Close current window.
                window.close();

        } catch (objError) {
                alert(
                "There was an error passing the\n" +
                "data back to the parent window"
                );

        }

}

function popup_popup(url_to_pop_up)
{
        var myWidth = 800;
        var myHeight = 700;
        var features;
        var myLeft = (screen.width -myWidth)/2;
        var myTop = (screen.height - myHeight)/2;
        features+=(features!='')?',':'';
        features+=',left='+myLeft+',top='+myTop+',width='+myWidth+',height='+myHeight+',toolbar=no,scrollbars=yes';

        window.open(url_to_pop_up, '', features);
        //void(0);
}

function popup_callback( element_id, value_to_set )
{
        var id;
        id = document.getElementById(element_id);
        id.value = value_to_set;
        //alert('parent: '+id.parentNode);
        id.parentNode.submit();

        return;
}

