function getWinPosition(){
    stWw = 908; // размер окна stWin Width
    stWh = 500; // размер окна stWin Height
    var de = document.documentElement;
    var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
    var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
    
    if (self.pageYOffset) {
        yScrolltop = self.pageYOffset;
    } else if (document.documentElement && document.documentElement.scrollTop){
        yScrolltop = document.documentElement.scrollTop;
    } else if (document.body) {
        yScrolltop = document.body.scrollTop;
    }
    if (window.innerHeight && window.scrollMaxY) {	
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight){
        yScroll = document.body.scrollHeight;
    } else {
        yScroll = document.body.offsetHeight;
    }
    stw = document.getElementById("stWin");
    stw.style.width = stWw;
    stw.style.height = stWh;
    stw.style.top = yScrolltop+((h-stWh)/2)+"px";
    stw.style.left = (w-stWw)/2+"px";
    
    stwb = document.getElementById("stWinBgr");
    stwb.style.height = yScroll+"px";
}
function hide_stWin(){
    document.getElementById("stWin").style.display = "none";
    document.getElementById("stWinBgr").style.display = "none";
    document.getElementById("iframeContent").src="";
    document.body.style.overflow = "auto";
}
function show_stWin(){
    getWinPosition();
    document.getElementById("stWin").style.display = "block";
    document.getElementById("stWinBgr").style.display = "block";
    document.body.style.overflow = "hidden";
}
window.onresize = window.onscroll = getWinPosition;

