
function showElement(){
  for( var i = 0; i < arguments.length; i++ ) {
    $(arguments[i]).css({visibility: "visible"});
  }
}

function hideElement(){
  for( var i = 0; i < arguments.length; i++ ) {
    $(arguments[i]).css({visibility: "hidden"});
  }
}

function showPic(picIndex){
  //alert( currentImage + " || " + picIndex);
  $("#imageDisplay").attr('src', "http://www.leo.zovic.ca/images/placeholder.gif");
  $("#imageDisplay").attr('src', image_set[picIndex-1].url);
  currentImage = picIndex;
  showElement("#curtain", '#imageFrame');
  $("#imageCaption").html("\"" + image_set[picIndex-1].caption + "\"");
  $("#imageDisplay").fadeIn("fast");
}

function prevPic() {
  if(currentImage>1){
    showPic(parseInt(currentImage)-1);
  }
}

function nextPic() {
  if(currentImage<image_set.length){
    showPic(parseInt(currentImage)+1);
  }
}

function closePic() {
  hideElement('#curtain', '#imageFrame');
  $("#imageDisplay").attr('src', "http://www.leo.zovic.ca/images/placeholder.gif");
}
