﻿var place;

function playFlash(path)
{
    var flashDiv = document.getElementById('fly_contaner');
    var y = document.documentElement.scrollTop;
    var x = document.documentElement.scrollLeft; 

    if (!document.all) {
        if ((x == 0) || (x == null)) x = window.pageXOffset;
        if ((y == 0) || (y == null)) y = window.pageYOffset; 
    }

    flashDiv.style.top = (y + document.documentElement.offsetHeight/2 - 450) +  'px';

    var footer = document.getElementById("footer");
    place =  footer.style.top;
    footer.style.top = (y + document.documentElement.offsetHeight/2 + 400) + 'px'; 
    var body = document.getElementById("body");
    body.style.height =  (y + document.documentElement.offsetHeight/2 + 400) + 'px'; 

    flashDiv.style.left = (x + document.documentElement.offsetWidth/2 - 250) + 'px'; 
    flashDiv.style.width = '580px';
    flashDiv.style.height = '560px';
    flashDiv.style.display = 'block';
    var enter = new SWFObject(path, "enter", "500", "550", "7", "#101010");
    enter.addParam("allowScriptAccess", "sameDomain");
    enter.addParam("quality", "high");
    enter.write('fly_flash');
    window.adjustWindowHeight && window.adjustWindowHeight();
}

function flashClose()
{
    var flashDiv = document.getElementById('fly_contaner');
    flashDiv.style.display  = 'none';
    var footer = document.getElementById("footer");
    footer.style.top = place; 
    var b = document.getElementById("body");
    b.style.height =  "";
    place = "0"; 
    window.adjustWindowHeight && window.adjustWindowHeight();
    b.style.visibility = 'hidden'; 
    b.style.visibility = 'visible'; 
}
