34 lines
951 B
PHP
34 lines
951 B
PHP
<script language="JavaScript">
|
|
var d = new Array(<!--#echo var="anim_num" -->);
|
|
var link = new Array(<!--#echo var="anim_num" -->);
|
|
link[1]="http://www.mambastore.it";
|
|
link[2]="http://www.mambasoft.it";
|
|
|
|
if (document.images) { // Preloaded images
|
|
for (var i=1; i<=<!--#echo var="anim_num" -->; i++) {
|
|
d[i] = new Image();
|
|
d[i].src = "<!--#echo var=anim_path -->"+i+".jpg";
|
|
}
|
|
}
|
|
|
|
function timeimgs(numb) { // Reusable timer
|
|
thetimer = setTimeout("imgturn('" +numb+ "')", 7000);
|
|
}
|
|
|
|
function imgturn(numb) { // Reusable image turner
|
|
if (document.images) {
|
|
document["anim_img"].src = d[numb].src;
|
|
// alert(document["anim_img"].src);
|
|
var animlink = document.getElementById('anim_link');
|
|
if ( ! animlink) {
|
|
document.links["anim_link"].href = link[numb];
|
|
} else {
|
|
animlink.href = link[numb];
|
|
}
|
|
if (numb == <!--#echo var="anim_num" -->) { numb = 0; }
|
|
timeimgs(numb = ++numb);
|
|
}
|
|
}
|
|
timeimgs(1);
|
|
</script>
|