/**
 * Scroller de ofertas
 */
var v_scr_height = '33px';
var v_scr_pause	 = 7000;

function wsScrollerMove1(a_div)
{
	v_div = eval(a_div);

	if (parseInt(v_div.style.top) > 0 && parseInt(v_div.style.top) <= 5)
	{
		v_div.style.top = 0;

		setTimeout('wsScrollerMove1(v_div)', v_scr_pause);
		setTimeout('wsScrollerMove2(second_obj)', v_scr_pause);

		return;
	}
	if (parseInt(v_div.style.top) >= v_div.clientHeight * -1)
	{
		v_div.style.top = parseInt(v_div.style.top) - 5 + 'px';
		setTimeout('wsScrollerMove1(v_div)', 50);
	}
	else
	{
		v_div.style.top = v_scr_height;
		v_div.innerHTML = v_scroller[j];

		if (j == v_scroller.length - 1)
		{
			j = 0;
		}
		else
		{
			j++;
		}
	}
}
function wsScrollerMove2(a_div)
{
	v_div_2 = eval(a_div);

	if (parseInt(v_div_2.style.top) > 0 && parseInt(v_div_2.style.top) <= 5)
	{
		v_div_2.style.top = 0;
		setTimeout('wsScrollerMove2(v_div_2)', v_scr_pause);
		setTimeout('wsScrollerMove1(first_obj)', v_scr_pause);
		return
	}
	if (parseInt(v_div_2.style.top) >= v_div_2.clientHeight * -1)
	{
		v_div_2.style.top = parseInt(v_div_2.style.top) - 5 + 'px';
		setTimeout('wsScrollerMove2(second_obj)', 50);
	}
	else
	{
		v_div_2.style.top = v_scr_height;
		v_div_2.innerHTML = v_scroller[j];

		if (j == v_scroller.length - 1)
		{
			j = 0;
		}
		else
		{
			j++;
		}
	}
}
function startScroll()
{
	first_obj  = document.getElementById('scr_first');
	second_obj = document.getElementById('scr_second');

	wsScrollerMove1(first_obj);

	second_obj.style.top = v_scr_height;
	second_obj.style.visibility = 'visible';
}

/**
 * wsNoRightClick()
 *
 * Desabilita o botão direito do mouse e o menu contextual.
 *
 * @param  elemento do documento a ser protegido
 * @return boolean
 */
function clickNS(e)
{
	if (document.layers || (document.getElementById && !document.all))
	{
		if (e.which == 2 || e.which == 3)
		{
			alert('Função desabilitada para proteger direitos.');
			return false;
		}
	}
}
function wsNoRightClick(a_element)
{
	if (document.layers)
	{
		document.captureEvents(Event.MOUSEDOWN);
		a_element.onmousedown = clickNS;
	}
	else
	{
		a_element.onmouseup = clickNS;
		a_element.oncontextmenu = function()
		{
			if (document.all)
			{
				alert('Função desabilitada para proteger direitos.');
				return false;
			}
		}
	}
	a_element.oncontextmenu = function(){return false};
}