/**

 * Hide your affiliate links using Javascript

 * 

 * Copyright 2008 Harvey Kane <code@ragepank.com>

 * 

 * See the enclosed file license.txt for license information (LGPL). If you

 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

 *

 * @author  Harvey Kane <code@ragepank.com>

 * @license http://www.fsf.org/copyleft/lgpl.html GNU Lesser General Public License

 * @link    http://www.ragepank.com

 *

 * define your affiliate links in the following format from line 22 onwards...

 * aff['http://www.domain.com/AFFILIATE_LINK/']             = 'http://www.domain.com/REGULAR_LINK/';

 * aff['http://www.domain.com/ANOTHER_AFFILIATE_LINK/']     = 'http://www.domain.com/ANOTHER_REGULAR_LINK/';

 * aff['http://www.domain.com/YET_ANOTHER_AFFILIATE_LINK/'] = 'http://www.domain.com/YET_ANOTHER_REGULAR_LINK/';

 * 

 */



var aff = new Array();



/* define your links here */

aff['http://regcleaned.paretologic.revenuewire.net/regcure/download'] = 'http://www.registrycleanersreviewed.com/regcure-download.html';

aff['http://www.registrycleanersreviewed.com/regcuresite.php'] = 'http://www.regcure.com';

aff['http://regcleaned.paretologic.revenuewire.net/regcure/homepage'] = 'http://www.registrycleanersreviewed.com/regcure-download.html';

aff['http://regcleaned.paretologic.revenuewire.net/regcure/homepage'] = 'http://www.registrycleanersreviewed.com/regcure.html';



aff['http://jerdei.regeasy.hop.clickbank.net/?s=registryeasy.php'] = 'http://www.registrycleanersreviewed.com/registryeasy-download.html';



aff['http://jerdei.regeasy.hop.clickbank.net/?s=index.php'] = 'http://www.registrycleanersreviewed.com/registryeasy.html';

aff['http://send.onenetworkdirect.net/z/22069/CD95130/&subid1=RR&subid2=Download'] = 'http://www.registrycleanersreviewed.com/registry-Mechanic-Download.html';

aff['http://send.onenetworkdirect.net/z/9838/CD95130/&subid1=rr&subid2=review'] = 'http://www.registrycleanersreviewed.com/Registry-Mechanic-Download/';

aff['http://jerdei.regfix.hop.clickbank.net'] = 'http://www.registrycleanersreviewed.com/Registry-Fix.html';

aff['http://578e8ehkfdjr1zfz0jxpykn3-g.hop.clickbank.net/'] = 'http://www.registrycleanersreviewed.com/Error-Nuker.html';



/* do not edit below this point */



/* reverse the key/value pairs so we can lookup based on value */

var aff_reverse = new Array();

for (k in aff) {

    aff_reverse[aff[k]] = k;

}



/* scan all links when the document loads */

$(document).ready(function(){

  $('a').attr('href',function(){

    

    /* if the link isn't listed above, do nothing */

    if (!aff[$(this).attr('href')]) {return $(this).attr('href');}

    /* ok, the link is in our list */

    $(this).click(function(){

        /* when the link is clicked on, revert it back to the affiliate link */

        //$(this).attr('href', aff_reverse[$(this).attr('href')]);

        return true;

    });

    $(this).mouseup(function(){

        /* Firefox ignores onclick event when the link is opened via middle mouse (new tab) */

        $(this).attr('href', aff_reverse[$(this).attr('href')]);

        return true;

    });

    $(this).mouseout(function(){

        /* revert back to non-aff link in case they opened in new tab */

        $(this).attr('href', aff[$(this).attr('href')]);

        return true;

    });

    /* change the affiliate link to a non-affiliate link */

    return aff[$(this).attr('href')];

  });

});