/***************************************************************************************************
* Name:          toggle.js
* Author:        Kyle Brickman
* Description:   Creates a toggle image button
* Created:       15 May 2009
* Prerequisites: None
***************************************************************************************************/
	
function rollToggle( obj, index, active, states )
{
	obj.style.border = 0;
	
	obj.onmouseover = function( )
	{
		obj.src = index == active ? states[index].active : states[index].on;
	};
	
	obj.onmouseout = function( )
	{
		obj.src = index == active ? states[index].active : states[index].off;
	};
}