var imgfixed = '';
var imgfixed2 = '';

function trocasufixo(src, sufixo)
{
	var
		asufixo, nsrc;
		asufixo = sufixo == 'on' ? 'off' : 'on';
		nsrc = src.replace('_' + asufixo, '_' + sufixo);
		return nsrc;
}

function trocarImagem(nomeimg,sufixo)
{
	var
		obj;
		
	if ((nomeimg != imgfixed) && (nomeimg != imgfixed2))
	{
		obj = eval('document.' + nomeimg);		
		obj.src = trocasufixo(obj.src, sufixo);
	}
}

function fixarImagem(nomeimg2)
{
	var	obj;
		
	if (imgfixed != nomeimg2)
	{
		if (imgfixed != '')
		{
			obj = eval('document.' + imgfixed);		
			obj.src = trocasufixo(obj.src, 'off');
		}
			
		trocarImagem(nomeimg2, 'on');
		imgfixed = nomeimg2;
		self.focus();
	}
}

function fixanumero(nomeimg)
{
	var	obj;

		trocarImagem(nomeimg, 'on');
		imgfixed = nomeimg;
		self.focus();
}

function rollover(img)
{
	var
		s1, s2;
		
	if (img.src.indexOf("_on") >= 0)
	{
		s1 = "_on";
		s2 = "_off";
	}
	else
	{
		s1 = "_off";
		s2 = "_on";
	}
	
	img.src = img.src.replace(s1, s2);
}
