In my footer I have a table with 2 cells in it. The left cell has a simple image in it. In the right cell I want to have random images show whenever a new page loads, refreshing, etc. (advertisements). Here is my code for that:
Code: Select all
<__script__ language="JavaScript">
<!--
function random_imglink(){
var myimages=new Array()
//specify random images below.
myimages[1]="http://www.ises-msp.org/newsite2/uploads/images/ads/coppersmith.jpg"
myimages[2]="http://www.ises-msp.org/newsite2/uploads/images/ads/ises.jpg"
myimages[3]="http://www.ises-msp.org/newsite2/uploads/images/ads/meetingPages.jpg"
//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="http://www.wsabstract.com"
imagelinks[2]="http://www.dynamicdrive.com"
imagelinks[3]="http://www.java-scripts.net"
var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
}
random_imglink()
//-->
</__script>
My problem is where (and how) to put this code. I've tried putting it in the HTML dialog box for the footer page (in it's respective table cell) but it doesn't work. It keeps turning the code into a single line which, shouldn't matter, but I'm not sure. I've also tried with and without the {literal} {/literal} tags to no avail. I've read in previous forums that it may go in the footer template but if that's true how would I tell it to show in the assigned cell I need it to be in? I'm very confused of all this.