WasimAkram38 / IMDb Pirated Edition (Torrent, Online Streaming & Subtitles Search)

// ==UserScript==
// @author         WasimAkram38 
// @name           IMDb Pirated Edition (Torrent, Online Streaming & Subtitles Search)
// @version        3.0.5
// @description    Adds title search links to the most popular torrents, Online Streaming Sites and Subtitles sites.
// @include        http://www.imdb.*/title/*
// @include        http://imdb.*/title/*
// @include        http://akas.imdb.*/title/*
// @include        http://www.akas.imdb.*/title/*
// @grant          GM_setValue
// @grant	   	   GM_xmlhttpRequest
// @grant          GM_getValue
// @grant   	   GM_addStyle
// @require        
//original script by mungushume and r3b31 edited by WasimAkram38
// ==/UserScript==


//ad remover code by skeeto (http://userscripts.org/scripts/review/50476)
//licensed under ISC License (https://www.isc.org/software/license)

// Hide certain page elements with CSS.
var divs = document.getElementsByTagName('div');
for (var i = 0; i < divs.length; i++)
    {
	if (divs[i].id.search(/sponsored_links/) != -1)
	    divs[i].style.display = 'none';
	if (divs[i].id == 'top_rhs_after')
	    divs[i].style.display = 'none';
     }

// Remove all iframes (only used for ads)
var iframes = document.getElementsByTagName('iframe');
for (var i = 0; i < iframes.length; i++)
    iframes[i].style.display = 'none';
//end of ad remover code


var div = document.evaluate ("//div[@class='infobar']", document, null,

XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;

var title = document.evaluate ("//span[@class='itemprop']", document, null,

XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;


if(!title){ //Sub pages descriptions etc


	title = document.evaluate ("//div[@id='tn15title']//a", document, null,

XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;


	div = document.evaluate ("//div[@id='tn15content']", document, null,

XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;

}
if(!title){ //forums


	title = document.evaluate ("//div[@id='tn15']//a", document, null,

XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;

	if(title.innerHTML.match(/Board:/)){ //The first /a isn't what we want on the message board list
		title.parentNode.removeChild(title);

		title = document.evaluate ("//div[@id='tn15']//a", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
	}


	div = document.evaluate ("//div[@id='tn15']", document, null,

XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;

}


if(div && title)

{

    title = title.cloneNode(true);

    var span = document.evaluate (".//span", title, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;

    if(span)

    {

        title.removeChild(span);

    }

    var txt = title.innerHTML;



    txt = txt.replace(/\<br\>[\s\S]*/g, ""); //remove original title
    txt = txt.replace(/^\s+|\s+$/g, ''); //trim the title
    txt = txt.replace(/\s/g, "+"); //replace spaces with +'s
    txt = txt.replace(/[\?#]!\"/g, ""); //remove bad chars
    txt = txt.replace(/:/g, ""); //: breaks at least TL



    var tab = div.insertBefore(document.createElement("table"), div.firstChild);

    tab.id = "gm_links";

    _addStyle("@namespace url(http://www.w3.org/1999/xhtml); #gm_links td { width:50px; padding:0px } #gm_links img { margin:0 1px 0 0 } #gm_links a { vertical-align:top; font-weight:bold };");

    var tr = tab.appendChild(document.createElement("tr"));
     
      
     
               //Subs4free

            img = "data:text/html;charset=utf-8;base64,AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEA"+
        "AAAAAAAAAAAARUW4AKysqwCYnJ8A6urqAJd5XACkjXYAzMzMAGVUQgDQxLkAalpKAJBzVQB6euAA"+
        "FxeXAE6MyAB9k6oAn7fQAEVFkAA4fcIARkaFAK/K5QCKclkAk5PkAISmyABRUbkAKiq9ADhnlQBC"+
        "i9UAKCiiAO/v7wCKkZgA4eH2AGFh3wCkpKQAamq1AMu9rwAhIZYAiWE4AEFBhQDe3u8AiYm4AGVM"+
        "MwAQENgAnIBlAK2ttQANDcAAlIJxAHh40QC4vcIATk6TAOzq5wBDg70AT0/sANvX0wBycuMAwayX"+
        "AF09HQAICOAAMTF7ADk50AB1UzEAYzsSALKy8wDIuKcARorLAC1wsgCns78A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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAdTwAAAAAAAAkLPCkCAAAADBMAFywAAAAVUzI3TQQAADYmABIeAAAAAAAAUk4iOxkqLUMzAwAA"+
        "AABLBUYuICQ+NBxQQEgQMAAjPStKAB8NT0kmABtBDkIAJQgAAAAAFjoYEQAzIQAAAD84LgYKAAAB"+
        "RzEARRpMDwcASisGNQAAJzlEABRUURAdAAAAAAAAAAAvKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAD//wAA//8AAP8/AAAHJwAAAycAAOAH"+
        "AACAAQAACCEAADwnAAAGIAAAhiAAAP8/AAD//wAA//8AAP//AAA=";

            buildCell(tr, "Subs4free","http://subs4free.com/search_report.php?search="+txt+"&x=0&y=0&selLang=0&cat=0", img);

             //Podnapisi

            img = "data:text/html;charset=utf-8;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AADu7u4AAADu7u7u7u7u7u7u7u7u7u7u7u7u7u4AAADu7u4AAAAAAAAAAAAAAAAAAAAAAAAAAADu"+
        "7u7u7u7u7u7u7u7u7u7u7u7u7u4AAAAAAAAAAAAAAAAAAAAAAAAAAADu7u4AAADu7u7u7u7u7u7u"+
        "7u7u7u7u7u7u7u4AAADu7u4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAADu7u4AAADu7u7u7u7u7u7u7u7u7u7u7u7u7u4AAADu7u4A"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAADu7u7u7u7u7u7u7u7u7u7u7u7u7u4AAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAADu7u4AAADu7u7u7u7u7u7u7u7u7u7u7u7u7u4AAADu7u4AAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AADu7u7u7u7u7u7u7u7u7u7u7u7u7u4AAAAAAAAAAAAAAAAAAAAAAAAAAADu7u4AAADu7u7u7u7u"+
        "7u7u7u7u7u7u7u7u7u4AAADu7u4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADu7u4AAADu7u7u7u7u7u7u7u7u7u7u7u7u7u4AAADu"+
        "7u4AAAAAAAAAAAAAAAAAAAAAAAAAAADu7u7u7u7u7u7u7u7u7u7u7u4AAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAADu7u4AAADu7u7u7u7u7u7u7u7u7u7u7u4AAADu7u4AAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAADu7u7u7u7u7u7u7u7u7u7u7u4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";

            buildCell(tr, "Podnapisi","http://www.podnapisi.net/ppodnapisi/search?tbsl=1&asdp=0&sK="+txt+"&sM=0&sJ=0&sY=&sAKA=1", img);

            //OpenSubtitles

            img = "data:text/html;charset=utf-8;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAEgAAABIAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/"+
        "//////8AAAD///////8AAAD///////8AAAD///////8AAAD///////8AAAAAAAD///////8AAAD/"+
        "//////8AAAD///////8AAAD///////8AAAD///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACqqqr///////+qqqoAAAAAAADMzMzu7u7///////9V"+
        "VVUAAAAAAAAAAAAAAAB3d3eZmZkAAAAAAACZmZmIiIgAAACIiIgAAAAAAABERETd3d0AAAAAAAAA"+
        "AAAAAADu7u4REREAAAAAAAARERHu7u4AAABERET////////d3d0zMzMAAAAAAAAAAAAAAADd3d0i"+
        "IiIAAAAAAAARERHd3d0AAADd3d1EREQAAAAAAAAAAAAAAAAAAAAAAAAAAAB3d3eZmZkAAAAAAACq"+
        "qqp3d3cAAADMzMxEREQAAAARERHd3d0AAAAAAAAAAAAAAAAAAACZmZn///////+qqqoAAAAAAAAi"+
        "IiLu7u7////////u7u4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAD///////8AAAD///////8AAAD///////8AAAD///////8AAAD///////8AAAAAAAD/////"+
        "//8AAAD///////8AAAD///////8AAAD///////8AAAD///////8AAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";

            buildCell(tr, "OpenSubtitles","http://www.opensubtitles.org/en/search/sublanguageid-all/moviename-"+txt, img);  

            //SubScene

            img = "data:text/html;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA"+
        "BGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VG"+
        "AAADAFBMVEUNLgAlRxYWOwYPMAAOLgAQLwANKwAHKAAKLAALLQANLwAZOwoJKwAJKQArTAAIKAAN"+
        "KgAOMgFVdwDG/xcCIwAFJgBEeQECJAARMwAYOglZjAUpTBMKJwBDYQA/dAABIwAAIQKh0QAaOw89"+
        "YQAbPhABGwAsVgIKJADL/ykJKQAYPQgZPglJaAAFKgB4rQCg3AAPMAB0rgCh5wBYdwAvTAAROgEX"+
        "OAAcMgAFJQC17QCFwwDE/xxSiwAAJgNxrwBwogByogAzYgC0/wiu9wAYOhB9lgDE9ABijACYvwWT"+
        "1wA/dQArSR2DpAAOLQAXPAkHIwAZNQAHKwEJJwBwpQArSgBAWAALKgC06wBAag8YQQgAIwAJLQA5"+
        "WwAQRwwyWABZjgdCZhJYiQh5vwC5/wwrSgAeOwAZQQCErAAOLQAWNQcWOQvA/wF/uQAaPwa3/gCF"+
        "uABnmAB+oQA/XgiTzQANKwBQciIGJgAHJQANKwCLyQAsViwwUwAbNgBEbwCh3gAZOg6DqgBBbACj"+
        "4gBWiwAUQgEXPAcMKQAkSBEMIwAwShcdQQqn6gAQKwCLwgCf5QAmSQ4LLwBYewlHcQCJwABLZQDA"+
        "/wwaPQoPLwCYmJiZmZmampqbm5ucnJydnZ2enp6fn5+goKChoaGioqKjo6OkpKSlpaWmpqanp6eo"+
        "qKipqamqqqqrq6usrKytra2urq6vr6+wsLCxsbGysrKzs7O0tLS1tbW2tra3t7e4uLi5ubm6urq7"+
        "u7u8vLy9vb2+vr6/v7/AwMDBwcHCwsLDw8PExMTFxcXGxsbHx8fIyMjJycnKysrLy8vMzMzNzc3O"+
        "zs7Pz8/Q0NDR0dHS0tLT09PU1NTV1dXW1tbX19fY2NjZ2dna2trb29vc3Nzd3d3e3t7f39/g4ODh"+
        "4eHi4uLj4+Pk5OTl5eXm5ubn5+fo6Ojp6enq6urr6+vs7Ozt7e3u7u7v7+/w8PDx8fHy8vLz8/P0"+
        "9PT19fX29vb39/f4+Pj5+fn6+vr7+/v8/Pz9/f3+/v7////M/32SAAAA8UlEQVR42jTPQ3sDARQF"+
        "0DczMeqmZmrbZmobqW3bNu/9u13k6/bsjigAgPbH+9vzOCugiEqS7N/6jA+dDCdVSSFJmmdcN1de"+
        "JhJS56PpDiidK68XgRYScpS/47u6b3+abpg1kYSE7Rq8T5vnHL8/wxp5B1mcGCw6yZnKWH/oymrb"+
        "e28R60JFQnRuac2GIbLDdu2OFdjHt4OjNv3LenuqDytfQgT6oKqS5ONWv6batcZugYBiPvu+jMhM"+
        "Ku4LsBAC6o15y8/ZMfWFRo2EgGT66MBbWuII+Q8sd87rPugBT872VSAkSVUUAEhdGhsCAED5GwDK"+
        "R14PRSW3MQAAAABJRU5ErkJggg==";

            buildCell(tr, "SubScene","http://subscene.com/filmsearch.aspx?q="+txt, img);

      
	   //yify

    img = "data:text/html;charset=utf-8;base64,AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEA"+
"AAAAAAAAvwAAHjMdABpTFgAeKxsAAMUAAAqdDQAhKxsAAMsAABZfFgAFtQQAHjQbACQfHAALmAsA"+
"EX8PAA2UDgAjHh8AICEfACAlHAAWZRYAAbACAAOwAgAQdhAAAagAABhdFAAcHx0ACqgIABw1GQAW"+
"YBQAHh8dAB4xHAAYYBQAA8sBABo7GQAfHiAAIR4gACMeIAAWbBQAEYkNABwgGwACtgMAIyAbAAqr"+
"CQASXBAAE1QWACEfHgAMmQoAAMAAABlRFgAExwUACqAHACMfHgAHnwoAJB8eABdQGQAhI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"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAARIcjJk4kfTlte2sXZ4csREY/LFgJPToNYTtpKTwvQDIhC4MuM3BGcoZ5XYYIUAJqcluFXiwi"+
"VEwdgDJGHIRKQzhudkYmPyA+BV+HMix1BlFSTQEjRF9nMHtjRF9GhmVib2gmRBAyHHEfKkJlX0JG"+
"clYeRFwyRl8lB1pdEEZ1RkQTRV8PLECGLQRVGodGRCxGFDVCh19EEWBmABk2h3IcXzEbh3ksNCsA"+
"J3N0FRgiLEYSWXccQmUOFgxBV2RILCIsR1N+LHlfN0l4LEt/T4ZfXyx8bEYsQnIoRiGBHCwscjRE"+
"dUWCRCwsRj9yMiEsh3qGX3oyCgMsRkBfEA8sX19dXwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";

    buildCell(tr, "yify","http://yts.re/browse-movie/"+txt+"/All/All/0/latest", img); 
       //isoHunt

    img = "data:text/html;charset=utf-8;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAQAMAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAD39vX28e/5+fUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAACkim2EWjTazb0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACk"+
"imdmMwDBq5oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQv6qymH4AAACulH1mMwCpi3EA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD08O16UCaAXDPs5N/Mu6xmMwCgfl8AAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAD7+viadFNzRRPl3tjn39dyRBaJYz4AAAAAAAAAAAC7qJaQbUvfzsYA"+
"AAAAAAAAAAAAAAC1m4ZmMwDGs57p4tqFXjh9VCXo4dgAAAAAAADZyrx1SByMbEUAAAAAAAAAAAAA"+
"AADJvKtsPQujh2n7+/qUd1dmMwB1Rxl3SRx3SRx1RxlmNAGKZj/l2NMAAAAAAAAAAADk1c5wQBGN"+
"Z0H18O2niGNmMwBtPA52SRx2SRx2SRxtPQxoNQPl2tQAAAAAAAAAAADz8eyHXz9xQxXt6OTMvrNp"+
"NwW1mYQAAAAAAAAAAACxloNmMwC6p40AAAAAAAAAAAAAAACjgGJsOgrTx7Xs49uFXjeXdlXv6uMA"+
"AAAAAADXzb9sPAujgWYAAAAAAAAAAAAAAAC/rZlmNAG4n4gAAAAAAAAAAAAAAAAAAAAAAADn39d3"+
"TCGDWS7PwbQAAAAAAAAAAADx7ei6pI7Yyr0AAAAAAAAAAAAAAAAAAAAAAAAAAACJZD9rOgrIs54A"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADGsZxmMwCkjnAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADSwLdtPQqDWjL08vAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAADy7uju6eQAAADx/wAA8f8AAPH/AACR/wAAAf8AAAHHAACA"+
"xwAAgAMAAIADAACA4wAAwGMAAMfhAADH8QAA//EAAP/wAAD/+QAA";

    buildCell(tr, "isoHunt","http://isohunt.to/torrents/?iht=5&ihq="+txt, img);  

      //Bitsnoop

    img = "http://www.google.com/s2/favicons?domain=http://bitsnoop.com";

    buildCell(tr, "BitSnoop","http://bitsnoop.com/search/all/"+txt, img);
  
  //Torrentz

  img = "http://www.google.com/s2/favicons?domain=torrentz.eu";

    buildCell(tr, "Torrentz","http://torrentz.eu/search?f="+txt, img);   

     //KIckAss

    img = "data:text/html;charset=utf-8;base64,AAABAAE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//0+Pn/"+
"/////6zL1f9jna//Y52v/2Odr/9jna//Y52v/zdXYVwAAAAAPF5od2ehsv9nobL/Z6Gy/2ehsv9n"+
"obL/xtzi///////f6+//Z6Gy/2ehsv9nobL/Z6Gy/2Wdrv80UVoSAAAAADZTXBJkmqr+a6W2/2ul"+
"tv9rpbb/a6W2/2ultv9rpbb/a6W2/2ultv9rpbb/a6W2/2ultv9SfovlAAAAAAAAAAAAAAAAS3J9"+
"xG+ouf9vqLn/XIuZ9GGTovpvqLn/b6i5/2+ouf9gkqD5Zpqp/W+ouf9vqLn/QWJsdwAAAAAAAAAA"+
"AAAAADtZYhdbipfxQWJrbgAAAAAAAAAAR2t2p2CRn/dBYmtuAAAAAAAAAABGanSgVH6L3wAAAAAA"+
"AAAA/j8AAPgPAADwBwAA4AMAAMADAADAAQAAgAEAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAB"+
"AADAAQAAxjMAAA==";

    buildCell(tr, "KickAss","http://kat.ph/usearch/"+txt+"/?categories[]=movies&categories[]=tv", img);

   
     //PirateBay

    img = "data:text/html;charset=utf-8;base64,Qk04AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADgTAAA4EwAAAAAAAAAAAAA////"+
"/////////////////////////////////////////////////v7+/////////////Pz8vb297Ozs"+
"////////////////////////////////4uLiSUlJ3d3d////////8/PzEhIScnJy8fHx////////"+
"////////////8fHxwsLCWFhYAAAAyMjI////////5+fnEBAQICAgQkJCV1dXZWVli4uLiYmJUlJS"+
"KioqPT09bm5uHh4eYWFhwcHBubm5bGxsQEBAp6end3d3FBQUAAAAFBQUOTk5ISEhGRkZPT09WVlZ"+
"QkJCKioqJycnenp6AAAAQUFBPz8/YGBgjo6O0dHR+/v7////////7+/vxcXFnZ2dg4ODExMTQEBA"+
"v7+/AAAAgoKCjo6OpaWltra2qqqqpqampaWlpKSkra2tr6+vsbGx5eXll5eXW1tb1NTUcXFxmJiY"+
"AwMDAAAANzc3VFRUGxsbAAAAX19fPDw8ERERAAAAQUFB/v7+/Pz8////////nJycAAAAAAAAAAAA"+
"Hx8fCwsLAAAAJiYmBQUFAAAAAAAAKysr+vr6////////////nJycAAAAAAAADw8PAAAAAAAAAAAA"+
"AAAADQ0NAwMDAAAANjY2+vr6////////////rq6uAAAANjY25eXlWVlZHx8fJycnIyMj0dHRhoaG"+
"AAAAV1dX////////////////r6+vAAAALS0t0tLSX19fsrKy2dnZZWVlsrKyiIiIAAAAWVlZ////"+
"////////////r6+vAAAAAAAABQUFAgICExMTEBAQAwMDAwMDAQEBAAAAWlpa////////////////"+
"q6urAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVFRU////////////////19fXSUlJQUFB"+
"Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQkJCQkJCqKio/////////////////////////v7+/v7+/v7+/v7+"+
"/v7+/v7+/v7+/v7+/v7+////////////AAA=";

    buildCell(tr, "PirateBay","http://thepiratebay.se/search/"+txt+"/0/99/200", img);  

 // Watch Series

    img = " http://www.google.com/s2/favicons?domain=http://watchseriesonline.eu";

    buildCell(tr, "Watch Series","http://watch-series.ag/search/"+txt, img);
		     //Tube+(TV)

    img = "http://www.tubeplus.me/favicon.ico";

    buildCell(tr, "Tube+(TV)","http://www.tubeplus.me/search/tv-shows/"+txt, img);
	     //Tube+(Movies)

    img = "http://www.tubeplus.me/favicon.ico";

    buildCell(tr, "Tube+(Movies)","http://www.tubeplus.me/search/movies/"+txt, img);   	
   
     //Solar Movies
	
    img ="http://www.google.com/s2/favicons?domain=solarmovie.is";

	buildCell(tr, "Solar Movies","http://www.solarmovie.is/movie/search/"+txt, img);      
     //Movies4K

    img ="http://www.google.com/s2/favicons?domain=http://movie4kto.come.in";

    buildCell(tr, "Movies4K","http://movie4kto.come.in/movies.php?list=search&search="+txt, img); 
 

	     //Primewire

     img = " http://www.google.com/s2/favicons?domain=primewire.org ";
     buildCell(tr, "Primewire","http://www.primewire.ag/index.php?search_keywords="+txt, img);
	     //Youtube

    img = "data:text/html;charset=utf-8;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAA"+
"AAAAAAD///8AEiP//xIj//8SI///EyP//xIj//8SI///EiP//xIj//8SI///EyP//xIj//8SI///"+
"EiP//xIj//////8AEiP//wAc7v8AHO7/AB3v/wAc7v8AHO7/ABzu/wAc7v8AHO7/ABzu/wAd7/8A"+
"He//ABzu/wAc7/8AHe//EiP//xIj//8SI////////09V//+6uv////////////9PVf//z87/////"+
"//+ysv//EiP//5ub////////0tH//xIj//8SI///EiP///////9PVf///////xIj////////T1X/"+
"//////8SI////////5qZ////////EiP//xIj//8TI///EiP//xIj////////T1X///////8TI///"+
"/////09V////////EiP///////+amf/////////////S0f//EiP//xIj//8SI////////09V////"+
"////EiL///////9PVf////////////+6uv//EiP//7q6///v8P//0tH//xIj//8SI///EyP/////"+
"//8SI///EiP//xIj//8SI///EiP///////8SI///EiP//xIj//8SI///EiP//xIj//8SI///EiP/"+
"/////////////////xIj//8SI///EiP//xMj////////EiP//xIj//8SI///EiP//xIj//8SI///"+
"EiP//9nZ//8SI///EiP//xMj//8SI///EiP//xIj//8SI///EiP//xIj//8SI///EiP//xIj//8S"+
"I///EiL//9na////////////////////////////////////////////////////////////////"+
"//////////////////////////////////+r5/b/AAAA//372P//////R5K5/wAAAP/IiWb/////"+
"/26v1f8AAAD/rGZE////////////////////////////qub1/wAAAP/+/Nj/qub2/wAAAP//////"+
"AAAA//782P8TcJ3//vzY/wAAAP///////////////////////////6rm9f8AAAD//vzY/6rm9v8A"+
"AAD//////wAAAP/+/Nj/AAAA//////8AAAD///////////////////////////9ur9b/AAAA/+PF"+
"ov//////R5K6/wAAAP/JiWb//////wAAAP//////AAAA////////////////////////////AAAA"+
"//+p7/8AAAD/////////////////////////////////////////////////////////////////"+
"bq7V/wxKf///////rGZE/+PFov//////////////////////////////////////////////////"+
"////gAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+
"AAAAAAAAAAAAAA==";

    buildCell(tr, "YouTube","http://www.youtube.com/results?search_query="+txt+" trailer", img);
	
}



function buildCell(container, title, href, image)

{

    var a = document.createElement("a");

    a.href = href; 
    
    a.setAttribute("target","_blank");
	a.title=title;
	

    var img = document.createElement("img");

    img.src = image;
	img.setAttribute("height","16");
	img.setAttribute("witdh","16");


    a.appendChild(img);

    var cell = container.insertCell(0);

    cell.appendChild(a);

}



function _addStyle(css)

{

    if (typeof GM_addStyle != "undefined") {

        GM_addStyle(css);

    } else if (typeof addStyle != "undefined") {

        addStyle(css);

    } else {

        var heads = document.getElementsByTagName("head");

        if (heads.length > 0) {

            var node = document.createElement("style");

            node.type = "text/css";

            node.innerHTML = css;

            heads[0].appendChild(node); 

        }

    }

}

/********** SCRIPT VERSION CONTROL 0.5 *************/
/* Any help about this functions can be found at
http://sylvain.comte.online.fr/AirCarnet/?post/GreaseMonkey-Script-Update-Control
*/
/* parameters */
/* SET YOUR OWN SCRIPT VALUES */
var thisId=161703;		// your script userscript id
var thisVersion="2.0.0";		// the @version metadata value
var thisReleaseDate="20130520"; // release date of your script. Not mandatory, use this paramater
								// only if you want to be sharp on version control frequency.

/* script version control parameters */
var GMSUCtime=15;   // Delay before alert disapears (seconds)
                    // set to 0 if you don't want it to disapear (might be a bit intrusive!)
var GMSUCfreq=2;    // Update control frequency (days)

/* colorpalettes */
	// feel free to create your own. color in this order : back, highlight, front, light.
	var cpChrome=new colorPalette("#E1ECFE","#FD2","#4277CF","#FFF");	// but for Firefox ;-)
	var cpUserscript=new colorPalette("#000","#F80","#FFF","#EEE");		// javascrgeek only
	var cpFlickr=new colorPalette("#FFF","#FF0084","#0063DC","#FFF");	// pink my blue
// choose yours
var GMSUCPal=cpUserscript; 	// colorPalette you prefer

/* launching script version control  */
GM_scriptVersionControl();

// define launch function
function GM_scriptVersionControl() {
	if(self.location==top.location) { // avoid script execution in each frame of the page
		// test if script should be performed to control new release regarding frequency
		var GMSUCreleaseDate=new Date();
		GMSUCreleaseDate.setFullYear(eval(thisReleaseDate.substring(0,4)),eval(thisReleaseDate.substring(4,6))-1,eval(thisReleaseDate.substring(6,8)));
		var GMSUCtoday=new Date(); var GMSUCdif=Math.floor((GMSUCtoday-GMSUCreleaseDate)/1000/60/60/24);
		if (GMSUCdif%GMSUCfreq==0) {
			GMSUC_Control();
			}}}

// define control function
function GMSUC_Control() {
	var scriptId=thisId;var version=thisVersion;
	var scriptUrl="http://userscripts.org/scripts/source/"+scriptId+".meta.js";
	// go to script home page to get official release number and compare it to current one
	GM_xmlhttpRequest({
		method: 'GET',
		url: scriptUrl,
		headers: {
			 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey/0.3',
			 'Accept': 'text/html,application/xml,text/xml',
			 },
		onload: function(responseDetails) {
			var textResp=responseDetails.responseText;
			var offRel=/\/\/\s*@version\s*(.*)\s*\n/i.exec(textResp)[1];
			var scriptName=/\/\/\s*@name\s*(.*)\s*\n/i.exec(textResp)[1];
			if(offRel!=version) {
				// Styling
				GM_addStyle("#GMSUC-alerte {position:absolute;top:80px;left:35px;margin:50%px 0 0 -128px;padding:6px;width:250px;-moz-border-radius:6px;background:"+GMSUCPal.light+";border:"+GMSUCPal.back+" 1px solid;color:"+GMSUCPal.back+";font-size:1em;text-align:center} #GMSUC-alerte a {font-weight:bold;font-size:1em} #GMSUC-alerte * {color:"+GMSUCPal.back+";} #GMSUC-alerte table {width:100%;margin:0.5em 0 0 0} #GMSUC-alerte td {width:33%;text-align:center;border:solid 1px "+GMSUCPal.back+"} #GMSUC-alerte td:hover{background:"+GMSUCPal.high+"} #GMSUC-alerte td:hover a {color:"+GMSUCPal.back+"} #GMSUC-timer {font:2em bold;margin:0.5em 0 0 0} #GMSUC-info {text-align:right;font:0.5em serif;margin:1em 0 0 0} #GMSUC-info a {font:0.75em serif}  #GMSUC-info a:hover {background:"+GMSUCPal.back+";color:"+GMSUCPal.front+"}");
				// Lang detection and apply
				var Langues="en, fr";
				var lang=navigator.language;
				var reg=new RegExp(lang,"g");
				if(!Langues.match(lang)) lang="en";
				/* traductions / translations */
					var Txt=new Array();
					for(i=1;i<7;i++) {Txt[i]=new Array();} 
					// francais
					Txt[1]["fr"]="Vous utilisez la version";
					Txt[2]["fr"]="du script";
					Txt[3]["fr"]="La version officielle est differente";
					Txt[4]["fr"]="installer";
					Txt[5]["fr"]="voir le code";
					Txt[6]["fr"]="propulse par";
					// english
					Txt[1]["en"]="You're using";
					Txt[2]["en"]="version of";
					Txt[3]["en"]="script. There's an update avalable";
					Txt[4]["en"]="install";
					Txt[5]["en"]="view source";
					Txt[6]["en"]="powered by";
				/* ------------------------------- */	
				var alerte=document.createElement('div');
				alerte.setAttribute('id','GMSUC-alerte');
				var GMSUCtextAlerte=Txt[1][lang]+" "+version+" "+Txt[2][lang]+" <i><b>"+scriptName+"</b></i>";
				GMSUCtextAlerte+=". "+Txt[3][lang]+" (<a href='http://userscripts.org/scripts/show/"+scriptId+"'>"+offRel+"</a>)";
				GMSUCtextAlerte+="";
				GMSUCtextAlerte+="<table><tr><td><a href='http://userscripts.org/scripts/show/"+scriptId+"'>v."+offRel+"</a></td><td><a href='http://userscripts.org/scripts/review/"+scriptId+"'>"+Txt[5][lang]+"</a></td><td><a  href='http://userscripts.org/scripts/source/"+scriptId+".user.js'>"+Txt[4][lang]+"</a></td></tr></table>"
				if(GMSUCtime>0) GMSUCtextAlerte+="<div id='GMSUC-timer'>"+GMSUCtime+" s</div>";
				GMSUCtextAlerte+="<div id='GMSUC-info'>"+Txt[6][lang]+" <a href='http://sylvain.comte.online.fr/AirCarnet/?post/GreaseMonkey-Script-Update-Control'>GM Script Update Control</a></div>";
				document.body.appendChild(alerte);
				document.getElementById('GMSUC-alerte').innerHTML=GMSUCtextAlerte;
				if(GMSUCtime>0) {
					function disparition() {
						if(GMSUCtime>0) {
							document.getElementById("GMSUC-timer").innerHTML=GMSUCtime+" s";
							GMSUCtime+=-1;
							setTimeout(disparition,1000)
							}
						else document.getElementById("GMSUC-alerte").setAttribute("style","display:none");
						}
					disparition();
					}
				}
			}
		});
	}

/* Color palette creator */	
function colorPalette(b,h,f,l) {this.back=b;this.high=h;this.front=f;this.light=l;}	
	
/******* END OF SCRIPT VERSION CONTROL **********/