﻿var m_sPnlFlashMovieId = null;
var m_sLocator = null;

function close_banner(sArg)
{
    document.getElementById(sButtonID).click();
}

function SetFlashLocation()
{
    var oPnlFlashMovie = document.getElementById(m_sPnlFlashMovieId);
    var oLocator = document.getElementById(m_sLocator);
    var sLocatorBottom = Position.GetFromElement(oLocator).y + oLocator.offsetHeight;
    oPnlFlashMovie.style.top = sLocatorBottom - oPnlFlashMovie.offsetHeight;
    oPnlFlashMovie.style.left = Position.GetFromElement(oLocator).x;
}

function SetElementsStrings(sPnlFlashMovieId, sLocator)
{
    m_sPnlFlashMovieId = sPnlFlashMovieId;
    m_sLocator = sLocator;
}

function Position()
{ }

Position.GetFromElement = function (obj)
{
    //Logic duplicated in redirect.js - getRealPos()
    var coord = new Coordinate();

	if (obj.offsetParent)
	{
		while (obj)
		{
			coord.x += obj.offsetLeft;
			coord.y += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}

	return coord;
}

function Coordinate(x, y)
{
    this.x = isNaN(x) ? 0 : x;
	this.y = isNaN(y) ? 0 : y;
}