use this:
Code:
function change(n, d) { //n=number of link, d=id of div
var ls=[
["/v3/index/group1/1.png", "/v3/index/group1/1.html", "/v3/black.html"], //format: image location, frame1 location, frame2 location
];
n=--n>=0&&n<ls.length?n:0;
top.iframe1.location.href = ls[n][1];
top.iframe2.location.href = ls[n][2];
clearDiv(d); //clear the div;
div=document.getElementById(d);
a=document.createElement("a");
img=document.createElement("img");
img.src=ls[n][0];
img.style.border="0";
a.href="javascript:change("+Math.floor(Math.random()*ls.length)+", '"+d+"')";
a.appendChild(img);
div.appendChild(a);
}
function clearDiv(d) {
div=document.getElementById(d);
while (div.firstChild) {
div.removeChild(div.firstChild);
}
}
</script>
where the link is javascript:change(number, div id)
and for each link add this to the js var ls:[image src, frame 1 href, frame 2, href]
Bookmarks