var gTip = new Array();
var lastopen = null;
function showTip(gamelink) {
	hideTip();
	hrefTmp = gamelink.href.split("/");
	hIndex = hrefTmp[hrefTmp.length - 1];
	linkPos = findPos(gamelink);
	if (gTip[hIndex]) {
		gTip[hIndex].style.left = linkPos[0] + "px";
		gTip[hIndex].style.top = (linkPos[1] - 136) + "px";
		gTip[hIndex].style.display = "";
	} else {
		titleTmp = gamelink.title.split(" | ");
		gamelink.title = "";
		gTip[hIndex] = document.createElement("div");
		gTip[hIndex].setAttribute("class", "gtip");
		gTip[hIndex].style.left = linkPos[0] + "px";
		gTip[hIndex].style.top = (linkPos[1] - 136) + "px";
		gTip[hIndex].innerHTML = "<b>" + titleTmp[0] + "</b><br /><img src='http://games.bigfishgames.com/en_" + hIndex + "/th_screen1.jpg' width='125' height='94' alt='' /><br />" + titleTmp[1];
		gamelink.appendChild(gTip[hIndex]);
	}
	lastopen = gTip[hIndex];
}
function hideTip() {
	if (lastopen != null) {
		lastopen.style.display = "none";
		lastopen = null;
	}
}
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return [curleft,curtop];
}
function bookmarkPage(url, title) {
	if (window.sidebar) window.sidebar.addPanel(title, url, "");
	else if (window.opera && window.print) {
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} else if (document.all) window.external.AddFavorite(url, title);
}
