var AttBox = null;
var searchTileInAspPage = null;
$(window).load(function(){
CheckReferrer();
});
function CheckReferrer()
{
    try
    {
        AttBox = document.getElementById("attBox");
        searchTileInAspPage = document.getElementById("ifrmSearch");
        var Ref = null;
        Ref = document.referrer;
        Ref = Ref.toLowerCase();
        if(Ref.length>0)
        {
            if(Ref.indexOf('lanzaroteholidays24.com')!=-1 || Ref.indexOf('grancanariaholidays24.com')!=-1)
            {
		        if(searchTileInAspPage ==null)
		        {
			        DisableParent();
		        }
		        else
		        {
			        var cWindow = searchTileInAspPage.contentWindow;
			        cWindow.DisableParent();
		        }
            		PositionAttBox();
            		ShowHideAttBox(true);
            }
        }
    }
    catch(e)
    {
        alert(e);
    }
}

function ShowHideAttBox(ToShow)
{
    try
    {
        if(ToShow)
        {
            with(AttBox)
            {
                style.display="";
                style.visibility="visible";
            }  
        }
        else
        {
            with(AttBox)
            {
                style.display="none";
                style.visibility="hidden";
            } 
        }
    }
    catch(e)
    {
        alert(e);
    }
}

function PositionAttBox()
{
	var anchorObject = getAnchorPosition("SiteLogo");
	with(AttBox)
	{
		var leftPos = anchorObject.x + 300;
		style.top = 200 + "px";
		style.left = leftPos + "px";
	}
}