Javascript Window Closer
Hi,
I have a javascript that rotates several banner images on my webpage and each image click through to a different webpage. The script is shown below:
<script language="JavaScript" type="text/JavaScript">
<!--
var urlArray = new Array(5);
var banArray = new Array(5);
var counter = 1;
var url = "webpage0.htm"; //initial URL
//add your necessary URL's
urlArray[0] = "webpage0.htm";
urlArray[1] = "webpage1.htm";
urlArray[2] = "webpage2.htm";
urlArray[3] = "webpage3.htm";
urlArray[4] = "webpage4.htm";
if(document.images)
{
for(i = 0; i < 5; i++)
{
banArray[i] = new Image(183, 92);
banArray[i].src = "banners/" + (i+1) + ".gif";
}
}
function changeBanner()
{
if(counter > 4)
counter = 0;
document.banner.src = banArray[counter].src;
url = urlArray[counter];
counter++;
}
var timer = window.setInterval("changeBanner()", 5000);
//-->
</script>
When one of the images is clicked, the new page opens in a new window. If this new window is then minimised and a different image banner from the original page is clicked, it opens the next new page in the minimised window. I would like the minimised window with the new page in it to maximise (or appear on top as the main window) when a new image is clicked!? Any help would be much apreciated!
regards
Peter
|