[SOLVED] Creating an array

[SOLVED] Creating an array

Hello, everyone... I'm having a problem which should be simple to solve, but I can't work around it due to my lack of experience in jQuery.

I'm using the script posted below to replace certain keywords with images. It works really well, BUT, right now I'm using individual entries of the same code over and over for each word I want replaced... anybody care to tell me how that code looks like as an array?

//FIRST WORD
$(document).ready(function() {
   $("*:contains('VALUE')", document.body)
.contents().each(function() {if( this.nodeType == 3 ) {$(this).replaceWith( this.nodeValue
   .replace( /VALUE/g, "NEW CONTENT" )
);}});});

//SECOND WORD
$(document).ready(function() {
   $("*:contains('@s')", document.body)
.contents().each(function() {if( this.nodeType == 3 ) {$(this).replaceWith( this.nodeValue
   .replace( /@s/g, "\xa0" )
);}});});
AND SO ON...

The code explained: contains('VALUE')" and .replace( /VALUE/g are the words that have to be replaced, while what follows replace is the code that should go in its place.

Thank you for the attention,