// NO ADDS example user script
// version 0.1 BETA!
// Copyright (c) 2008, KARLOS
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "Hello World", and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name          Say NO to ADDS
// @namespace     http://www.karlosp.net/
// @description   Predogled 24kur.com videov brez reklam :-)
// @include       http://24ur.com/*
// @include       http://www.24ur.com/*
// ==/UserScript==

window.setTimeout(function() { 
var all = document.all ? document.all :
document.getElementsByTagName('div');
var elements = new Array();
  for (var e = 0; e < all.length; e++)
    if (all[e].className == 'embed_field'){
		var video = document.getElementById("flvvideo");
		var classEmb = all[e].innerHTML;
		classEmb = classEmb.substring(13);
		
		var start = classEmb.indexOf('object');
		var stop = classEmb.indexOf('object', start+1);
		//alert(start + " " + stop);
		
		classEmb = classEmb.substring(start-4, stop+9);
		
		classEmb = classEmb.replace(/&lt;/g, "<");
		classEmb = classEmb.replace(/&gt;/g, ">");
		classEmb = classEmb.replace(/&quot;/g, "\"");
		
		//alert(classEmb);	
		var logo = document.createElement("div");
		logo.className = "embed_field";
		logo.innerHTML = classEmb;
		video.parentNode.replaceChild(logo, video);

		//video.innerHTML = classEmb;
      return 0;
	  //return elements = all[e];
	 }
	 
}, 1);
