function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
function photoSelector(){
	if(!document.getElementById) return false;
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById("thumbs")) return false;
	var pselector = document.getElementById("thumbs");
	var imageArray = pselector.getElementsByTagName("IMG");
	for (i=0;i<imageArray.length;i++){
		imageArray[i].onclick = function(){
			pviewer(this.src);
			
		}
	imageArray[i].parentNode.removeAttribute("href");
	}	
}
function pviewer(src){
	if(!document.getElementById) return false;
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById("mainImg")) return false;
	var pviewer = document.getElementById("mainImg");
	src = src.replace("tmb","full");
	pviewer.setAttribute("src",src);
}
addLoadEvent(photoSelector);


