function showLoginBox() {
	$('login-teaser').hide();
	$('login-box').show();
}

function showGamercard(img, liveTag, type) {
    if(type == 'XBox-Live') {
        var iframe 	= '<img src="http://avatar.xboxlive.com/avatar/' + liveTag + '/avatar-body.png" height="300" width="150" alt="" />'
                    + '<iframe src="http://gamercard.xbox.com/' + liveTag + '.card" scrolling="no" frameborder="0" height="140" width="204"></iframe>';
        var gc = $('TheGamerCardDiv');
        var pos = absolutePosition(img);
        pos[0] += 20;
        pos[1]-=190;
        gc.innerHTML = iframe;
        gc.style.left = pos[0] + "px";
        gc.style.top = pos[1] + "px";
        gc.className = 'gamerCardVisible';
    }
}
function hideGamercard()
{
	var gc = $('TheGamerCardDiv');
	gc.className = 'gamerCardHidden';
}

function absolutePosition(element) {
    var top = 0, left = 0;
    do {
      top += element.offsetTop  || 0;
      left += element.offsetLeft || 0;
      element = element.offsetParent;
    } while (element);
    return [left, top];
}

function gotoGamercard(liveTag, type)
{
    if(type == 'XBox-Live') {
        window.open('http://live.xbox.com/member/' + liveTag);
    }
}