Main.ImageRollovers


var mainSelectorArray = ["button1", "button2", "button3"];
var mainImageArray = ["image1.jpg", "image2.jpg", "image3.jpg"];

var mainImageElements = [];
var mainSelectorElements = [];

function toggleMainImage(e)
{
	var event = wisdom.getEvent(e);
	var tgt = wisdom.getEventTarget(event);

    var itemCount = mainSelectorElements.length;
	for (var i = 0; i < itemCount; i++)
    {
		var elm = mainSelectorElements[i];
		if (elm && elm.id == tgt.id)
		{
             elm.style.display = "block;
		}
		else
		{
			elm.style.display = "none";
		}
	}
}

function initImageToggles()
{
	if (mainSelectorArray.length != mainImageArray.length)
		return;

	mainImageElements = wisdom.util.getElements(mainImageArray);
	mainSelectorElements = wisdom.util.getElements(mainSelectorArray);
	if (mainSelectorElements.length != mainImageElements.length)
		return;

    var itemCount = mainSelectorArray.length;
	for (var i = 0; i < itemCount; i++)
    {
        wisdom.addEventHander(mainSelectorArray[i], "mouseover", toggleMainImage);
    }
}

initImageToggles();