/*
The copyright of this Software (UTIPS) is assigned to Southeast Education Service Center ("SESC"), 685 E. 200 S., Price, Utah, Trustee for the Education community.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

SESC acknowledges Jay Stephens as the sage for pointing out the importance of online assessment way back in 1996.  Speaking of thinkers, here’s to the Thinkers

The misfits, the rebels, the troublemakers, the round pegs in square holes, the ones who think differently.

You can praise them, disagree with them, quote them, disbelieve them, glorify or vilify them. About the only thing you can’t do is ignore them.

Because they change things, they invent, they imagine, they heal, they explore, they create, they inspire, they push the human race forward.

They have to think differently.  How else can they stare at an empty canvas and see a work of art?  Or sit in silence and hear a song that’s never been written?  Or gaze at a red planet and see a laboratory on wheels?

We make tools for these kinds of people.  While some see them as different, we see genius.  Because the people who think differently enough to think they can change the world, are the ones who do.
*/
// example usage
// change_icon(p1i0, "images/menu_icon/tools_newfolder_disabled.gif");
function change_icon(item, image_name)
{
  stgobj(item.ids+'ICON').src=image_name;
}

/* these functions assume tools_something.gif and
 * tools_something_disabled.gif for the file names
 * of the menu item icons.
 */
function icon_disable(item)
{
  if(stgobj(item.ids+'ICON') != null){
	  var src  = stgobj(item.ids+'ICON').src;
	  var src1 = src.replace(/^(.*\/tools_[^_]*)(_.*)?(\.gif)$/, "$1_disabled$3");
	  change_icon(item, src1);
  }
}
function icon_enable(item)
{
  if(stgobj(item.ids+'ICON') != null){
	  var src  = stgobj(item.ids+'ICON').src;
	  var src1 = src.replace(/^(.*\/tools_[^_]*)(_.*)?(\.gif)$/, "$1$3");
	  change_icon(item, src1);
  }
}
