﻿function LicenceVyprsela(Atext)
{
    document.write('<iframe height="100" border="0" src="./LicenceOut.aspx?text='+ Atext +'" ID="LicenceVyprsela" style="z-index:300; position:absolute; left: 100px; top: 100px; margin: 0 0 0 0; padding: 0 0 0 0; border: 0px; "></iframe>');
    casovac = setTimeout("Posun()", 250);
    return;
}
    
function WindowHeight()
{
    if (!isNaN(document.body.clientHeight))
        return document.body.clientHeight;
    else
    if (!isNaN(window.innerHeight))
        return window.innerHeight;
    else
    if (!isNaN(document.documentElement.clientHeight))
        return document.documentElement.clientHeight;
    else
        return 0;
}

function WindowWidth()
{

    if (!isNaN(document.body.clientWidth))
        return document.body.clientWidth;
    else
    if (!isNaN(window.innerWidth))
        return window.innerWidth;
    else
    if (!isNaN(document.documentElement.clientWidth))
        return document.documentElement.clientWidth;
    else
        return 0;
}


function Posun()
{

    elDiv = document.getElementById("LicenceVyprsela");

    leva = elDiv.style.left;
    vrch = elDiv.style.top;

    leva = leva.replace('px','');
    vrch = vrch.replace('px','');

    if(leva == 100 && vrch < WindowHeight() - 200)
    {
	    vrch = (parseInt(vrch) + 1 );
    }
    else if(leva < WindowWidth() - 400 && vrch >= WindowHeight() - 200)
    {
	    leva=(parseInt(leva) + 1 );
    }
    else if(leva >= WindowWidth() - 400  && vrch>100)
    {
	    vrch=(parseInt(vrch) - 1 );
    }
    else if(leva>100 && vrch==100)
    {
	    leva=(parseInt(leva) - 1 );
    }

    elDiv.style.left = (leva) + 'px';
    elDiv.style.top = (vrch) + 'px';

    casovac = setTimeout("Posun()", 10);
}