// Define constants
		      
IE4 = 1
NN3 = 2
NN4 = 3
OTHER_BROWSER = 0
		      
// Check browser
		      
browseFlag = OTHER_BROWSER
browserName = navigator.appName; 
browserVersion = parseInt(navigator.appVersion);
		     
if ((browserName == "Microsoft Internet Explorer") && (browserVersion >= 4))
{
	browseFlag = IE4
}
else
{
	if ((browserName == "Netscape") && (browserVersion >= 3) && (browserVersion < 4))
	{
		browseFlag = NN3
	}
	else
	{
		if ((browserName == "Netscape") && (browserVersion >= 4))
		{
			browseFlag = NN4
		}
	}
}

function LoadGallery(pictureName,imageFile,titleCaption,captionText, maxnum, direction)
{
  var imgnum;
  var tmpnum;
  imgnum = document.getElementById(pictureName).src.substring(document.getElementById(pictureName).src.lastIndexOf("/")+1)
  imgnum = imgnum.replace(".jpg", "");
  imgnum = parseInt(imgnum);

  if(imgnum==1 && direction=='-'){
	tmpnum=maxnum;
  }
  if(imgnum==1 && direction=='+'){
	tmpnum = parseInt(imgnum) + 1;
  }
  if(imgnum==maxnum && direction=='+'){
	tmpnum=1;
  }
  if(imgnum==maxnum && direction=='-'){
	tmpnum=parseInt(imgnum) - 1;
  }

  if(imgnum!=1 && imgnum!=maxnum){
	if(direction=='+'){
		tmpnum = parseInt(imgnum) + 1;
	}else{
		tmpnum = parseInt(imgnum) - 1;
	}
  }
  imgnum = tmpnum;
  if (document.all)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=1)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = imageFile + imgnum + '.jpg';
  if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }
}

function LoadImage(pictureName,imageFile,titleCaption,captionText)
{
  if (document.all)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=1)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = imageFile;
  if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }
}
