﻿var _nCurrentPhoto=0;

function ViewPhoto(strURL, strImageClientID, strText, strTextClientID, nPosition)
{
  document.getElementById(strImageClientID).src=strURL;
  document.getElementById(strTextClientID).innerHTML=strText;
  
  _nCurrentPhoto=nPosition;
  
  return;
}

var oScroller=new Scroller();

function BeginScroll(nDirection)
{
  oScroller.BeginScroll(nDirection);
  
  return;
}

function EndScroll()
{
  oScroller.EndScroll();
  
  return;
}

var arrPhotoImages=new Array(0);
var arrPhotoTexts=new Array(0);

function Move(nDirection, strImageClientID, strTextClientID)
{
  _nCurrentPhoto+=nDirection;
  
  if(_nCurrentPhoto<0)
  {
    _nCurrentPhoto=0;
  }
  else if(_nCurrentPhoto>=arrPhotoImages.length)
  {
    _nCurrentPhoto=arrPhotoImages-1;
  }
  
  ViewPhoto(arrPhotoImages[_nCurrentPhoto], strImageClientID, arrPhotoTexts[_nCurrentPhoto], strTextClientID, _nCurrentPhoto);
  
  return;
}
