function make_link(elem,cible,title,img)
{
	var newLink = document.createElement("a");
	newLink.href=cible;
	newLink.target="_blank";
	var new_img = document.createElement("img");
	new_img.src=img;
	new_img.title="Chercher sur " + title;
	new_img.alt="Chercher sur " + title;
	newLink.appendChild(new_img);
	elem.appendChild(newLink);
}
function make_link_movieInfos(elem,cible,title,img)
{
	var newLink = document.createElement("a");
	newLink.href=cible;
	newLink.target="_blank";
	var new_img = document.createElement("img");
	new_img.src=img;
	new_img.title=title;
	new_img.alt=title;
	newLink.appendChild(new_img);
	elem.appendChild(newLink);
}
function add_links()
{
	var search_array = document.getElementsByTagName("TD");
	for (var n = 0; n < search_array.length; ++n){
		var Td = search_array[n];
		if (Td.innerHTML.match(/flag/))
		{
			var z=1;
			do{
				++z;
			} while (search_array[n+z].innerHTML.match(/ng_id/));
			var newelem=search_array[n+z];
			var req=newelem.innerHTML.replace(/ /g, "+");
			var method2=encodeURI(newelem.innerHTML.replace("&amp;"," "));
			req=req.split("*").join(" "); 
			var div = document.createElement("div");
			var req_amp=req.replace("&amp;","&");
			var method1=escape(req_amp);
			var method3=encodeURI(req).replace("&amp;","%26");
			if (newelem.innerHTML == "&nbsp;")
			{
				continue;
			}
			make_link(div,"http://NiouzeFire_Plus_Search/"+method1,"NiouzeFire+","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAWCAYAAADTlvzyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAACBZJREFUSEt1lns4ldkex9e7L/ZGxK6UMImUXCrVsaPciiJHUylRpoxEiVBqSjWmi+mUMnS/GpWabqYrcujCcRohJQmxEyph3BOx29/z2zqd5/TH7Of57rXe9bzr9/nd3mctxv7iZx8q40gaJKn1uhfrRy+5dHnEnEOPhrlufzlkzqY3OrOj6/T8D1cY+pzIMQ9/ftwhotx31roS45DYC6LWGgmv950KT96gwk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CouK/wGKG9xRl3T2KtoChT5lCpQjaeUuInBBtREgMYDZQ+snEbnuapftRo1//Rt/Kl6MefMZDEOM+XfcKVdRRt1HxO1PUGo4sndfkqDYYU1WEmKUzAAvNtZAYqorKC3y8v8JBdpzD81gORes5ZHpwOGggxDyBLozEoxR6pr5vzdwObZzwbdJAv8Xp/TAMGsRgbU0TRlcAxvhdt/3OdyWo3e32Zr65xtMHUfdaWc7/LXaY+aIyVW3jHsbx6DUOYtIIjsNkjmEKaSyZ0BWqKXT0pK0jpOF3rbyurbXwOGVsG5D/9f3lfxF+BvLk45khOKb6ZX1GcLnykxGQDKetLvcfv/ByiqHtBpnuuGWdQ8d6yYeZ+fTqWQW2mEzf9cT6+9z99iFVzvSull2IjPuri5ly/T/43y4fIswY8AAAAABJRU5ErkJggg==");
			make_link(div,"http://www.binsearch.info/?max=250&adv_age=&server=1&q="+method1,"Binsearch","data:image/png;base64,[encoded data, 5352 characters]");
			make_link(div,"http://www.binsearch.info/?max=250&adv_age=&server=2&q="+method1,"Binsearch \"other groups\"","data:image/png;base64,[encoded data, 5360 characters]");
			make_link(div,"http://www.nzbindex.nl/index.php?go=search&age=&results=250&sort=age_desc&searchitem="+method3,"NZBindex.nl","data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAWCAYAAAGkkcxkAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABMlJREFUeNpi+P//P4OgoKAsCDOAAEiAwWze/3v37gMZDBxggfcfv/z//v07WAAggBi5ubmF2NjYuMHKp06duuvajTv/GXRm/Wfi5+dnUFeWZXh/NIoBIIAYQfr6+vp2eXh4uIINBQJGRkYGbW1tThYQR0BAgEE7/CgDAzszw+sd/gyiDmshikCqra2ti2RlZZ0YkMDKlStDAAIILCkkJCSLLAEy9u3bt4/Bxh45cuQRSBFIEAR4eHjAaphA5NK9bxiCG64xaEcdY5i55SWDhCgfWBFYkp2dg6E6ThPIY2RgY2djYOPkRzjo69f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bj1O8/3CgUsx/+uiShGXRNL1BmDptDdnGwK4O4XPB3F3EwsR4CLdbi1iYjuHu6hH3/xxVTK4jR8hzo4l3+4D6tPcI+YQGJKLDJqJDJhFUki0/Nr9MI/91CmNBQ+lHIwHlsKYZCAddPEmInr3E7dgZjdGRy+W2eXw4jk17wlHCz7b9Ig192XGaOi+eTzab/dnYMf8dNS5/ZD1S0RPftC7fqLYdRryTRm1W3gMcPPo7bIyKjYdai5NneQAnEnLrIpsAAAAASUVORK5CYII=");
			make_link(div,"http://www.nzbclub.com/nzbsearch.aspx?ss="+method1+"&rpp=200&rs=1&sa=1","NZBClub","data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAWCAYAAADTlvzyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA+lJREFUeNqsVc9vG0UU/vaXvdSJ4/iHaEISUey2UAGNoa7iW6CAkIpKDz0gQBx6QIoQqsQxEtf+ASBUiUMvlIIQBxRASIS2EarUCA4g0pIgJW1K2roiztqxY8fr9WaZN/ZsN2vH6aFP2p03b2be9+a9b2Ykx3EgJJ1Oy5FIZKher+/ZYoJdRJIkiPXUUl/YScjF3Nzcimmam41Gg9tUr4NKpaJls9mx/v7+QQZqiYXdAIVj+qgvy7JopVKp5MzPz09Vq9UVd413h/F4/PHp6ekrAweefQaPQIorSw7bwPvFYvECw6mRTfZOYEaZbd3GIxIGJFmW1cfUgLCpvjm0XV670xev4XBUxZnXMzh/5Q8sGTUkozqu5mrbFkxkhnDu9ztuP9UjYfLEmLeudssv2nbolbzaj5mCjsV7q7hfNpEzgeFoL3c4EGyOF6QeFKsm14V9thbhAQpAv7QB6rru6rai4ezMott/9XCKR2/Um44mj0Q6BkuBkSiKQqBSV0BiWFRrOnxOKfDob5QfTDs7NYu7ShQnE5vI7B927YsbDpZrChTbwvqmyW2aplWZP2dXQMNqBjWeSiDeKKCshXmfUkUpS8HA6ZfS29adfzuLL985Cs2xcOnWOrexo2X4j5a609kSMjmewkdX17jOCaM+hkVEceKbBW4b04vsH3H7UPfg2EhQLO/113FHwA8Pqnhh3wBi4RA+ThMzQ02qV81t8/clksisrnv6fUgNJprpk+W+XQHpphAEEeKtVScRAH4JBoOuv4dK6deXruHp4QGMHniS6+OjB7E3FsX9NQPXl+7glaPP45ff/kI8EsbCSs5d99axLG83Njagqmp3QCHHP/8VksVSeTeA43/fxE/1QeDPf7izGdZ+dSPPAT+dvY2RgIXb0UPYWv0XjqZj6vq3uHjmFAfzp7QjS899d5nrP3zwGt59oo7soace6ioLN0o8yFhQdlNq23Z3QPGMCCmUN5Evltqc24rLRAyGH1wWeqOCW3aPOBbwv3JtgJT3iZMvQ9JDeOOzn/FjqQ/5coWPXVgo481PvudByIkRrjt79yOTGuLjJTWMmhpih990n62u55DyTVHxdL73Yos0MU4aMB0xurJ6OXmyayVGlDjivXVey3xZjLMLY/RIxzPdBsgmSKzQsp9tfp2E2MoD2WFc1JDctr6OO5QMw1CHiv+BvWN8x5QW0qn41FKNBRHociYmsjuTt+K1b92jyOVy1Fe2bcpLWzYplEwmJwKBQJYB2U5TeCDez5cVR3zed4+yRQEuLy9/wYK8zNZV2gBb0dGue7xp8KRFbn2S78HeaulOhwedGGQyHE7X/wUYAMQwvzKmQ3f/AAAAAElFTkSuQmCC");
			make_link(div,"http://www.yubse.com/index.htm?q="+method1,"YUBSE","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwQAADsEBuJFr7QAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAErElEQVRIS+WV+09bZRjH9yttTwuCIBVnUKbMJcwx5m4UDjDGZdzGrWWMIbdyKYW2lAK9cWhL21GuLRQozmKpXATmanRjW6DgZkJ0i9EfjP/N17enJi7p3ND4m02evCfnnD6f5/t9nve8x479L379Rj0jKi9l5EODkA8OIqu8jFHrtEzgmwD9r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X9W/iJgnADtxC7SE6HZAYnLCbPN+urv0QjxL09nRIJKy/ratHkP7YEdFPq30PvwAO3396DefYoecp3t24RwYh5v252oXFiEkVS/tbX16k/32uoqzZAXK602pBgtEPvWcXrGA82jfcge7JHE+zAeHEJBVhHZ1Zc8X+BT7+ds8oWFhaOdC4FAgDZZR4NdtlFUOF1IH3ci+bYTSY5ZJJGK3yPATxa8qPP7oXLNQD/CBFdJYUc6D158yefzMYzFFNQ67FBMjUM254J8fjacdGIsNC3weDxHO2heR19bW2PcbjczNzfH+P3+/ybp66BHef4H9ATeEtpGK2cAAAAASUVORK5CYII=");
			make_link(div,"http://www.nfonews.com/collsrchresults.asp?look_for="+method1,"NFO:News","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAWCAIAAABc9GulAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwQAADsEBuJFr7QAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAFBklEQVRIS5VVaXPaZhDmf2f6F5rYCT4KvsAcxgiBEAIkge77BHHYiNux3ST22EnHSWZytI/j9HObHUazs+/7Prv77EHCNMxkcpskqy+eb2wltzY2Xr54sanrxu/PN1Kp/YvXr79//05WqslXWxRVT6X33r9///d/ScIwrCrVyOULxRKxu5tmO2K5UqsQZJsXupLW70ffvn0jSQrGcrlSZ1o3NzcfPnz4+PHj58+fHx4ePn36BP1JgR0KgkjYjme6vaNMjhfVTDY/OJ/TTT6bK1he3w4Grh9++fKl0WjafpTJ5gzbH4/HLMt5nhdFA1XVHNe1LEvVdMd2WJY3DAO4Cc8LorMpQFXDyRdK57M1IIhKTdFt/IJehEtMsw374dGxG0QEQRZLFSR3nM39kdqHp1T6YP8wm0zuFE/JCllfLJePoON4mS+WdcsDBWfTJTxTdBO5d0TFcYOw1ysT5HR1VTgpm04A97Jma6abTu+fVqhSmSycEBTdPsoWfti9wXCccD1/FC/bvGQ4Qa5QGpzNSbJWpRheUNiu1BGU7Z0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KJyWipJopg5OuI5bjGfV4gKOLEtG0dgHHJ1dfULoF+/fp3GMfpkuVj0e31UGL0x/CGgNZ7Ei8UCDfrw8PAPCWi9qKfW9TQAAAAASUVORK5CYII=");
			div.style.display = "block";
			newelem.appendChild(div);
		}
	}
}

// Delete the add by removing all iframes
function Binsearch_DeleteAd()
{
	var iframes = document.evaluate('//iframe', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
	for (var j = 0; j < iframes.snapshotLength; j++)
	{
		var iframe_obj = iframes.snapshotItem(j);
		iframe_obj.parentNode.removeChild(iframe_obj);
	}
}

function cleanup(str)
{
	/* Small function to cleanup a string, remove html tags, underscores, weird characters etc. */
	str = str.replace(/ \(?(\+|sur)?(\s*a(lt)?.*\.?b.*\.[a-z0-9\.\-_@]+)\s*\)?/ig, '')
		.replace(/(autres? post|\*.*\*)/i, '')
		.replace(/\"/g, '') // "
		//.replace(/\'/g, '') // '  //do not replace '
		.replace(/\./g, ' ') // . --> space
		.replace(/_/g, ' ') // underscore to space
		.replace(/\(/g, ' ')//(
		.replace(/\)/g, ' ')//)
		.replace(/ +/g, ' ') // double spaces
		.replace(/ $/, '') // remove last lonely space
		.replace(/&amp;/g, 'et') 
		.replace(/<\/?[^>]+(>|$)/g, ""); // HTML TAGS
	return str;
}
function in_array(value, tableau)
{
	var i;
	for (i = 0; i < tableau.length; i++)
	{
		if (tableau[i] == value)
		{
			return true;
		}
	}
	return false;
}
function extractUrlParams()
{
	var t = location.search.substring(1).split('&');
	var f = [];
	for (var i = 0; i < t.length; i++)
	{
		var x = t[i].split('=');
		f[x[0]] = x[1];
	}
	return f;
}
function setProtectedRow(row)
{
	//row.setAttribute("title", "Mot de passe ou virus");
	row.style.backgroundColor = "#FDD5D7";
}



function addratingLinkToElement(element, ratingLink, mediaType, modifier)
{
	//if theres no error within the presume imdb url (means we do find 'imdb' or 'betaseries' inside it), we set 2 variables to let us insert the imdb link later
	if (ratingLink[2].indexOf('imdb') != -1 || ratingLink[2].indexOf('betaseries') != -1)
	{
		ratingOpenLink="<a target='_blank' href='" + ratingLink[2] + "'>";
		ratingCloseLink="</a>"
	}
	else
	{ 
		ratingOpenLink=""; 
		ratingCloseLink=""
	}
	
	if (ratingLink && ratingLink != -1)
	{
		// TEMP
		newText = element.parentNode.innerHTML + " TEST"/*ratingElement*/;
		element.parentNode.innerHTML = newText;
	}
}



/******** BetaSeries **********/
function cleanup_serie(str)
{
	/* Small function to cleanup a string, remove html tags, underscores, weird characters etc. */
	str = str.replace(/[_-]/g, ' ') // _ or - to space
		.replace(/[\(\)\."\[\]\{\}]/g, '')
		.replace(/&amp;/g, 'and') 
		.replace(/[:;\?,!]/g, ' ')
		.replace(/ +/g, ' ') // double spaces
		.replace(/ *$/, '') // remove last lonely spaces
		.replace(/^ */, '') // remove last lonely spaces
		.replace(/<\/?[^>]+(>|$)/g, ""); // HTML TAGS

	serie_details = str.match(/^(?:\s*)(.*) (?:s|saison|season) *([0-9]{1,2})[\- ,;]*(?:e|ep|ep\.|episode|episodes) *([0-9]{1,3})/i);
	//serie_details[1]:title
	//serie_details[2]:season
	//serie_details[3]:episode
	return serie_details;
}

function betaseriesGetUrl(serie_details, element)
{
	if (serie_details == null) return 0;

	var serieTitle = serie_details[1];
	var serieUrl = '';

	var xmlhttp;
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp = new XMLHttpRequest();
	}
	else
	{
		// code for IE6, IE5
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			var arrRes = eval('(' + xmlhttp.responseText + ')');
			if (arrRes.root.code=="1" && typeof arrRes.root.shows[0] != 'undefined')
			{
				// No error while fetching serie and fetched at least 1 serie
				if(typeof arrRes.root.shows[1] == 'undefined') //only one serie fetched, so we assumed that we found the good one ... can't verify it
					serieUrl=arrRes.root.shows[0].url;
				else{//fetched more than 1 serie ... but there can be only one !!
					// var show;
					// var showCount=0;
					for (show in arrRes.root.shows) {
						if (arrRes.root.shows[show].url == serieTitle.replace(' ', '') || arrRes.root.shows[show].title.toLowerCase() == serieTitle.replace(' ', '') || arrRes.root.shows[show].url == serieTitle.replace(' ', '-') || arrRes.root.shows[show].title.toLowerCase() == serieTitle.replace(' ', '-')) { //trying to find an exact match
							serieUrl=arrRes.root.shows[show].url;
							break;
						}					
					}
				}

				if (serieUrl != '')
				{
					serie_details.push(serieUrl);
					betaseriesGetInfos(serie_details, element);
				}
			}
			else
			{
				void(0);
			}
		}
	}
	xmlhttp.open("GET","http://api.betaseries.com/shows/search.json?key=7ecb330c435e&title="+serieTitle,true);
	xmlhttp.send();
}

function betaseriesGetInfos(serie_details, element){ 

	var serieTitle=serie_details[1];
	var serieSeason=serie_details[2];
	var serieEpisode=serie_details[3];
	var serieUrl=serie_details[4];
	var url='http://api.betaseries.com/shows/display/' + serieUrl + '.json?key=7ecb330c435e';

	var xmlhttpGetInfos;
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttpGetInfos = new XMLHttpRequest();
	}
	else
	{
		// code for IE6, IE5
		xmlhttpGetInfos = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttpGetInfos.onreadystatechange = function()
	{
		if (xmlhttpGetInfos.readyState==4 && xmlhttpGetInfos.status==200)
		{
			var arrRes = eval('(' + xmlhttpGetInfos.responseText + ')');
			if (arrRes.root.code=="1") { //no error while fetching episode infos
				var objInfos=arrRes.root.show;
				//*** addratingLinkToElement(element, [objInfos.title, objInfos.note.mean, 'http://www.betaseries.com/episode/' + serieUrl + '/s' + serieSeason + 'e' + serieEpisode, objInfos.note.members], 2, 2);		
			}
		}
	}
	xmlhttpGetInfos.open("GET",url,true);
	xmlhttpGetInfos.send();
}



// ************************ MAIN ****************************
var page = window.location.href;
// URL Parameters associative array
UrlParams = extractUrlParams();
var query = UrlParams["q"];
if (typeof query=='undefined') query='';
var cat_id = UrlParams["cat_id"];
var binnewz_goodCat = ['6','23','39','27','48','49','100','101','102','103','104','105','11'];
var binnewz_tvCat = ['7', '26', '44'];

if (page.match("yabsearch.nl(.*?)?req="))
{
	document.getElementById("q").value = page.split("req=")[1];
	document.getElementsByName("commit")[0].click();
}
else
{
	var olddiv;
	add_links();
	Binsearch_DeleteAd();


	// We need to know which column is for title or file or ... (this changes regarding the results' category)
	var THCol = document.getElementsByClassName('column_heading marker');
	for (i = 0; i < THCol.length; i++)
	{
		if (THCol[i].textContent == "Titre")
		{
			var titleIndex=i+1;
			continue;
		}
		else if (THCol[i].textContent == "Newsgroup")
		{
			var groupsIndex=i+1;
			continue;
		}
		else if (THCol[i].textContent == "Fichier")
		{
			var fileIndex=i+1;
			continue;
		}
		else if (THCol[i].textContent == "Taille")
		{
			var sizeIndex=i+1;	
			continue;
		}
	}

	// --- Add a link for Movies Infos ---
	
	
	if (document.getElementsByClassName('bigred').length < 5)
	{
		var search_array = document.evaluate( '//tr[@class[.="odd" or .="even" ] and not(@done)]' , document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );
	}
	else
	{
		// Last ref page
		var lfTRs = document.getElementsByClassName('odd');
		for (i = 0; i < lfTRs.length; i++)
		{
			lfTRs[i].previousElementSibling.className = 'even';
		}
		var search_array = document.evaluate( '//tr[@class[.="odd" or .="even" ] and not(@done)]' , document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );
	}

	//alert('Titre : ' + titleIndex);
	
	for (var n = 0; n < search_array.snapshotLength; ++n)
	{
		var TR=search_array.snapshotItem(n);
		var TDs=TR.children;
		var titleTD=TDs[titleIndex]; 
		var groupsTD=TDs[groupsIndex];
		var fileTD=TDs[fileIndex];
		var sizeTD=TDs[sizeIndex];

		if ((titleTD.innerHTML.indexOf('cadenas.png') != -1) || (titleTD.innerHTML.indexOf('virus.gif')!=-1))
		{
			// Password protected or virus result
			setProtectedRow(titleTD.parentNode);
		}

		var Acol = titleTD.getElementsByTagName('a');
		var elementTitle;
		var element;
		if (Acol.length > 0)
		{
			elementTitle = Acol[0].innerHTML.toLowerCase();
			element = titleTD.firstElementChild;
		}
		else
		{
			elementTitle = titleTD.textContent.toLowerCase();
			element = titleTD.firstChild;
		}
		
		var div = document.createElement("div");
		make_link_movieInfos(div,"http://NiouzeFire_Plus_MoviesInfos/"+elementTitle,"Informations sur le Film","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAWCAYAAADTlvzyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAABblJREFUSEvlVWlMVFcUfmPTpqQxKSpgokBFoIobJkIBSxnTRn9pKkGkiI228Y//ilEba5Mq1oVoq4CIWAQXFtlEkRGYlRlmmAFmYNhGGBhQkWVANkcWRb+ee0ESTZo0aX806U1O7nv3nnu+7zvnvPuE/8/wW7ly5apVq3atXbs2Zv369TEbNmyICQwMjAkKCooJCQmJ2bhxI5uDZt3/2XB3dxc8PT1zvby84OPjgxUrVsDPzw9r1qzBunXr4O/vDyLBZjXxEtE+N/IX0VnRkiVL/o7NgMmVSsHDwyOHbNzT8xMwUG9vb/j6+s4Bk3KsXs1s9RSRsNFso3Ub7dvIz0b+tmXLltmItM3d3cO2dOlSGwG8a0VSuVwkVFRqd5gbm6aNpjo0WR6grb0DHV0P8fBxN7p7evGktx+9/Xb02QfQPzAIO7PBQf7MrJfWe/rs5NeHx0960PXoMdo7u9BmbUfLg1ZQbOira1Brqn+l0eq+FZRqzTfmpmZIJBIolEoO0msfxMDQMIZHxzDqeI5nzyfwbHyCP9ufDqFvFog9j4w5MOYYx+iz5xgaGcPA02EiOEDgvegkcL3BgILCQgKsg0qt+V6Qqyq2NltaYaip5Yy4MmLLgg7S4cHhEVp7gq6Hj9Bvt8PhcGBychL9/f2wtLTAZrPB2mGDrYv2Z4l09/SR0m6ulIlRV2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oKNLbx+fX3bt3Wwj41aWUFFKRyi0hIQGnT5/hWTh+PO5VZOTOFq/ly09QLSPfnGexSD03+peKCeuDmX/UXw8R2XyRSBTo4uoaGxYmztu5M8q4d+931j179lojdkTWfh4amrtokcsP5BPAfGfP/CvjPTInkWies2jePFduIpEzW5vd+y8OQfgTyGS3DcPpJE4AAAAASUVORK5CYII=");
		div.style.display = "block";
		titleTD.appendChild(div);
		
		// *** RATING ***
		/*if (in_array(cat_id, binnewz_goodCat))
		{
			test = "FILM " + elementTitle; // ***
			// Movie rating
			elementTitle = cleanup(elementTitle);
			if (Acol.length > 0 && Acol[0].href.indexOf('imdb') != -1)
			{
				// Testing if theres already a imdb url in binnews, if so, we use this url to get rating & votes
				var yearMatch = elementTitle.match(/[0-9]{4}(?!.*[0-9]{4})/);
				var firstInd = elementTitle.indexOf("(");
				if (firstInd != -1)
				{
					elementTitle = elementTitle.substring(0, firstInd-1);	
				}
				//*** imdbRequest(Acol[0].href, element, yearMatch==null?'':yearMatch[0], 1, elementTitle.replace(/ /g, "+"));
			}
			else
			{
				// If the link is not imdb
				//*** googleRequest(elementTitle, element);
			}
		}
		else if (in_array(cat_id, binnewz_tvCat))
		{
			test = "TV " + elementTitle; // ***
			betaseriesGetUrl(cleanup_serie(elementTitle), element);
		}*/
	}
}
