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

addLoadEvent(prepareGallery);


function prepareGallery(){
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById) return false;
	if (!document.getElementById("home-choices")) return false;
	var gallery = document.getElementById("home-choices");
	var links = gallery.getElementsByTagName("a");
	for ( var i=0; i < links.length; i++) {
		links[i].onmouseout = function() {
			showPic();
		}
		
	}
}


function showPic(){
    document.getElementById("home-choices").style.backgroundPosition = "-0px";  
}


function showPic1(){
    document.getElementById("home-choices").style.backgroundPosition = "-264px";  
}


function showPic2(){
    document.getElementById("home-choices").style.backgroundPosition = "-528px";  
}


function showPic3(){
    document.getElementById("home-choices").style.backgroundPosition = "-792px";  
}
