I would like to embed a script quiz in the sidebar of my site, it is 3 quiz in fact and I did not want to put one below the other, I would like them to switch between them automatically every time the page loads, occupying the same block.
It is a script with variation as below:
<script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/9527749.js"></script><noscript><ahref="http://polldaddy.com/poll/9527749/">O que faz você fugir da dieta?</a></noscript>
I would like a type script that I use to vary the images that varies every time the page loads. When clicking it takes you to the destination site, this option would not be necessary.
'<script>// <![CDATA[
var max = 3;
var nrImages = 3;
function makeImages() {
this[0] = "imagem1.jpg";
this[1] = "imagem2.jpg";
this[2] = "imagem3.jpg";
this.length = nrImages;
}
function makeLinks() {
this[0] = "Link pro site";
this[1] = "Link pro site";
this[2] = "Link pro site";
this.length = nrImages;
}
var vetImages = new makeImages();
var vetLinks = new makeLinks();
var x = Math.round(Math.random()*max);
var y = max / nrImages;
for(var cont = 1;cont*y<= max;cont++) {
if (x <= (cont*y)) {
document.write("<a href="+vetLinks[cont-1]+" rel=nofollow target=_blank><img src="+vetImages[cont-1]+" border='0'/></a>");
break;
}
}
// ]]></script>'