/* Enlargements */
var gallerystats = 'Image 1 of 1';
var imagecount = 3;
var imageptr = 1;  	 			/* the current enlargement array element */
var browser=navigator.appName;
var imgfile = new Array();
var imgname = new Array();
var imgdesc = new Array();
var imgcred = new Array();
var imgcnum = new Array();

imgfile[1] = '../images/bigimages/_asc0020.jpg';
imgname[1] = 'big name';
imgdesc[1] = 'big description';
imgcred[1] = 'Eve Livesey,  24/02/2007';
imgcnum[1] = '999_asc0020';

imgfile[2] = '../images/bigimages/_asc0020.jpg';
imgname[2] = 'big name';
imgdesc[2] = 'big description';
imgcred[2] = 'Eve Livesey,  24/02/2007';
imgcnum[2] = '999_asc0020';

imgfile[3] = '../images/bigimages/_asc0020.jpg';
imgname[3] = 'big name';
imgdesc[3] = 'big description';
imgcred[3] = 'Eve Livesey,  24/02/2007';
imgcnum[3] = '999_asc0020';

function load () {

  if (document.getElementById('gallerystats')) {document.getElementById('gallerystats').childNodes[0].nodeValue = gallerystats;}
	showphoto(imageptr); 
}

function steponimage (stepOn) {
  if (stepOn == true) {				 						    /* stepping down */
    if(imageptr < imagecount) {
      imageptr++;
      showphoto(imageptr);	}}
  else {							 												/* stepping up */
    if (imageptr > 1) {
      imageptr--;
      showphoto(imageptr);	}}
}

function showphoto(photonum) {

/*	wont work in Opera etc  displayphoto (photonum); 
so used  document.getElementById('photoimage').src = imgfile[photonum]; 
next for merge but try IEn*/
		if (browser=="Microsoft Internet Explorer") {
      displayphoto (photonum);}
	  else {
		  document.images.currentimg.src = imgfile[photonum]; }		
/*    showphotostats (photonum); */
    imageptr = photonum;

  if (document.getElementById('imgleft')) {
    if (imageptr > 1) {
			document.getElementById('imgleft').src = '../furniture/button_lt.gif';}
    else {
			document.getElementById('imgleft').src = '../furniture/blankbutton.jpg';}
  }
  if (document.getElementById('imgright')) {
    if (imageptr < imagecount) {
      document.getElementById('imgright').src = '../furniture/button_rt.gif';}
    else {
      document.getElementById('imgright').src = '../furniture/blankbutton.jpg';}  
	}		 
}

function displayphoto (photonum) {

      document.images.currentimg.style.filter="blendTrans(duration=1.0)"; /* CrossFadeDuration */
      document.images.currentimg.filters.blendTrans.Apply();
      document.images.currentimg.src = imgfile[imageptr];
      document.images.currentimg.filters.blendTrans.Play();
}

function showphotostats (photonum) {
/* this condition is dodgy - is it needed? */
  if (document.getElementById) {
    document.getElementById('photoimage').alt = imgname[photonum]; 
    document.getElementById('phototitle').childNodes[0].nodeValue = imgname[photonum]; 
    document.getElementById('photodesc').childNodes[0].nodeValue = imgdesc[photonum]; 
    document.getElementById('photocredit').childNodes[0].nodeValue = imgcred[photonum];
    document.getElementById('catalognum').childNodes[0].nodeValue = imgcnum[photonum]; 
	}
}


