    // This script is copywrited and is the soleproperty of Your Store Wizards, www.yourstorewizards.com
    // It may not be used, copied, sold or reproduced in any form without the express written consent of Your Store Wizards, www.yourstorewizards.com

var startHomeItem = 0;
var randHomeNumbers=new Array();
var randHomeShow = 0;
var randHomeSeconds = 0;
var randHomeMove = 0;
var randHomeCount = 0;
var randhloop = 0;

function randOrd(a, b)
  { return (Math.round(Math.random())-0.5); } 

function randHomeSetup()
{

  for (randhloop=0; randhloop<randHomeCount; randhloop++)
  {
     randHomeNumbers[randhloop]=randhloop;
  }

  randHomeNumbers.sort( randOrd );

  for (randhloop=0; randhloop<randHomeShow; randhloop++)
  {
     if (document.getElementById('ysw-random-home-'+randhloop)) {
     document.getElementById('ysw-random-home-'+randhloop).innerHTML = randHomeItems[randHomeNumbers[randhloop]];
     }
     if (document.getElementById('ysw-random-home-2-'+randhloop)) {
     document.getElementById('ysw-random-home-2-'+randhloop).innerHTML = randHomeItems2[randHomeNumbers[randhloop]];
     }
  }  
  if (randHomeSeconds > 0) 
  {
     setTimeout("randHomeNext(randHomeMove,1)",randHomeSeconds * 1000);
  }
}

function randHomeNext(numberToMove, autoMove)
{
  startHomeItem = startHomeItem + numberToMove; 
  for (randhloop=0; randhloop<randHomeShow; randhloop++)
  {
     if ((startHomeItem+randhloop) >= randHomeCount)
     {
        startHomeItem = startHomeItem - randHomeCount;
     }
     if ((startHomeItem+randhloop) < 0)
     {
        startHomeItem = startHomeItem + randHomeCount;
     }

     if (document.getElementById('ysw-random-home-'+randhloop)) {
     document.getElementById('ysw-random-home-'+randhloop).innerHTML = randHomeItems[randHomeNumbers[startHomeItem+randhloop]];
     }
     if (document.getElementById('ysw-random-home-2-'+randhloop)) {
     document.getElementById('ysw-random-home-2-'+randhloop).innerHTML = randHomeItems2[randHomeNumbers[startHomeItem+randhloop]];
     }
  }  
  if (autoMove == 1 && randHomeSeconds > 0) {
     setTimeout("randHomeNext(randHomeMove,1)",randHomeSeconds * 1000);
  }
  else {
    setTimeout("",0);
  }
}

function randHomePrev(numberToMove)
{
  startHomeItem = startHomeItem - numberToMove; 
  for (randhloop=0; randhloop<randHomeShow; randhloop++)
  {
     if ((startHomeItem+randhloop) >= randHomeCount)
     {
        startHomeItem = startHomeItem - randHomeCount;
     }
     if ((startHomeItem+randhloop) < 0)
     {
        startHomeItem = startHomeItem + randHomeCount;
     }

     if (document.getElementById('ysw-random-home-'+randhloop)) {
     document.getElementById('ysw-random-home-home-'+randhloop).innerHTML = randHomeItems[randHomeNumbers[startHomeItem+randhloop]];
     }
     if (document.getElementById('ysw-random-2-'+randhloop)) {
     document.getElementById('ysw-random-home-2-'+randhloop).innerHTML = randHomeItems2[randHomeNumbers[startHomeItem+randhloop]];
     }
  }  
}
