// Link to "Introduce a friend"

var introduceFriend= document.getElementById( "rushpoppers");
if( introduceFriend) {
  introduceFriend.onclick=     function() { document.location='http://www.powerpoppers.com/poppers_5.shtml'; }
  introduceFriend.onmouseover= function() { window.status='http://www.powerpoppers.com/poppers_5.shtml'; }
  introduceFriend.onmouseout=  function() { window.status=''; }
}


// Only run this if we're not on the "links.shtml" page
if( window.document.URL.indexOf('links.shtml') < 0) {

  var currentTag= new Object;
  
  // For all sub-elements of <DIV id="dContent">
  var divBlock= document.getElementById('dContent')
  
  for( var i=0; i<divBlock.childNodes.length; i++) {
  
    currentTag= divBlock.childNodes[i];
  
	if( currentTag.tagName == 'P' ) {
      if( currentTag.className == 'banner') {
      
	    // Found <P class="banner">   
        var pHTML= currentTag.innerHTML;
        
        pHTML= pHTML.replace( /(.*)(<img.*?img\/gay_poppers\.jpg.*?>)(.*)/i, "$1<a href=\"http://www.gayperu.com/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/sex_poppers\.jpg.*?>)(.*)/i, "$1<a href=\"http://www.vinylsearcher.com/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/outrageous_poppers\.jpg.*?>)(.*)/i, "$1<a href=\"http://www.protectlivemusic.org/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/amyl_nitrate\.jpg.*?>)(.*)/i, "$1<a href=\"http://www.stompersboots.com/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/gay_aroma_poppers\.jpg.*?>)(.*)/i, "$1<a href=\"http://www.clubcockring.com/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/liquid_aroma\.gif.*?>)(.*)/i, "$1<a href=\"http://www.thedrugdatabase.com/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/poppers_heaven\.jpg.*?>)(.*)/i, "$1<a href=\"http://www.heaven-london.com/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/gay_poppers_1\.jpg.*?>)(.*)/i, "$1<a href=\"http://www.euboys.net/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/gay_poppers_2\.jpg.*?>)(.*)/i, "$1<a href=\"http://www.praguegays.net/\" target=\"_blank\">$2<\/a>$3" );
        
        currentTag.innerHTML= pHTML;
      }
	}
  }

  // For all sub-elements of <DIV id="dLeft">
  var divBlock= document.getElementById('dLeft')
  
  for( var i=0; i<divBlock.childNodes.length; i++) {
  
    currentTag= divBlock.childNodes[i];
  
	if( currentTag.tagName == 'P' ) {
      if( currentTag.className == 'banner') {
      
	    // Found <P class="banner">   
        var pHTML= currentTag.innerHTML;
        
        pHTML= pHTML.replace( /(.*)(<img.*?img\/gayscape_poppers\.gif.*?>)(.*)/i, "$1<a href=\"http://www.gayscape.com/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/protectlivemusic\.gif.*?>)(.*)/i, "$1<a href=\"http://www.protectlivemusic.org/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/drugpeace\.gif.*?>)(.*)/i, "$1<a href=\"http://www.drugpeace.org/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/vinyl_poppers\.gif.*?>)(.*)/i, "$1<a href=\"http://www.vinylsearcher.com/\" target=\"_blank\">$2<\/a>$3" );
        pHTML= pHTML.replace( /(.*)(<img.*?img\/gay_zoo_poppers\.gif.*?>)(.*)/i, "$1<a href=\"http://www.gayzoo.com/\" target=\"_blank\">$2<\/a>$3" );
        
        currentTag.innerHTML= pHTML;
      }
    }
  }
}

// Link to Jake's site

var jakesBanner= document.getElementById( "poppers");
if( jakesBanner) {
  jakesBanner.onclick=     function() { document.location='http://www.rush-poppers.org/'; }
  jakesBanner.onmouseover= function() { window.status='http://www.rush-poppers.org/'; }
  jakesBanner.onmouseout=  function() { window.status=''; }
}

// Link to Jungle Monster's site

var jungleBanner= document.getElementById( "juice");
if( jungleBanner) {
  jungleBanner.onclick=     function() { document.location='http://www.justjunglejuice.org/'; }
  jungleBanner.onmouseover= function() { window.status='http://www.justjunglejuice.org/'; }
  jungleBanner.onmouseout=  function() { window.status=''; }
}

