var i = 0;
var opacity = 0;
var timer = null;
var ie = (document.all) ? 1 : 0;
var delay = ie ? 6 : 2;

function show()
{
	if (opacity == 100)
		timer = null;
	else
	{
		opacity++;
		$("#bg_b").css("opacity", (opacity/100));
		$("#img2").css("opacity", (opacity/100)); 
		timer = setTimeout("show()", delay);
	}
}

function hide()
{
	if (!opacity)
	{
		timer = null;
		$("#img2").css("display", "none");
		$("#bg_b").css("display", "none");
	}
	else
	{
		opacity--;
		$("#bg_b").css("opacity", (opacity/100));
		$("#img2").css("opacity", (opacity/100));
		timer = setTimeout("hide()", delay);
	}
}

function showEffect()
{
	$("#img2").css("display", "block");
	$("#bg_b").css("display", "block");
	timer = setTimeout("show()", delay);
}

function hideEffect()
{
	opacity = 100;
	timer = setTimeout("hide()", delay);
}

