// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
// Adapted from the URL Replacer script by Ajit Burad
// http://www.cse.iitb.ac.in/~ajitb
// http://burad.blogspot.com
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.  To install it, you need
// Greasemonkey 0.3 or later: 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.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name           GTZ Clownpenisfarter
// @namespace      http://pumpfirst.com/gtz-clownpenisfarter/
// @description    Replaces all instances of Clownpenis.fart with Clownpenisfart.net on GTZ
// @include        http://*gametz.com/*
// ==/UserScript==
var url1,url2;
url1 = ['clownpenis.fart'];
url2 = ['clownpenisfart.net']; 
var a, links;
var tmp="a";
var p,q;
links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
    a = links[i];
    for(var j=0;j<url1.length; j++)
	{
	tmp = a.href+"" ;
	if(tmp.indexOf(url1[j]) != -1)
	{
	p=tmp.indexOf(url1[j]) ;
	q="http://";
	q = q + url2[j] + tmp.substring(p+url1[j].length,tmp.length);
	a.href=q ;
	}
	}
    }
