Correo = {
    panel : new YAHOO.widget.Panel("envia_correo_container", {
                fixedcenter: true, 	
                constraintoviewport: true, 
                underlay:"none", 
                close:false, 
                visible: false, 
                draggable:false,
                modal : true
            }),

    show : function(){
        this.callContents();
    },
    
    callContents : function() {
        var callback = {
            success: function(o) {
                var html = o.responseText;
                Correo.panel.setBody(html);
                Correo.panel.render(document.body);
                Correo.panel.show();
                
                YAHOO.util.Event.addListener(document.getElementById('envia_correo_container_mask'),
                                    'click',
                                    function() { Correo.panel.hide();  });
            },
            failure: function (o) {}
        };
        
        YAHOO.util.Connect.asyncRequest(
            'GET',
            '/articulo/correo?id=' + document.getElementById('articulo_id').value,
            callback);
    },
            
    envia : function(){
        var postData = "id=" + document.getElementById('articulo_id').value
                     + "&correo_remitente=" + document.getElementById('envia_correo_remitente').value
                     + "&correo_destino=" + document.getElementById('envia_correo_destino').value
                     + "&nombre_remitente=" + document.getElementById('envia_nombre_remitente').value
                     + "&nombre_destino=" + document.getElementById('envia_nombre_destino').value
                     + "&comentarios=" + document.getElementById('envia_comentarios').value;
        var callback = {
            success: function(o) {
                var html = o.responseText.split('<split>');
                Correo.panel.setBody(html[0]);
                if (html.length > 1) { eval(html[1]); };
                Correo.panel.render(document.body);
            },
            failure: function (o) {}
        };

        YAHOO.util.Connect.asyncRequest(
            'POST',
            '/articulo/correo',
            callback,
            postData);
    }
}