function closeWin(){;
	this.window.close;
}

function showPic(whichpic) {
  if (!document.getElementById("placeholder")) return true;
  var source = whichpic.getAttribute("href");
  var placeholder = document.getElementById("placeholder");
  placeholder.setAttribute("src",source);


  return false;
}


function prepareGallery(){ 
/**********  the ususal tests to make sure methods and ids are in place  ******************/
	if (!document.getElementsByTagName) {
		return false;
	}
	
	if (!document.getElementById) {
		return false;
	}
	if (!document.getElementById("galleryNav")){
		return false;
	}
	
	//**********set up the links by attaching a function literal ***************/
	var gallery = document.getElementById("galleryNav");
	var links = gallery.getElementsByTagName("a");
	for (var i=0; i < links.length; i++){
	
		links[i].onclick = function() {
		//send an object from prepgallery function(src attribute etc) to the showPic function
		showPic(this);
		//stop the default a link behavior
		return false;	
		}
	}
}




function addLoadEvent(func){
var oldOnLoad = window.onload;
if (typeof window.onload != 'function'){
	window.onload = func;
}else{
	window.onload = function(){
		oldOnLoad();
		func();
		}
	}
}


addLoadEvent(prepareGallery);