Cannot get alternating images to work!?

I know it's something stupid, but I can't get the following code to work in ASP.net.  Works fine if I run it in FrontPage!?

I want to alternate image files between 5 images.  I have been told not to use Flash (don't ask me why!).  Works beautifully in FrontPage testing, but does nothing in asp.net.  Any help is greatly appreciated....

Here is the code (I've left datagrids that are implemented on the same page):
<html><head><title>Javascript Rotation</title>
<script language="javascript">
var frames;
images=new Array(5);
images[0]=new Image();
images[0].src="images/5v5SoccerlogoFullcolorcopy.jpg";
images[1]=new Image();
images[1].src="images/banner-nike.gif";
images[2]=new Image();
images[2].src="images/BPM.gif";
images[3]=new Image();
images[3].src="images/flamingsoccer.jpg";
images[4]=new Image();
images[4].src="images/Header.GIF";
frames=0;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
      <HEAD>
            <title>My Title</title>
            <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
            <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
            <meta content="JavaScript" name="vs_defaultClientScript">
            <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<script language="javascript">

function animateImages()
{
   document.image_placeholder.src=images[frames].src;
   frames=(frames+1)%5;
   timeout_id=setTimeout("animateImages()",2000);
}
</script>
</head>
<body bgcolor="white" onLoad="animateImages();">
<a href="javascript:0" name="book_link">
<img src="images/5v5SoccerlogoFullcolorcopy.jpg" name="image_placeholder" border="0" width="154" height="129"></a>
</body>
</html>
aibarAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hesCommented:
Try this , I moved all the Javascript to the bottom:



<html><head><title>Javascript Rotation</title>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
     <HEAD>
          <title>My Title</title>
          <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
          <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
          <meta content="JavaScript" name="vs_defaultClientScript">
          <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">

</head>
<body bgcolor="white" onLoad="animateImages();">
<a href="javascript:0" name="book_link">
<img src="images/5v5SoccerlogoFullcolorcopy.jpg" name="image_placeholder" border="0" width="154" height="129"></a>
</body>
</html>
<script language="javascript">
var frames;
images=new Array(5);
images[0]=new Image();
images[0].src="images/5v5SoccerlogoFullcolorcopy.jpg";
images[1]=new Image();
images[1].src="images/banner-nike.gif";
images[2]=new Image();
images[2].src="images/BPM.gif";
images[3]=new Image();
images[3].src="images/flamingsoccer.jpg";
images[4]=new Image();
images[4].src="images/Header.GIF";
frames=0;

function animateImages()
{
   document.image_placeholder.src=images[frames].src;
   frames=(frames+1)%5;
   timeout_id=setTimeout("animateImages()",2000);
}
</script>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aibarAuthor Commented:
That did it!  Thanks SO much.
hesCommented:
Glad to have helped
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.