how to use the below javascript as common, instead of writing in each div tag?
<p>JavaScript goes here.. and i have many sections of div tag.. i want to make this script common for all divs that i am using.. where as only the url's have to change reference with the corresponding div.. plz help..??</p>

<pre><code>&lt;script type="text/javascript"&gt;

var feedcontainer1=document.getElementById("feeddiv1")
var rssoutput1="&lt;b&gt;TOI&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;"

function rssfeedsetup1(){
google.load("feeds", "1")
var feedpointer1=new google.feeds.Feed("http://handheld.softpedia.com/backend-software.xml") //Google Feed API method
feedpointer1.setNumEntries(10) //Google Feed API method
feedpointer1.load(displayfeed1) //Google Feed API method
}

function displayfeed1(result){
if (!result.error){
var thefeeds1=result.feed.entries
for (var i=0; i&lt;thefeeds1.length; i++)
rssoutput1+="&lt;li&gt;&lt;a href='" + thefeeds1[i].link + "'&gt;" + thefeeds1[i].title + " »" + "&lt;/a&gt;&lt;/li&gt;"
rssoutput1+="&lt;/ul&gt;"
feedcontainer1.innerHTML=rssoutput1
}
else
alert("Error fetching feeds!")
}
&lt;/script&gt;
</code></pre>
