/* simple rollover script
 * by Toowards
 */

function Rollover( base_name )
{
	this.name = base_name;
	this.image_dir = "/images";
	this.img = null;

	this.Load = doRollLoad;
	this.Over = doRollOver;
	this.Out = doRollOut;

}

function doRollLoad()
{
	this.img = new Array();
	this.img[0] = new Image();
	this.img[0].src = this.image_dir + "/" + this.name + ".gif";
	this.img[1] = new Image();
	this.img[1].src = this.image_dir + "/" + this.name + "_o.gif";
}

function doRollOver()
{
	image = document.images[ this.name ];
	image.src = this.img[1].src;
}

function doRollOut()
{
	image = document.images[ this.name ];
	image.src = this.img[0].src;
}

MenuRollovers = Array();
function MenuRollover( base_name, src1, src2 )
{
	this.name = base_name;
	this.img = null;
	this.src1 = src1;
	this.src2 = src2;

	this.Load = doMenuRollLoad;
	this.Over = doRollOver;
	this.Out = doRollOut;

	MenuRollovers[ MenuRollovers.length ] = this;
	this.loaded = false;

}

function doMenuRollLoad()
{
	this.img = new Array();
	this.img[0] = new Image();
	this.img[0].src = this.src1;
	this.img[1] = new Image();
	this.img[1].src = this.src2;
}

function MenuRollover_OnLoad()
{
	for( i=0; i<MenuRollovers.length; i++ )
	{
		MenuRollovers[i].Load();
	}
}


