// ==UserScript==
// @name           orkut one click post to community
// @namespace      http://rb286.blogspot.com/new_post
// @description    just one click to post a new topic
// @include        http://www.orkut.com*
// @include        http://orkut.com*
// ==/UserScript==

(function() {
var i=document.getElementsByTagName('a');
for (var j=i.length-1; j>1; j--) {
    var linkdata =  i[j].getAttribute("href");
    var linkparts = linkdata.split("?");
    if (linkdata.match("Community.") == "Community." ) {

        var postlink = document.createElement("a");
        postlink.href="http://www.orkut.com/CommMsgPost.aspx"+"?"+linkparts[1];
        postlink.appendChild(document.createTextNode("[P]"));

        i[j].parentNode.insertBefore( postlink ,i[j].nextSibling);

        var unjoinlink = document.createElement("a");
        unjoinlink.href="http://www.orkut.com/CommunityUnjoin.aspx"+"?"+linkparts[1];
        unjoinlink.appendChild(document.createTextNode("[U]"));

        i[j].parentNode.insertBefore( unjoinlink ,i[j].nextSibling);

        }
    }

})();


