//

// Adds toolbox links to search Google web, news archive, books, scholar, and images for the title of the page.

$(function () {
    if (wgCanonicalNamespace == "Special")
        return;  // no links for special pages

    var title = wgTitle;
    if (wgCanonicalNamespace != "")
        title = title.replace(/^.*\//, "");  // subpage name only

    var query = encodeURIComponent('"'+title+'" -Wikipedia' ); 
    addPortletLink('p-tb', 'http://www.google.com/search?&q='+query,
                   'Web search', 't-googlesearch', 'Search Google for "'+title+'"', 'W');
    addPortletLink('p-tb', 'http://www.google.com/search?&tbm=nws&tbs=ar:1&q='+query,
                   'News search', 't-googlenewssearch', 'Search Google News Archive for "'+title+'"', 'N');
    addPortletLink('p-tb', 'https://books.google.com/books?&as_brr=0&as_pub=-icon&q='+query,
                   'Books search', 't-googlebookssearch', 'Search Google Books for "'+title+'"', 'B');
    addPortletLink('p-tb', 'http://scholar.google.com/scholar?&q='+query,
                   'Scholar search', 't-googlescholarsearch', 'Search Google Scholar for "'+title+'"', 'S');
    addPortletLink('p-tb', 'http://www.google.com/images?safe=off&tbm=isch&q='+query,
                   'Images search', 't-googleimagesearch', 'Search Google Images for "'+title+'"', 'I');
});

//