﻿var _isfirst = true ; 
var _runauto = true ; 
setTimeout('autostart()', 5000);

function isfirst()
 {
        
    if(_isfirst)
      {
            _isfirst= false ;
            return true;
      }
     else
     {
      _isfirst= true ;
      return false;
            
     }

 }   
 
 	 
function autostart()
 {
   if(_runauto)
   {
   
       document.getElementById("nextbtn").click();
       document.getElementById("cube"+CurrIndex).src=BaseRes+ "images/empty_cube.jpg";
  
       if (CurrIndex == 1) 
         CurrIndex=TotalDiv;
      else
        CurrIndex--;
 
        document.getElementById("cube"+CurrIndex).src=fullCubeImg;
        setTimeout('autostart()', 5000);
  }
 }   	
    	  
 

function replaceBigDiv(_index)
{
   try{
             _runauto= false;
            document.getElementById("cube"+CurrIndex).src=BaseRes+ "images/empty_cube.jpg";
            document.getElementById("cube"+_index).src=fullCubeImg;
            CurrIndex = _index;
             
     }catch(e){} 
    
}
        
  
 function StopPlayer()
{
    _runauto= false;
   
} 

function MoveNext()
{
_runauto= false;
  document.getElementById("cube"+CurrIndex).src=BaseRes+ "images/empty_cube.jpg";
  
  if (CurrIndex == 1) 
         CurrIndex=TotalDiv;
  else
        CurrIndex--;
 
  document.getElementById("cube"+CurrIndex).src=fullCubeImg;
 
   
 
}
function MovePrev()
{
 _runauto= false;
    document.getElementById("cube"+CurrIndex).src=BaseRes+"images/empty_cube.jpg";
  if (CurrIndex == TotalDiv) 
     CurrIndex=1;
  else
     CurrIndex++;
     
   document.getElementById("cube"+CurrIndex).src=fullCubeImg;
}
