var g_timer;
var g_step = 1;
var g_browserVer;
var g_panel,g_tip,g_shadow;
var g_loaded = false;

function $id(id){
	return document.getElementById(id);
}

function tipInit(){
	g_browserVer = WhichBrowser();
	g_panel = $id("panel");
	g_tip = $id("tip");
	g_shadow = $id("shadow");
	g_loaded = true;
	document.getElementById("dlOnline").style.visibility = "visible";
}

function WhichBrowser()
{
    if(navigator.userAgent.indexOf("MSIE")>=0)
	{
	    return 1;
	}
	else
	{
	    return 2;
	}
}

function showIip(){
	if (g_loaded == false)
	{
		return;
	}
	if(g_timer)
	{
		clearInterval(g_timer);
	}
	g_tip.style.display = "block";
	g_timer = setInterval(function(){beginShow();},10);
}

function beginShow(){
	if (g_step < 4){
		g_step++;
		g_tip.style.top = 478-g_step*5+"px";
		if(g_browserVer == 1)
		{
			g_panel.filters.alpha.opacity = g_step*25;
			g_shadow.filters.alpha.opacity = g_step*5;
		}
		else
		{
			g_panel.style.opacity = g_step*0.25;
			g_shadow.style.opacity = g_step*0.05;
		}
	}
	else
	{
		clearInterval(g_timer);
	}
}

function hideTip(){
	if (g_loaded == false)
	{
		return;
	}
	if(g_timer)
	{
		clearInterval(g_timer);
	}
	g_timer = setInterval(function(){beginHide();},10);
}

function beginHide(){
	if (g_step > 0){
		g_step--;
		g_tip.style.top = 478-g_step*5+"px";
		if(g_browserVer == 1)
		{
			g_panel.filters.alpha.opacity = g_step*25;
			g_shadow.filters.alpha.opacity = g_step*5;
		}
		else
		{
			g_panel.style.opacity = g_step*0.25;
			g_shadow.style.opacity = g_step*0.05;
		}
	}
	else
	{
		g_tip.style.display = "none";
		clearInterval(g_timer);
	}
}

g_dlImgCount=0;
function showDlOnline(){
	if(++g_dlImgCount==2){
		tipInit();
	}
}
