// ==UserScript==
// @name		titlovi no ads
// @namespace		http://www.rulac.net/userjs/titlovi-no-ads/
// @description		remove ads
// @version		2.6
// @include		http://divx-titlovi.com/*
// @include		http://*.divx-titlovi.com/*
// @include		http://titlovi.com/*
// @include		http://*.titlovi.com/*
// ==/UserScript==

document.addEventListener("DOMContentLoaded", function(){
	el	= document.getElementsByTagName("*");
	for (i = 0; i < el.length; i++){
		if (el[i].getAttribute("class") == "gads" || el[i].getAttribute("class") && el[i].getAttribute("class").indexOf("banner") > -1){	
			//el[i].setAttribute("style", "display:none;");
			el[i].innerHTML	= "";
		}
	}
	if (ad1 = document.getElementById("google_ads_div_Titlovi")){
		ad1.setAttribute("style", "display:none");
	}
	if (ad2 = document.getElementById("google_ads_div_Divx-Titlovi_468_60_Middle_Ad_Slot")){
		ad2.setAttribute("style", "display:none");
	}
	if (ad3 = document.getElementById("anketa")){
		ad3.setAttribute("style", "display:none");
	}
	if (ad4 = document.getElementById("adds")){
		ad4.setAttribute("style", "display:none");
	}
	if (ad5 = document.getElementById("ads2")){
		ad5.setAttribute("style", "display:none");
	}
	if (ad6 = document.getElementById("gohome_ads")){
		ad6.setAttribute("style", "display:none");
	}
	if (ad7 = document.getElementById("leftAds")){
		ad7.setAttribute("style", "display:none");
	}
	if (ad8 = document.getElementById("topl.inside")){
		ad8.setAttribute("style", "display:none");
	}
	if (ad9 = document.getElementById("wallpaper_bkg_ad")){
		ad9.setAttribute("class", "");
	}
	if (ad10 = document.getElementById("wallpaper_bkg_flash_ad")){
		ad10.setAttribute("style", "display:none");
	}
	removeWho("topl.inside");
	function removeWho(who) {
		if (typeof who== 'string') who=document.getElementById(who);
		if (who && who.parentNode) who.parentNode.removeChild(who);
	}
	scripts	= document.getElementsByTagName("script");
	for (i = 0; i < scripts.length; i++){
		script_inner	= scripts[i].innerHTML;
		check1		= script_inner.lastIndexOf("GA_googleFillSlot");
		if (check1 > -1){
			//divs[i].setAttribute("style", "display:none;");
			scripts[i].innerHTML	= "";
		}
	}
	scripts	= document.getElementsByTagName("script");
	for (i = 0; i < scripts.length; i++){
		if (typeof scripts[i].src != "undefined" && scripts[i].src != ""){
			check1		= scripts[i].src.lastIndexOf("ScriptResource.axd");
			check2		= scripts[i].src.lastIndexOf("doubleclick.net");
			check3		= scripts[i].src.lastIndexOf("httpool.com");
			if (check1 > -1 || check2 > -1 || check3 > -1){
				removeWho(scripts[i]);
			}
		}
	}
	links	= document.getElementsByTagName("a");
	for (i = 0; i < links.length; i++){
		if (links[i].href.lastIndexOf("httpool") > -1){
			removeWho(links[i]);
		}
	}
}, false);
