Boletin = {
    panel : new YAHOO.widget.Panel("boletin", {
                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;
                Boletin.panel.render(document.body);
                Boletin.panel.setBody(html);
                Boletin.panel.render(document.body);
                Boletin.panel.show();
                
                YAHOO.util.Event.addListener(document.getElementById('boletin_mask'),
                                            'click',
                                            function() { Boletin.panel.hide();  });
                
            },
            failure: function (o) {}
        };
        
        YAHOO.util.Connect.asyncRequest(
            'GET',
            '/main/suscripcion',
            callback);
    },
    
    envia : function(){
        var postData = "email=" + document.getElementById('boletin_email').value
                     + "&nombre=" + document.getElementById('boletin_nombre').value;
                     
        var callback = {
            success: function(o) {
                var html = o.responseText.split('<split>');
                Boletin.panel.setBody(html[0]);
                if (html.length > 1) { eval(html[1]); };
                Boletin.panel.render(document.body);
            },
            failure: function (o) {}
        };

        YAHOO.util.Connect.asyncRequest(
            'POST',
            '/main/suscripcion',
            callback,
            postData);
        
    }
}