// Manual Slide-Show script. With image cross fade effect for those browsers
// that support it.
// Script copyright (C) 2004 www.cryer.co.uk.
// Script is free to use provided this copyright header is included.
var manualPictures = new Array();
var aimages = new Array();
var imageFiles = '1.jpg;2.jpg;3.jpg;4.jpg;5.jpg;';
var path = 'images/galeria_refer/';
var number = 1;
var i=0;
while (imageFiles != '')
{
  var imageSeparator = imageFiles.indexOf(";");
  var nextImage = imageFiles.substring(0,imageSeparator);
  i++;
  aimages[i] = nextImage;
  imageFiles=imageFiles.substring(imageSeparator+1,imageFiles.length);
}
var qty = i;

function test_browser()
{
	var browser=window.navigator.userAgent;
	if (browser.toLowerCase().indexOf("opera") < 0 & browser.toLowerCase().indexOf("firefox") < 0)
	{
		return true;
	}
	else
	{
		return false;
	}
return ie;
}


function ShowPictureNumber()
{
	document.getElementById('nr').innerHTML = number + '/' + qty;
}

function NextImageSlide(pictureName)
{
  var ie = test_browser();
  number++;
  if (number > qty)
  {
	  number = 1;
  }
  var nextImage = aimages[number];
  if (ie)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = path + nextImage;
  document.getElementById('nr').innerHTML = number + '/' + qty;
  if (ie)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }
}

function PrevImageSlide(pictureName)
{
  var ie = test_browser();
  number--;
  if (number == 0)
  {
	  number = qty;
  }
  var nextImage = aimages[number];
  if (ie)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = path + nextImage;
  document.getElementById('nr').innerHTML = number + '/' + qty;
  if (ie)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }
}
