// Create a bunch of off-screen images, and get them started 
// loading the images we're going to animate.

var delay_time;
var FILMLENGTH = 10;

var images = new Array(FILMLENGTH);
var path="http://www.monicasex.co.il/site-images/tv/";

var frame = 0;         
// Keep track of what frame of the animation we're on.
var timeout_id = null; 
// This allows us to stop the animation.


for(var i = 0; i < FILMLENGTH; i++) {
  images[i] = new Image();                      
  var ext = ".gif";
  //Create an Image object
 
  if (i != 0)
   ext = ".jpg"; 

  images[i].src = path + "frame" + i + ext; // tell it what URL to load
}


function rotate()  
{
  document.getElementById('tv').src = images[frame].src;

 if (frame == 0) //show logo more time
 delay_time = 1500;
else
 delay_time = 1500;

  frame = (frame + 1) % FILMLENGTH; 
  timeout_id = setTimeout("rotate()", delay_time); // display next frame later
}