/*
Name: Javascript Menu v1.1
Programming by: Thomas Mack, thomasmack AT gmail DOT com.
Created for: East Coast Garden Center
Updated: March 10th, 2009
Description: This is a basic menu highlight script. 
It basically preloads images so when a user hovers
over the menu item they won't see a small loading
image first. 
*/

var imgNormal = new Array();
var imgOver = new Array();
var bLoaded = false;

Preload();

function ChangeImg(picture, source) {
    picture.src = source;
}

function Preload() {
// home, events, classes, landscaping, location, railraod club, links
    if (document.images) { // Do we support this object?
        AddImage("home");
		AddImage("events");
		AddImage("classes");
		AddImage("landscaping");
		AddImage("location");
		AddImage("railroad");
		AddImage("links");
        bLoaded = "true"; // OK, our image is loaded
    }
}

function AddImage(strName) {	
	var index = imgNormal.length;
	imgNormal[index] = new Image();
    imgNormal[index].src = "images/n_" + strName + ".png";
    imgOver[index] = new Image();
    imgOver[index].src = "images/o_" + strName + ".png";
}

function OnOver(picture, index) {
    if (document.images && bLoaded == "true") {
        picture.src = imgOver[index].src;
    }
    return (true);
}

function OnOut(picture, index) {
    if (document.images && bLoaded == "true") {
        picture.src = imgNormal[index].src;
    }
}


function reload() {
    document.getElementById("captcha").src = 'captcha.aspx?refresh=t' + Date();
}

function popUp(URL) {
    var bName = navigator.appName;
    var wHeight = 380;
    var wWidth = 570;

    if (bName == "Microsoft Internet Explorer") {
        wHeight = 400;
        wWidth = 600;
    }

    window.open(URL, 'viewimage', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width='+wWidth+',height='+ wHeight);
}