var IG001_strThisImageFile = '';
var IG001_strImageName = '';
var IG001_strNextImageHtm = '';
var IG001_strDuration = '5';

LCLib_addOnLoadAction('IG001_ImagePageOnLoad();', 5000);
LCLib_addOnUnloadAction('IG001_ImagePageOnUnload();', 5000);

function IG001_ImagePageOnLoad()
{
    if(typeof(parent) == 'undefined' || typeof(parent.bIsFrame) == 'undefined' || parent.bIsFrame != true)
    {
        var iPos = IG001_strImageName.indexOf('.jpg');
        if(iPos > -1)
        {
            IG001_strThisImageFile = IG001_strImageName.substr(0, iPos) + '.htm';

            IG001_strThisImageFile = '_lccms_/_' + IG001_GetItemNumber(self.location.href) + '/' + IG001_strThisImageFile;
        }

        self.location.href = '../types/imagegallery/ig001/imageframe.htm?imagefile=' + IG001_strThisImageFile;
    }

    if(IG001_strNextImageHtm.length == 0)
        {
            IG001_strNextImageHtm = 'image0000.htm';
        }

    if(IG001_strNextImageHtm.length > 0)
    {
        IG001_strNextImageHtm = '_lccms_/_' + IG001_GetItemNumber(self.location.href) + '/' + IG001_strNextImageHtm;
    }

  if(typeof(parent) != 'undefined' && typeof(parent.onImagePageLoaded) != 'undefined')
  {

      if(IG001_strDuration.length == 0 || IG001_strDuration == '<#' + 'slideshow_duration' + '#>')
      {
          IG001_strDuration = '5';
      }

      parent.iSlideshowDuration = (Number(IG001_strDuration) * 1000);
      parent.onImagePageLoaded(IG001_strNextImageHtm);
  }
}

function IG001_ImagePageOnUnload()
{
  if(typeof(parent) != 'undefined' && typeof(parent.onImagePageUnloaded) != 'undefined')
  {
      parent.onImagePageUnloaded();
  }
}

function IG001_stopSlideshow()
{
    parent.stopSlideshow();
    document.getElementById('slideshowplay').style.display = 'block';
    document.getElementById('slideshowstop').style.display = 'none';
}

function IG001_ShowBig(strImgName)
{
    var strUrl = '../types/imagegallery/ig001/bigimage.htm?imgUri=';
    var strImgUri = '';
    var strItemNumber = IG001_GetItemNumber(self.location.href);
    if(strItemNumber.length > 0)
    {
        strImgUri = '_lccms_/_' + strItemNumber + '/';
    }

    strImgUri += 'images/' + strImgName;
    strUrl += strImgUri;
    window.open(strUrl, '', 'dependent=yes,height=400,hotkeys=yes,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=400');
}