function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(prepareGallery);

function prepareGallery(){
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById) return false;
	if (!document.getElementById("thumb-list")) return false;
	var gallery = document.getElementById("thumb-list");
	var links = gallery.getElementsByTagName("a");
	for ( var i=0; i < links.length; i++) {
		links[i].onclick = function() {
			return showPic(this);
		}
	}
}

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;
}

$(document).ready(function() {
$(function() {
	$('#thumbs-square li').hover(function(){
		$(this).find('img').animate({bottom:'40px'},{queue:false,duration:700});
	}, function(){
		$(this).find('img').animate({bottom:'0px'},{queue:false,duration:700});
	});

});
});

