function showPic(){
	this._clickedItem = null;	
}

showPic.prototype.init = function(){
	var sp = this;
	if(!document.getElementById('thumbs')) return;
    var links = document.getElementsByClassName("showpic");
	for (var i=0;i<links.length;i++){
		links[i].onclick = function(){
			sp._clickedItem = this;
			return sp.show();
		}
		links[i].onkeypress = links[i].onclick;
	}	
}

showPic.prototype.show = function(){
	var thumb = this._clickedItem;
	
  var source = thumb.parentNode.href;
  var placeholder = document.getElementById("placeholder");
  placeholder.src = source;
	
  if (thumb.title){
    var text = thumb.title;
  } else {
    var text = "";
  }
	if (document.getElementById("imagedescription")){
		var description = document.getElementById("imagedescription");
		if (description.firstChild) {
			if (description.firstChild.nodeType == 3) {
				description.firstChild.nodeValue = text;
			}
		}
	}
	this._clickedItem = null;
  return false;
}

addEvent(window, 'load',
    function(){
      var sp = new showPic();
      sp.init();
    }
    );