// JavaScript Document

function $id(id)
{
	if (typeof(id) == "string")
	{
		return document.getElementById(id);	
	}
}

var g_browserVer;
var g_tipsImgArr = [
"../images/android_screenshot01_b.jpg",
"../images/android_screenshot02_b.jpg",
"../images/android_screenshot03_b.jpg",
"../images/android_screenshot04_b.jpg",
"../images/android_screenshot05_b.jpg",
"../images/android_screenshot06_b.jpg",
"../images/android_screenshot07_b.jpg",
"../images/android_screenshot08_b.jpg"
];
var g_tips_timer = null;
var g_tips_j = 3;
<!-- Hide 
	function killErrors() { 
		return true; 
	} 
	window.onerror = killErrors; 
	// --> 
function getPos(obj)
{
	var pos = [];
	pos[0] = obj.offsetLeft;//X
	pos[1] = obj.offsetTop;//Y
	while (obj = obj.offsetParent)
	{
		pos[0] += obj.offsetLeft;
		pos[1] += obj.offsetTop;
	}
	return pos;
}

function newShowTips(obj,way,imgIndex,imgHeight)
{
	var featureTips = $id("featureTips");
	var pos = getPos(obj);
	$id("featureTipsImg").src = g_tipsImgArr[imgIndex];
	featureTips.style.left = pos[0] + "px";
	if (way == "down")
	{
		g_tips_timer = setInterval(function(){tipsAnimateDown()},20);
	}
	else
	{
		g_tips_timer = setInterval(function(){tipsAnimateUp(imgHeight)},20);
	}
	function tipsAnimateDown()
	{
		if (g_tips_j == 3)
		{
			featureTips.style.display = "block";
		}
		if (g_tips_j >= 0)
		{
			featureTips.style.top = (pos[1] + 20 + g_tips_j * 15) + "px";
			setOpacity();
			g_tips_j--;
		}
		else
		{
			clearInterval(g_tips_timer);
			g_tips_timer = null;
			g_tips_j = 3;
		}
	}
	function tipsAnimateUp(imgHeight)
	{
		if (g_tips_j == 3)
		{
			featureTips.style.display = "block";
		}
		if (g_tips_j >= 0)
		{
			featureTips.style.top = (pos[1] - imgHeight - 10 - g_tips_j * 15) + "px";
			setOpacity();
			g_tips_j--;
		}
		else
		{
			clearInterval(g_tips_timer);
			g_tips_timer = null;
			g_tips_j = 3;
		}
	}
	function setOpacity()
	{
		if(navigator.userAgent.indexOf("MSIE")>=0)
		{
			g_browserVer = 1;//ie
		}
		else
		{
			g_browserVer = 2;//ff
		}
		if (g_browserVer == 1)
		{
			featureTips.filters.alpha.opacity = 100 - g_tips_j * 25;
		}
		else
		{
			featureTips.style.opacity = 1 - g_tips_j * 0.25;
		}
	}
}

function newHideTips()
{
	$id("featureTips").style.display = "none";
	clearInterval(g_tips_timer);
	g_tips_timer = null;
	g_tips_j = 3;
	$id("featureTipsImg").src = "";
}

