  window.onload = (function (e) {onLoadInit();});
    var target = "x";

    function onLoadInit() {
        if (document.getElementById("preLoads")) {
            document.getElementById("preLoads").style.display = "none";
        }
        setUphomepage();
        setUpThumbnails();
	resizeDiv();
    }


	function resizeDiv() {
        if (document.getElementById("contentColumn")) {
           document.getElementById("contentColumn").style.height="475px";
        }
    }


    function setUpThumbnails() {
        if (!document.images) {
            document.images = document.getElementsByClassName("img");
        }
        for (var imageNum = 0; imageNum < document.images.length; imageNum++) {
            var thisPicture = document.images[imageNum];
            if (thisPicture.src.lastIndexOf("_gallery") != -1) {
                if (window.addEventListener) {
                    thisPicture.addEventListener("mouseover", swapImage, false);
                } else {
                    if (window.attachEvent) {
                        thisPicture.attachEvent("onmouseover", swapImage);
                    } else {
                        return null;
                    }
                }
            }
        }
    }


    function swapImage(e) {
        if (window.event && window.event.srcElement) {
            target = window.event.srcElement;
        } else {
            if (e && e.target) {
                target = e.target;
            }
        }
        var mainStr = target.src;
        document.getElementById("mainPhoto").src = mainStr;
    }


    function setUphomepage() {
        if (document.getElementById("homepageImage")) {
            var homePicNum = (Math.round((Math.random() * 3) + 1));
            document.getElementById("homepageImage").src = "hp_img/" + homePicNum + ".jpg";
        }
    }
