var sImg = "", sNewImg = "", sSlogan = "", sNewSlogan = "", bVisible = 0, nTimer = 0;

function doAnimation(p, img, sl1, sl2, sl3) {
	if (sImg == "")
		sImg = AnimationElement.background;

	if (sSlogan == "")
		sSlogan = AnimationElement.rows(0).cells(1).children(0).rows(1).cells(0).innerHTML;

	p.className = "BUTTON_TOP BUTTON_TOP_HOVER";

	sNewImg = img != "" ? "gui/"+unescape(img) : sImg;
	sNewSlogan = sl1 != "" ? "&nbsp;&nbsp;&nbsp;"+unescape(sl1)+"<BR>"+unescape(sl2)+"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+unescape(sl3) : sSlogan;
	bVisible = 1;

	if (nTimer)
		window.clearTimeout(nTimer);

	nTimer = window.setTimeout("if(bVisible)showAnimation();", 100);
}

function cancelAnimation(p) {
	p.className = "BUTTON_TOP";
	bVisible = 0;

	if (nTimer)
		window.clearTimeout(nTimer);

	nTimer = window.setTimeout("if(!bVisible)showAnimation();", 100);
}

function showAnimation() {
	AnimationElement.filters[0].apply();
	AnimationElement.background = bVisible ? sNewImg : sImg;
	AnimationElement.rows(0).cells(1).children(0).rows(1).cells(0).innerHTML = bVisible ? sNewSlogan : sSlogan;
	AnimationElement.filters[0].play();
}

function window.onload() {
	AnimationElement.filters[0].apply();
	AnimationElement.style.visibility = "visible";
	AnimationElement.filters[0].play();
}