/*
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}

function gallerySwap () {
	var allHTMLTags=document.getElementsByTagName('span');
	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className=='gallery_image') {
			allHTMLTags[i].onmouseover = function(){
				var children = this.childNodes;
				var imgSrc = children[0].src;
				imgSrc = imgSrc.replace("thumbnail/56x", "image/310x");
				var theImage = document.getElementById('image');
				theImage.src = imgSrc;
				var zoom = document.getElementById('magicZoom');
				zoom.href = imgSrc.replace("thumbnail/56x", "image/525x");
				var imgTitle = children[0].title;
				var theImageTitle = document.getElementById('image-title');
				theImageTitle.innerHTML = imgTitle;
			};
		}
	}
}

addLoadEvent(gallerySwap);
*/

jQuery(document).ready(function($){
	$('span.gallery_image').mouseover(function(){
		var imgSrc1 = $(this).children('img').attr('src');
		var imgSrc2 = $(this).children('img').attr('src');
		$('img#image').attr('src', imgSrc1.replace("thumbnail/56x", "image/310x"));
		$('a#magicZoom').attr('href', imgSrc2.replace("thumbnail/56x", "image/525x"));
		var imgTitle = $(this).children('img').attr('title');
		$('span.image_label').html(imgTitle);
		MagicZoom.refresh();
	});
});
