<!-- preferences : tab_you -->
<div class="yui-gd top_padded">
    <div class="yui-u first align_right">
        &nbsp;
    </div>
    <div id="result" class="yui-u">
        &nbsp;
    </div>
</div>

<div class="yui-gd top_padded">
    <div class="yui-u first align_right">
        [%l('First Name')%]:
    </div>
    <div class="yui-u">
        <span id="FirstName" name="First name" class="editable">[%authed_user.first_name%]</span>
    </div>
</div>

<div class="yui-gd top_padded">
    <div class="yui-u first align_right">
        [%l('Last Name')%]:
    </div>
    <div class="yui-u">
        <span id="LastName" class="editable">[% authed_user.last_name %]</span>
    </div>
</div>

<div class="yui-gd top_padded">
    <div class="yui-u first align_right">
        [%l('Forum Name')%]:
    </div>
    <div class="yui-u">
        <span id="ForumName" class="editable">[% authed_user.forum_name %]</span>
    </div>
</div>

<div class="yui-gd top_padded">
    <div class="yui-u first align_right">
        [%l('Email Address')%]:
    </div>
    <div class="yui-u">
        <span id="EmailAddress" name="EmailAddress">[% authed_user.email %]</span>
    </div>
</div>

<script type="text/javascript" src="[%c.request.base%]/static/Editable-min.js"></script>
<script type="text/javascript">
    var E  = new YAHOO.widget.EditableElement;

    E.callback = function(){
        var handleSuccess = function(o) {
            YAHOO.parley.small_loading.wait.hide();
            var data = eval('(' + o.responseText + ')');
            // show the status message
            o.argument.msg_node.innerHTML = data.message;
            // if we didn't update reset the field value
            if (data.updated != 1) {
                o.argument.node.innerHTML = data.old_value;
            }
        };
        var handleFailure =  function(o) {
            YAHOO.parley.small_loading.wait.hide();
            alert('ERROR: ' + o.responseText);
        };

        YAHOO.parley.small_loading.wait.show();

        // where to post to
        var sUrl = '[%base%]my/saveHandler';

        // postdata is a query string ... how irksome!!
        var postData =
               'value='     + this.contents_new
            + '&ovalue='    + this.contents
            + '&fieldname=' + this.clicked.id
        ;

        var msg_node = YAHOO.util.Dom.get('result');

        var request = YAHOO.util.Connect.asyncRequest(
            'POST',
            sUrl,
            {
                success:  handleSuccess,
                failure:  handleFailure,
                argument: {
                    node:     this.clicked,
                    msg_node: msg_node
                }
            },
            postData
        );
    };

    E.init();
</script>
<!-- (end) preferences : tab_you -->
