Event.observe('addwordform', 'submit', function(event) {

    $('requestStatus').update('<span class="status">please wait while your word is beeing added</span>');
    
    $('addwordform').request({
        onSuccess: function(t) {
            var json = t.responseText.evalJSON();
            if(json.requestStatus==1){
                
                callPublish(''
                                ,{  'name': 'I added the word \"' + $('word').getValue() + '\".'
                                    ,'href':'http://tusongmatsing.com/index.html?searchString=' + $('word').getValue()
                                    ,'caption': $('translation').getValue()
                                        + '\n english : \"' + $('english_example').getValue() + '\"'
                                        + '\n filipino : \"' + $('filipino_example').getValue() + '\"'
                                    ,'properties':[{'text':'Help build our Filipino - English dictionary. Contribute a word.', 'href':'http://tusongmatsing.com/addword.html'}]
                                    ,'media':[{
                                            'type':'image',
                                            'src':'http://tusongmatsing.com/img/help_02.jpg',
                                            'href':'http://tusongmatsing.com/index.html?searchString=' + $('word').getValue()
                                             }]
                                });
                
                $('requestStatus').update('<span class="status">wow! the word you\'ve just added can now be search on this site and on iphone</span>');
                
                $('addwordform').reset();
            }else{
                $('requestStatus').update('<span class="status">ouch! some jinx stopped me while adding your word. please try again</span>');
            }
        }
    });
    Event.stop(event); 
});

