function empty(){}

function displayBox2(clickedLink, boxId)
{	
	//body heigt;
	iBodyWidth = getBodyWidth();
	iBodyHeight = getBodyHeight();
	
	//get real scrollpos
	aScrollPositions = getScrollXY();
	
	tScrollLeft = aScrollPositions[0];
	tScrollTop = aScrollPositions[1];
	
	iScrollTop = getScrollTop();
	
	//viewportheight
	iViewportWidth = getViewportWidth();
	iViewportHeight = getViewportHeight();
	
	infoBox = document.getElementById(boxId);
	
	// position of link with mouseover
	aPosition = findPos(clickedLink);
	
	iPosX = aPosition[0];
	iPosY = aPosition[1];
	
	//aDemension = getDemension(boxId);
	
	infoBox.style.left = iPosX - 22 + 'px';
	infoBox.style.top = iPosY + 12 + 'px';
	
	infoBox.style.display = 'block';
	
	infoBox.className = 'EmailPopupArrowLeftTop';
	
	iInfoBoxWidth = infoBox.offsetWidth;
	iInfoBoxHeight = infoBox.offsetHeight;
	
		
	if(iPosX > iViewportWidth / 2 && iPosX > iInfoBoxWidth)
	{
		infoBox.className = 'EmailPopupArrowRightTop';	
		infoBox.style.left = iPosX - iInfoBoxWidth + 36 + 'px';
		infoBox.style.top = iPosY + 12 + 'px';
	}
	
	if(iPosY - tScrollTop > iViewportHeight / 2 && iPosY - tScrollTop > iInfoBoxHeight)
	{
		if(iPosX > iViewportWidth / 2 && iPosX > iInfoBoxWidth)
		{
			infoBox.className = 'EmailPopupArrowRightBottom';	
			infoBox.style.left = iPosX - iInfoBoxWidth + 36;
			infoBox.style.top = iPosY - iInfoBoxHeight - 3 + 'px';
			
		}
		else
		{
			infoBox.className = 'EmailPopupArrowLeftBottom';
			infoBox.style.left = iPosX - 22;
			infoBox.style.top = iPosY - iInfoBoxHeight - 3 + 'px';
		}
	}
	
	sInfoBoxId = boxId;
	
	//infoBox.onmouseout = myMouseOut;
	
	infoBox.onmouseover = function()
	{
	    this.hoverOverBox = true;
	}
	infoBox.onmouseout = function()
	{
	    this.hoverOverBox = false;
	    
	    var inter = setInterval('update()', 1000);
	}
	update = function()
	{
	    if(infoBox.hoverOverBox == false)
	    {
	        hideBox(infoBox.id);
	    }
	    clearInterval(inter);
    }
	
}

function displayDetailBox22(clickLink, detailBoxId)
{
    detailInfoBox = document.getElementById(detailBoxId);
    
    displayBox(clickLink, detailBoxId);
    
    aPosition = findPos(clickLink);
    
    iPosLeft = aPosition[0];
    iPosTop = aPosition[1];
    
    iDetailBoxWidth = detailInfoBox.offsetWidth;
	iDetailBoxHeight = detailInfoBox.offsetHeight;
    
    switch(detailInfoBox.className)
    {
        case 'EmailPopupArrowLeftTop':    
        detailInfoBox.className = 'DetailPopupArrowLeftTop';
        break;
        
        case 'EmailPopupArrowRightTop':    
        detailInfoBox.className = 'DetailPopupArrowRightTop';
        detailInfoBox.style.left = (iPosLeft - 256) + 'px';
        detailInfoBox.style.top = (iPosTop + 18) + 'px';
        break;
        
        case 'EmailPopupArrowRightBottom': 
        detailInfoBox.className = 'DetailPopupArrowRightBottom';
        detailInfoBox.style.left = (iPosLeft - 256) + 'px';
        detailInfoBox.style.top = (iPosTop - iDetailBoxHeight) + 'px';
        //alert(iPosTop + '   ' + iDetailBoxHeight);
        break;

        case 'EmailPopupArrowLeftBottom': 
        detailInfoBox.className = 'DetailPopupArrowLeftBottom';
        break;

    }
}

function myMouseOut(e)
{
	if (!e) var e = window.event;
		
	var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
	
	if (reltg.id == 'overlay' || reltg.id == 'overlay_header')
	{
		hideBox(sInfoBoxId);
	}
}

function in_array(needle, array)
{
	for(i = 0; i < array.length; i++)
	{
		if(array[i] == needle)
		{
			return true;	
		}
	}
	
	return false;
}

function hideBox(boxId)
{
	infoBox = document.getElementById(boxId);
	infoBox.style.display = 'none';
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}