Hi Zenners,

I want to add 3 rotating images in my header. I am obviously not going to ask anyone if this works, I can check that myself but I want to know if my methodology is correct as I am not very familiar with jscript.

1. I make 3 images all the same size and file extension name1.gif , name2.gif, name3.gif and ftp to templates/my_template/images/

2. In a notepad file paste the code below and save as jscript_email_name.js and ftp to includes/templates/my_template/jscript/

<script type="text/javascript" language="JavaScript">
<!-- Copyright 2002 Bontrager Connection, LLC
//
NumberOfImagesToRotate = 3;

// Specify the first and last part of the image tag.

FirstPart = '<img src="name';
LastPart = '.gif" height="150" width="200">';

function printImage() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(FirstPart + r + LastPart);
}
//-->
</script>

3. To get the revolving images onto the header of all my pages I add the line below to common/tpl_header.php

<script type="text/javascript" language="JavaScript"><!--
printImage();
//--></script>

My questions are:
1.As I have named my js file “jscript_email_name.js” how will the code above call the script as there is no reference to the name or file path.
2.is /my_template/common/tpl_header.php the correct file to edit to add the revolving images to all headers in my site

Any pointers would be hugely appreciated. Thanks Zenners