var show = 0;
var offsety = 0;
var boxOffset = 200;

function infoboxstart(LISTID,ID,LARGE,MEDIUM,SMALL,TINY,POSTERURL,TV) 
{
	boxOffset = 200;
	document.onmousemove = getmousepointer;
	getElement('infobox').style.visibility = 'visible';
	getElement('infobox').style.display = 'block';

	TVicon = "";
	if (TV)
	{
		TVicon = "<img src=\"img/icons/tv.gif\" alt=\"tv\" />";
	}
	TINY = TINY.replace(/\[br\]/g,'<br/>');
	
	getElement('statusbody').innerHTML = '<img src="' + POSTERURL + '" style="float : left; margin : 5px; width : 94px; height : 140px; border: 1px solid black"/> <b style="font-size : 16px; font-weight : bold">' + LARGE + '</b><br/><i style="font-size : 14px; font-weight : bold">' + MEDIUM + '</i><p style="font-size : 12px">' + SMALL + '</p><p><i>' + TINY + '</i></p>' + TVicon;
  	show = 1;
}

function infoboxschedulestart(YEAR,MONTH,DAY,WEEK,EVENT)
{
	boxOffset = 75;
	document.onmousemove = getmousepointer;
	getElement('infobox').style.visibility = 'visible';
	getElement('infobox').style.display = 'block';
	
	getElement('statusbody').innerHTML = '<span class="midtitle">&nbsp;' + YEAR + '-' + MONTH + '-' + DAY + '</span><br/>&nbsp;&nbsp;<b>Vecka ' + WEEK + '</b><br/><p>' + EVENT + '</p>';
}

function infoboxhelpstart(TITLE,MSG)
{
	boxOffset = 100;
	document.onmousemove = getmousepointer;
	getElement('infobox').style.visibility = 'visible';
	getElement('infobox').style.display = 'block';

	getElement('statusbody').innerHTML = '<span class=\"smalltitle\">&nbsp;' + TITLE + '</span><br/><p>' + MSG + '</p>';
}

function infoboxend()
{
	getElement('infobox').style.visibility = 'hidden';
	getElement('infobox').style.display = 'none';
	show = 0;
}
function getmousepointer(e)
{

var mouseX = 0;
    var mouseY = 0;
    var screenY = 0;

	if (document.all) {
		mouseX = window.event.x;
    	mouseY = window.event.y + document.documentElement.scrollTop;
        screenY = window.event.screenY;
    }
    else {
    	mouseX = e.pageX;
        mouseY = e.pageY;
        screenY = e.screenY;
    }

    if ((screenY + boxOffset + 80) > screen.height)
    {
    	mouseY = mouseY - boxOffset;
    }

    mouseX = mouseX + 20;


    getElement('infobox').style.left = mouseX + 'px';
    getElement('infobox').style.top = mouseY + 'px';

}