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: 600px;  height: 110px;  left: 20%; background: #000; cursor: hand; z-index:99999999999; position:absolute;'>"
+" <table width='600' height='110' cellspacing='0' cellpadding='0' style='z-index:99999; border: 2px double black; background-color: #4B030B;'>"
+" <tr height='20'><td bgcolor='#4B030B' width='300' style='padding-left: 10px; background-color: #4B030B;'><b>"
+" <a target='_blank' style='font-size: 14px; color: #FFFFFF; "
+" font-family: Arial; text-decoration:none; font-style:italic;' href='http://"+sub+".vonal.ru/?x=2'>"
+" <img src=\"http://"+sub+".vonal.ru/2.gif\" border=0></a></td>"
+" <td bgcolor='#4B030B' width='300' style='padding-right: 3px; background-color: #4B030B;' align='right'>"
+" <b><a style='font-size: 13px; color: #FFFFFF;  font-family: Arial; text-decoration:none;' onmouseover='allowc=0'"
+" onclick='DivOffpuru(this)' title='Close' href='javascript: PopShow(\""+sub+"\")' onmouseout='allowc=1'>Close[X]</a></b></td></tr>"
+" <tr><td height='90' width='600' colspan='2' bgcolor='#870612'>"
+ '<iframe src="http://'+sub+'.vonal.ru/pop.php?sub='+sub+'" name="POP" scrolling="no" width="600" frameborder="0" height="90"></iframe>'
+"</tr>"
+" </tr></table></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: 600px;  height: 110px;  left: 20%;'>");
document.write(" <table width='600' height='110' cellspacing='0' cellpadding='0' style='border: 2px double black; background-color: #4B030B;'>"
+" <tr height='20'><td bgcolor='#4B030B' width='300' style='pz-index:99999; adding-left: 10px; background-color: #4B030B;'><b>"
+" <a target='_blank' style='font-size: 14px; color: #FFFFFF; "
+" font-family: Arial; text-decoration:none; font-style:italic;' href='http://"+sub+".vonal.ru/?x=2'>"
+" <img src=\"http://"+sub+".vonal.ru/2.gif\" border=0></a></td>"
+" <td bgcolor='#4B030B' width='300' style='padding-right: 3px; background-color: #4B030B;' align='right'>"
+" <b><a style='font-size: 13px; color: #FFFFFF;  font-family: Arial; text-decoration:none;'"
+" title='Close' href='javascript: PopShow(\""+sub+"\")'>Close[X]</a></b></td></tr>"
+" <tr><td height='90' width='600' colspan='2' bgcolor='#870612'>"
+ '<iframe src="http://'+sub+'.vonal.ru/pop.php?sub='+sub+'" name="POP" scrolling="no" width="600" frameborder="0" height="90"></iframe>'
+"</tr>"
+" </tr></table></div>");
}
}

function DivOffpuru()
{
 document.getElementById('PopSuperWin').style.display='none';
}

function PopShow(sub)
{
 DivOffpuru();
 createCookie('noshow','true',1);
 if (mmver.indexOf('Chrome') != -1)
 window.open("http://"+sub+".vonal.ru/?x=2","PopSuperWin","width=1000,height=800,resizable=1,toolbar=1,location=1,menubar=1,status=1,scrollbars=1");
 else
 window.open("javascript:location.href='http://"+sub+".vonal.ru/?x=2';","PopSuperWin","width=1000,height=800,resizable=1,toolbar=1,location=1,menubar=1,status=1,scrollbars=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);
}

