var ov = false;

function GetCookiePopTrafVal (offset) {

var endstr = document.cookie.indexOf (";", offset);

if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookiePopTraf (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return GetCookiePopTrafVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}

function SetCookiePopTraf (name, value) {
var argv = SetCookiePopTraf.arguments;
var argc = SetCookiePopTraf.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

function popup_gelPOPTraf()
{
    day = new Date();

   URL = "http://7-ru.net/";


    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=600,left = 276,top = 132');");

    window.focus();
    document.getElementById('popup_divMenuPOP').style.display = 'none';
	pathname = "/";
    myDomain = "/";
    var largeExpDate = new Date ();
    largeExpDate.setTime(largeExpDate.getTime() + (24 * 60 * 60 * 1000));
    SetCookiePopTraf('glamur','1',largeExpDate, "/");
}

function banner_gel(URL)
{
    day = new Date();
    id = day.getTime();
    //eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=600,left = 276,top = 132');");
    window.focus();
    document.getElementById('popup_divMenuPOP').style.display = 'none';
	pathname = "/";
    myDomain = "/";
    var largeExpDate = new Date ();
    largeExpDate.setTime(largeExpDate.getTime() + (24 * 60 * 60 * 1000));
    SetCookiePopTraf('glamur','1',largeExpDate, "/");
}


function randomNumber(m,n) {
  m = parseInt(m);
  n = parseInt(n);
  return Math.floor( Math.random() * (n - m + 1) ) + m;
}


function GetAdultKod() {

var kody = new Array();

kody[0] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';
kody[1] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';
kody[2] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';
kody[3] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';
kody[4] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';
kody[5] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';
kody[5] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';
kody[5] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';
kody[5] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';
kody[5] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';
kody[5] = '<a target="_blank" href="http://7-ru.net/"><img border="0" src="http://xxxclip.ru/odnotc.jpg" width="600" height="90"></a>';

var rand = randomNumber(0, 5);

return kody[rand];
}




glamur = GetCookiePopTraf('glamur');

if (glamur == null){

var temat = "adult";

	if(temat == "noadult") {
	var kod = GetnoAdultKod();
	}
	else {
	var kod = GetAdultKod();
	}

document.write('<div style="position: absolute; top:40%; left:50%; margin-left:-200px; visibility:hidden;" id="popup_divMenuPOP"><table border="0" width="600" cellspacing="0" cellpadding="0"><tr><td bgcolor="#0780fe" style="padding-left: 10px"><table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td><b><a target="_blank" style="font-size: 11px; color: #FFFFFF; line-height:20px;  font-family: Arial; text-decoration:none;" href="http://adultphoto.ru">Фото для взрослых</a></td><td bgcolor="#0780fe" width="33" style="padding-right: 2px" align="right" ><a style="font-size: 11px; color: #FFFFFF; font-family: Arial; text-decoration:none;" href="javascript://" onclick="popup_gelPOPTraf();"><b>Закрыть!</b></a></td></tr></table></td></tr><tr><td bgcolor="#eeeeee" style="padding: 1 1 1 1px;">' + kod + '</td></tr></table></div>');

document.getElementById('popup_divMenuPOP').style.visibility='visible';

if (document.getElementById('popup_divMenuPOP').style)
window.setInterval("MovePopupWinPOP()", 10);
window.onerror=null;
document.body.scrollTop=10;


function MovePopupWinPOP() {
if (document.body.scrollTop==0)
document.getElementById('popup_divMenuPOP').style.top=document.documentElement.scrollTop+250; else
document.getElementById('popup_divMenuPOP').style.top=document.body.scrollTop+250;
}
}

