//************ Album Photo ****************//
var alb_pho_currPos = 1;
function alb_pho_moveback(albumID) {
  var obj = albumID.parentNode;
  while (obj.tagName.toUpperCase() != "TABLE") {
    obj = obj.parentNode;
  }
  if (arrAlbum[obj.id]) {
	if (arrAlbum[obj.id][alb_pho_currPos - 1]) {
	  --alb_pho_currPos;
	} else {
	  var cpt = 0;
	  for (var key in arrAlbum[obj.id]) {
		cpt = cpt + 1;
	  }
	  alb_pho_currPos = cpt;
	}
	alb_pho_displayImg(obj.id, alb_pho_currPos, 1);
  }
  return false;
}

function alb_pho_movenext(albumID) {
  var obj = albumID.parentNode;
  while (obj.tagName.toUpperCase() != "TABLE") {
    obj = obj.parentNode;
  }
  if (arrAlbum[obj.id]) {
	if (arrAlbum[obj.id][alb_pho_currPos + 1]) {
	  ++alb_pho_currPos;
	} else {
	  alb_pho_currPos = 1;
	}
	alb_pho_displayImg(obj.id, alb_pho_currPos, 1);
  }
  return false;
}

function alb_pho_displayImg(albumID, position, albDisp) {
  if (parseInt(albDisp) == 0) {
    albumID = "album_" + albumID;
  }
  if (arrAlbum[albumID][position]) {
	var newArr = arrAlbum[albumID][position].split("¥");
	alb_pho_currPos = position;
	document.getElementById("imgCour" + albumID.replace(/album_/,'')).src = newArr[0]; //show new image
	document.getElementById("alb_linkedimg_" + albumID.replace(/album_/,'')).href = newArr[0]; //new image link
	document.getElementById("alb_titre" + albumID.replace(/album_/,'')).innerHTML = newArr[1] + "&nbsp;"; //change title
	document.getElementById("alb_descrip_" + albumID.replace(/album_/,'')).innerHTML = newArr[2]; //change description
	document.getElementById("imgCour" + albumID.replace(/album_/,'')).setAttribute("alt", newArr[3].replace("&#39;","'"));
	document.getElementById("imgCour" + albumID.replace(/album_/,'')).setAttribute("title", newArr[3].replace("&#39;","'"));
  }
  return false;
}
