        function startanimation()

{

     for(var ix=0; !(ix>=ref_links.length); ix++) {
     //alert(ix.toString());
     if(!(ix+1 > 9))
        EnableImgButton( document.getElementById('bm' + (ix+ 1).toString()) );
     }

     set_clip(1);
}

     
        function EnableImgButton(objImg)
        {
            objImg.src="img/" + objImg.name + "_out.gif";
            objImg.className = "enabled";
            if (!bIE)
            {
                objImg.setAttribute("onmouseout","if (this.className == 'enabled') { this.src='img/" + objImg.name + "_out.gif'}");
                objImg.setAttribute("onmouseover","if (this.className == 'enabled') {this.src='img/" + objImg.name + "_over.gif'}");
                objImg.setAttribute("onmouseup","if (this.className == 'enabled') {this.src='img/" + objImg.name + "_over.gif'}");
                objImg.setAttribute("onmousedown","if (this.className == 'enabled') {this.src='img/" + objImg.name + "_down.gif'}");  
            }
            else
            {
                objImg.setAttribute("onmouseout",function() {if (this.className == 'enabled') {this.src="img/" + objImg.name + "_out.gif"}});
                objImg.setAttribute("onmouseover",function() {if (this.className == 'enabled') {this.src="img/" + objImg.name + "_over.gif"}});
                objImg.setAttribute("onmouseup",function() {if (this.className == 'enabled') {this.src="img/" + objImg.name + "_over.gif"}});
                objImg.setAttribute("onmousedown",function() {if (this.className == 'enabled') {this.src="img/" + objImg.name + "_down.gif"}});  
            }
            
        }
        
        function NextClip()
        {
            if(timercount > 0)
                timercount = timercount-1;
                
            if(!moving) return;
            //alert(current_image_ind);
            normal_current_clip_state();

            current_image_ind++;
            if(current_image_ind > ref_links.length || current_image_ind > 9)
                current_image_ind = 1;
             
            //alert(current_image_ind);
            set_selected_current_clip_state();
            
            if(moving)
            {
                setTimeout("NextClip();", SleepTimeOut[current_image_ind-1]);
                timercount = timercount+1;
            }
        }
        
        function normal_current_clip_state()
        {
            var current_clip = document.getElementById('bm' + (current_image_ind).toString());
            current_clip.src="img/" + current_clip.name + "_out.gif";
            current_clip.className = 'enabled';
        }
        
        function set_selected_current_clip_state()
        {
            var current_clip = document.getElementById('bm' + (current_image_ind).toString());
            current_clip.src="img/" + current_clip.name + "_down.gif";
            current_clip.className = 'selected';
            document.getElementById('ImgClip').src = ref_img[current_image_ind-1].toString();
            document.getElementById('clip_link').href = ref_links[current_image_ind-1].toString();
            document.getElementById('AnimationHeader').innerHTML= TitlesList[current_image_ind-1].toString();
        }
        
        function set_clip(clip_number)
        {
            normal_current_clip_state();
            current_image_ind = clip_number;
            set_selected_current_clip_state();
            if(moving)
            {
                setTimeout("NextClip();", SleepTimeOut[current_image_ind-1]);
                timercount = timercount+1;
            }
            else
                document.getElementById('bp0').src='img/4-2.gif';
        }
        
        function click_stop_play_button( obj)
        {
         if(moving){ obj.src='img/4-2.gif'; moving=false;} 
         else 
         {obj.src='img/4-1.gif'; moving=true; if(!(timercount>=1)) NextClip();  }
        }
        
