  var images=new Array();
  var numImgs=6;
var interval=4000;
var position="";
var secondImage=true;
var counter=5;
var index=0;


function addAnnouncement(){
if ((screen.width>=1280) && (screen.height>=768))
{
 
 var obj=document.getElementById('announcetext');
obj.style.width="175px"
obj.style.fontSize="15px"
 obj.style.visibility="visible";
 
}
else
{
   
    var loresobj=document.getElementById("announcetext");
    loresobj.style.width = "120px";
    loresobj.style.fontSize = "10pt";
    loresobj.style.visibility="visible";
}
}

function sequentialImages(pPosition)
{
     position=pPosition;
     
    images[1] = "<img src='images/dancer_holdfoot.JPG'  alt='Mattie in full lord of dance, inside, holding foot with both hands.' width='160' height='240' />";
    images[0] = "<img src='images/assist.JPG'  alt='Mattie assisting student in extended side angle.' width='160' height='240' />";  
    images[2]="<img src='images/wheeloutside.gif'  alt='Mattie in wheel with one leg raised outside.' width='160' height='240' />";
    images[3]="<img src='images/superbridge.JPG'  alt='Mattie in bridge pose, inside, on elbows and knees.' width='160' height='240' />";
    images[4]="<img src='images/dancer_hookedfoot.JPG'  alt='Mattie in dancer, outside, foot hooked in elbow.' width='160' height='240' />";
  
     setInterval("swapImage()",interval);
    
}

function randomImages(pPosition)
{
     position=pPosition;
    images[2] = "<img src='images/dancer_holdfoot.JPG'  alt='Mattie in full lord of dance, inside, holding foot with both hands.' width='160' height='240' />";
    images[1] = "<img src='images/assist.JPG'  alt='Mattie assisting student in extended side angle.' width='160' height='240' />";
    images[3]="<img src='images/upwarddog.JPG'  alt='Mattie in upward facing dog, outside, with a big smile.' width='160' height='240' />";
    images[4]="<img src='images/wheeloutside.gif'  alt='Mattie in wheel with one leg raised outside.' width='160' height='240' />";
    images[5]="<img src='images/superbridge.JPG'  alt='Mattie in bridge pose, inside, on elbows and knees.' width='160' height='240' />";
    images[0]="<img src='images/dancer_hookedfoot.JPG'  alt='Mattie in dancer, outside, foot hooked in elbow.' width='160' height='240' />";
    
    setInterval("swapImage()",interval);
    
    
}
function swapImage(index)
{
   var location=document.getElementById(position);
   

       //now random image
       //var index=Math.floor(Math.random()*numImgs + 1);
      index=counter%5;
     
      location.innerHTML=images[index];
      ++counter;
    
}

function replaceImage(){
    
  
    var location=document.getElementById(position);
    location.innerHTML=images[1]; //load assist image
    
}

