In need of a little help

I have made a little script which purpose is to check for a part of a string inside a url and do substitute that string/url.

But i get a unexspected object error
What am i doing wrong?



jQuery(document).ready(function($) {

$('#menu a').language();

}); 

(function($) {

$.fn.language = function() {
 $(this).each(function() {
	 if(this.attr("href").indexOf('about') > 1) {
		 this.attr("href","http://www.somelink.com");
	 }
});

}

})(jQuery);


I ended doing something like this. It works but im not sure its the right way to do it.



(function($) {

$.fn.language = function() {
	
var list = Array('anchortext 1','anchortext 2','anchortext 3','anchortext 4');
var url  = Array('link 1','link 2','link 3','link 4');

$(this).each(function(i,string) {
  if( $(this).text() == list[i] ) { 
    $(this).attr("href",url[i]); 
  }
});

}

})(jQuery);