// Browser 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 slideCache = new Array();
function RunSlideShow(pictureName,imageFiles,displaySecs)
{
  var imageSeparator = imageFiles.indexOf(";");
  var nextImage = imageFiles.substring(0,imageSeparator);
  if (document.all)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = nextImage;
  if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }
  var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)
    + ';' + nextImage;
  setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")",
    displaySecs*1000);
  // Cache the next image to improve performance.
  imageSeparator = futureImages.indexOf(";");
  nextImage = futureImages.substring(0,imageSeparator);
  if (slideCache[nextImage] == null) {
    slideCache[nextImage] = new Image;
    slideCache[nextImage].src = nextImage;
  }
}

// Copyright 2001 by www.CodeBelly.com
// Please do *not* remove this notice.

var backImage = new Array(); // don't change this

// Enter the image filenames you wish to use.
// Follow the pattern to use more images.  The
// number in the brackets [] is the number you
// will use in the function call to pick each
// image.

// Note how backImage[3] = "" -- which would
// set the page to *no* background image.

backImage[0] = "images/orangebg.jpg";
backImage[1] = "images/cloud.jpg";
backImage[2] = "images/cloud2.jpg";
backImage[3] = "images/yellowbg.jpg";
backImage[4] = "images/yellowbg2.jpg";
backImage[5] = "images/redbg.jpg";
backImage[6] = "images/bluebg.jpg";
backImage[7] = "images/bluebg2.jpg";

// Do not edit below this line.
//-----------------------------

function changeBGImage(whichImage){
if (document.body){
document.body.background = backImage[whichImage];
}
}

//-----------------------------
// photo gallery
//-----------------------------

cur=0;
max=0;
par=2;
ss=String.fromCharCode(13);
// delete this
tempor = 0;
function loading(page)
{
	str=window.imagesList.document.body.innerHTML;
	str=str.substring(str.indexOf("***Start***")+12, str.indexOf("***End***")); 
	str=str.replace(/\r/g,""); str=str.replace(/\n/g,"");
	dan=str.split(":;"); 	
	max=dan.length/par-1;
	picturecount = max + 0.5;
	pagename=page+"/";
	show();
}
function show()
{
	str="<img src=images/gallery/"+pagename+dan[cur*par+0]+">"; 
	document.getElementById("images").innerHTML=str; 
        tempor = cur + 1;
	descri=tempor + " of " + picturecount + ": " + dan[cur*par+1] + "<br>";
	document.getElementById("descrip").innerHTML=descri; 
	
//alert("Showing tempor and descri: " + tempor + " of 112  \r" + descri);
	// alert("str = "+str);
	// str="<p>"+dan[cur*par+1]+"<p>"+dan[cur*par+2];
	// document.getElementById("desc").innerHTML=str; 
}
function next()
{
	if (cur<(max-1)) {cur=cur+1;show();}
	else {alert("This is the last photo in the gallery.  ");}
	;
}
function prev()
{
	if (cur>0) {cur=cur-1;show();}
	else {alert("This is the first photo in the gallery.  ");}
	;
}
