var linkHolder = { 'Xbox' : ['Xbox'], 'Xbox360_Live__Tags' : ['Xbox','Live','Tags'], 'Xbox_FAQ' : ['Xbox','FAQ'], 'xf_live' : ['Xbox','Live'] } $('.bodytext:eq(3) p:not(".wcauth")').each(function(){ var currentP = $(this); for (var item in linkHolder) { for(var z=0; z -1){ if((currentP.html().indexOf(' class="'+linkHolder[item][z]+'wikiOverlay') < 0) && (currentP.html().indexOf('wikiOverlay') > -1)){ var wOnum = {}; var getwOvers = currentP.children('div[@class$=wikiOverlay]'); var this1 = $(this); wOnum['temp' + i] = this1.children('a').get(); this1.children('a').remove(); }); currentP.html(currentP.html().replace(linkHolder[item][z], '
' + item + '
' + linkHolder[item][z]+ '')); getwOvers.each(function(q){ var this2 = $(this); this2.append(wOnum['temp'+q]); }); } else if(currentP.html().indexOf(' class="'+linkHolder[item][z]+'wikiOverlay') < 0){ currentP.html(currentP.html().replace(linkHolder[item][z], '
' + item + '
' + linkHolder[item][z]+ '')); } else { currentP.children('.'+linkHolder[item][z]+'wikiOverlay').prepend(item); } } } } }); $('.wItem').mouseup( function(evt) { var ey = evt.pageY -210; var eX = evt.pageX -25; $(this).prev().toggle().css({top: ey,left: eX}); });