// Dynamic 3D Button Bar
// Designer: Joseph Chan
// Copyrights (c) 2000, Magic Ivy Technologies, All Rights Reseved

var nButtons = 7;
var button = new Array();
button[0] = new initButton("home", "index.html", "images/button_home.jpg", "images/button_home_a.jpg", "images/button_home_s.jpg", "to Home page");
button[1] = new initButton("profile", "profile.html", "images/button_profile.jpg", "images/button_profile_a.jpg", "images/button_profile_s.jpg", "to Company Profile page");
button[2] = new initButton("showroom", "productshowroom.html", "images/button_showroom.jpg", "images/button_showroom_a.jpg", "images/button_showroom_s.jpg", "to Products Showroom page");
button[3] = new initButton("shopping", "productcatalog.html", "images/button_shopping.jpg", "images/button_shopping_a.jpg", "images/button_shopping_s.jpg", "to Products Shopping page");
button[4] = new initButton("download", "productdownload.html", "images/button_download.jpg", "images/button_download_a.jpg", "images/button_download_s.jpg", "to Download Products Drivers/Demo page");
button[5] = new initButton("contact", "contactus.html", "images/button_contact.jpg", "images/button_contact_a.jpg", "images/button_contact_s.jpg", "to Contact Us page");
button[6] = new initButton("FAQ", "FAQ.html", "images/button_FAQ.jpg", "images/button_FAQ_a.jpg", "images/button_FAQ_s.jpg", "to FAQ page");

function initButton(name, href, imageR, imageA, imageS, desc)
{
	this.imageName = name;
	this.anchorHref = href;
	this.imageRegular = new Image();
	this.imageRegular.src = imageR;
	this.imageActive = new Image();
	this.imageActive.src = imageA;
	this.imageSelected = new Image();
	this.imageSelected.src = imageS;
	this.imageDesc = desc;
}

function changeButton(id, status)
{
	if(status == 'regular')
	{
		document.images[button[id].imageName].src = button[id].imageRegular.src;
	}
	else if(status == 'active')
	{
		document.images[button[id].imageName].src = button[id].imageActive.src;
	}
	else if(status == 'selected')
	{
		document.images[button[id].imageName].src = button[id].imageSelected.src;
	}
}


function setButtons(active_id, direction, spaces)
{
	for(i = 0; i < nButtons; i++)
	{
		if(i == active_id)
		{
			document.write("<img name=\"" + button[i].imageName + "\" src=\"" + button[i].imageSelected.src + "\" border=0>");
		}
		else
		{
			document.write("<a href=\"" + button[i].anchorHref + "\" onmouseover=\"changeButton(" + i + ", 'active'); return true\" onmousedown=\"changeButton(" + i + ", 'selected'); changeButton(" + active_id + ", 'regular'); return true\" onmouseout=\"changeButton(" + i + ", 'regular'); changeButton(" + active_id + ", 'selected'); return true\"><img name=\"" + button[i].imageName + "\" src=\"" + button[i].imageRegular.src + "\" border=\"0\" alt=\"" + button[i].imageDesc + "\"></a>");
		}

		if(direction == 1) /* vertical bar */
		{
			document.write("<br>");
		}

		for(j = 0; j < spaces; j++)
		{
			if(direction == 1) /* vertical bar */
			{
				document.write("<br>");
			}
			else /* horizontal bar */
			{
				document.write("&nbsp;");
			}
		}
	}

}


