var mmver = navigator.appVersion;
allowc=1;

var x = readCookie('noshow');
if (!x) {

if (mmver.indexOf('MSIE') != -1)
{
 // для IE
document.write("<div id='PopSuperWin' style='z-index:99999; top:250px; width: 800px;  height: 210px;  left: 20%; cursor: hand; z-index:99999999999; position:absolute;'>"
+"<div id='ff'>"
+"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='468' height='140' id='new' align='middle'>"
+"<param name='allowScriptAccess' value='sameDomain' /> "
+"<param name='movie' value='"+file+"?sub="+sub+"' /> "
+"<param name='quality' value='high' />"
+"<param name='bgcolor' value='#4B030B' />"
+"<embed src='"+file+"?sub="+sub+"' quality='high' bgcolor='#4B030B' width='468' height='140' name='new' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"
+"</object>"
+"</div>"
+"</div>");
if (document.all['PopSuperWin'].style)
window.setInterval("MovePop()", 5);
window.onerror=null;
document.body.scrollTop=10;
}
 else
{
 // для FF, Opera и подобных

document.write("<div id='PopSuperWin' style='z-index:99999; position:fixed; top:44%; width: 800px;  height: 210px;  left: 20%;'>"
+"<div id='ff'>"
+"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='468' height='140' id='new' align='middle'>"
+"<param name='allowScriptAccess' value='sameDomain' /> "
+"<param name='movie' value='"+file+"?sub="+sub+"' /> "
+"<param name='quality' value='high' />"
+"<param name='bgcolor' value='#4B030B' />"
+"<embed src='"+file+"?sub="+sub+"' quality='high' bgcolor='#4B030B' width='468' height='140' name='new' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"
+"</object>"
+"</div>"
+"</div>");
}
}
 function testmovie_DoFSCommand(command, args) {
  alert("Здесь данные из Flash: "+command+", "+args);
}

function DivOffpuru()
{
 document.getElementById('PopSuperWin').style.display='none';
}
function hidevonal(){
 DivOffpuru();
 createCookie('noshow','true',1);
document.getElementById('ff').style.display='none';
}
function PopShow(sub)
{
 DivOffpuru();
 createCookie('noshow','true',1);
 window.focus();
 setTimeout("allowc=1",1000);
}

function MovePop() {
if (document.body.scrollTop==0)
 document.all['PopSuperWin'].style.top=document.documentElement.scrollTop+250; else
document.all['PopSuperWin'].style.top=document.body.scrollTop+250;
}

function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function eraseCookie(name) {
    createCookie(name,"",-1);
}

