
var ns_oio = document.layers||navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
var ns6_oio = (!document.all && document.getElementById) ? true : false;
if (ns6_oio) document.write('<div style="position:relative;z-index:1;">');

var step=3;
win_width=350;
win_height=150;
var win_left= 200;
var win_top=140;
var message_oio=
   '<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" height=100%>'+
   '<tr><td bgcolor=yellow align=center valign=middle height=100%><table width=100% cellspacing="1" cellpadding="1" bordercolor="#883234" style="border-collapse: collapse"><tr><td colspan="2" bgcolor="#06356C" align="center"><p style="margin-top: 5px; margin-bottom: 5px"><b><font face="Arial" color="#FFFFFF">Дорогие Друзья. </font></b></p><p style="margin-top: 5px; margin-bottom: 5px"><b><a target="_blank" href="http://www.gennadij.pavlenko.name/Obuchen/WorkScript.php" title="Подписка на беспланые ознакомительные он-лайн курсы"><font face="Arial" color="#FFFFFF">Чтобы подписаться на бесплатные он-лайн курсы &quot;Школы Управления Судьбой&quot;, нажмите на этот текст</font></b></a><b><font color="#FFFFFF" face="Arial">&nbsp;или <a href="http://www.sydba.ru" target=_blank title="Школа Управления Судьбой">посетите сайт www.sydba.ru</a></font></b></p></td></tr><tr><td colspan="2" bgcolor="#97C6FD" align="center"><p style="margin-top: 3px; margin-bottom: 3px"><a href="http://www.sydba.ru" target=_blank title="Школа Управления Судьбой"><b><font face="Arial" color="#053F6C">Просто так в жизни ничего не происходит, значит, вы здесь не случайно...</font></b></a><br></p></td></tr></table></td></tr></table>';

var drag_oio=false,x_oio,y_oio,a_oio,b_oio;

function move(e) {
  if (drag_oio) {
    left_oio=ns6_oio ? a_oio+e.clientX-x_oio : a_oio+event.clientX-x_oio;
    optinover.style.left=left_oio;
    top_oio=ns6_oio? b_oio+e.clientY-y_oio: b_oio+event.clientY-y_oio-document.body.scrollTop;
    optinover.style.top=top_oio+(ns6_oio? 0 : document.body.scrollTop);
    shadow.style.left=left_oio+1;
    shadow.style.top=top_oio+(ns6_oio? 0 : document.body.scrollTop)+1;
    return false;
  }
}

function drags_oio(e) {
  if (!document.all&&!ns6_oio) return;
  var obj_oio=ns6_oio ? e.target : event.srcElement;
  var topelement=ns6_oio ? "HTML" : "BODY";
  while (obj_oio.tagName!=topelement&&obj_oio.className!="draggable_oio") { obj_oio=ns6_oio ? obj_oio.parentNode : obj_oio.parentElement; }
  if (obj_oio.className=="draggable_oio") {
   drag_oio=true;
   a_oio=parseInt(optinover.style.left+0);
   b_oio=parseInt(optinover.style.top+0);
   x_oio=ns6_oio ? e.clientX : event.clientX;
   y_oio=ns6_oio ? e.clientY : event.clientY;
   document.onmousemove=move;
   return false;
  }
}

if (!ns_oio) document.onmousedown=drags_oio;
if (!ns_oio) document.onmouseup=new Function("drag_oio=false");

function create_oio() {
  d_oio = document;
  if (ns6_oio) d_oio.write('</div>');
  d_oio.write(
    '<div id="shadow" class="draggable_oio" style="position:absolute; visibility:hidden; background-color:lightgrey; z-index:'+(ns6_oio?'0':0)+';"></div>'+
    '<div id="optinover" class="draggable_oio" style="border-style:outset; border-width:1; visibility:hidden; position:absolute; z-index:100; background-color:lightgrey; width:'+win_width+'">'+
    '<table id=optinoverTable height=97% width=100% align=left valign=top cellpadding=0 cellspacing=0 border=0 bgcolor=white '+
      'style="cursor:move; background-color:white; border-style:solid; border-width:2; border-color:000099;">'+
    '<tr><td width=100% bgcolor=000099 height=26><font color=white face=Arial,verdana style="font-size:13px"><b> Подписка на бесплатные части он-лайн курсов Геннадия Павленко</b></font></td>'+
          '<td bgcolor=000099 align=center>'+
          '<table width=20 cellspacing=0 cellpadding=0 align=center bgcolor=000099 bordercolor=000099 '+
            'style="border-collapse:collapse; border-style:outset; border-width:1; border-color:white">'+
          '<tr><td><a onclick="hide_oio();" onmouseover="this.style.cursor=\'default\';this.style.background=\'#FF7359\'" '+
            ' onmouseout="this.style.cursor=\'default\';this.style.background=\'#E76741\'" '+
            ' style="background:#E76741; border:0; color:white; font-family:arial,system,verdana; margin-left:0px; padding-left:4px; padding-right:'+
            (ns6_oio?'3':'4')+'px;padding-top:'+(ns6_oio?'0':'3')+'px;'+(ns6_oio?'padding-bottom:1px;':'')+
            'text-decoration:none;font-size:16px;left-indent:0px;"><b>X</b></a></td></tr>'+
          '</table></td></tr>'+
    '<tr><td valign=top colspan=2 bgcolor=white>'+
         '<table height=100% width=100% cellpadding=0 border=0 style="cursor:default;">'+
         '<tr><td>'+
               '<table cellpadding=0 border=0 width=100% style="cursor:default;">'+
               '<tr height='+win_height+'><td height='+win_height+' valign=top>'+message_oio+'</td></tr>'+
               '</table></td></tr>'+
          '</table></td></tr>'+
    '</table></div>');
}

create_oio();
var id_oio,d_oio,optinover,shadow,height_oio,left_oio,top_oio;
function var_oio() {
  id_oio = "optinover";
  d_oio = document;
  optinover = d_oio.getElementById ? d_oio.getElementById(id_oio) : d_oio.all[id_oio];
  shadow = d_oio.getElementById ? d_oio.getElementById("shadow") : d_oio.all["shadow"];
  b=(typeof( window.innerWidth ) == 'number') ? window.innerWidth : (document.documentElement &&document.documentElement.clientWidth ? document.documentElement.clientWidth : (document.body&&document.body.clientWidth ? document.body.clientWidth : 800));
  if (win_left<0) left_oio=(b/2)-(400/2)+30; else left_oio=win_left;
  top_oio=win_top;
}

if (!ns_oio) { var_oio(); repos_oio(); }
function repos_oio() {
  if (ns6_oio) { optinover.style.top = top_oio+window.pageYOffset;
  shadow.style.top = top_oio+window.pageYOffset+1;
  optinover.style.height=document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height");
  shadow.style.height=document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height");
  shadow.style.width = document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("width");
 } else {
  optinover.style.top = top_oio+d_oio.body.scrollTop;
  shadow.style.height=optinover.offsetHeight;
  shadow.style.top = (top_oio*1+1*1)+d_oio.body.scrollTop;
  shadow.style.width = optinover.style.width;
 }
  optinover.style.left = left_oio;
  shadow.style.left = left_oio+1;
}

function hide_oio() {
  if (optinover.style.left.substring(0,optinover.style.left.length-2)<screen.width&&!ns6_oio) {
    optinover.style.left=optinover.style.left.substring(0,optinover.style.left.length-2)*1+step;
    shadow.style.left=shadow.style.left.substring(0,shadow.style.left.length-2)*1+step;
    setTimeout("hide_oio()",10);
  } else {
    optinover.style.visibility='hidden';
    shadow.style.visibility='hidden';
    window.scrollBy(0,1);
    if (!ns6_oio) setTimeout('window.document.body.onscroll=null;',2000);
    optinover.style.left=0;
  }
}

function show_ns_oio() {
  message_oios = message_oio.split("<P><UL>");
  message_oio=message_oios[0];
  for (i=1;i<message_oios.length;i++) {message_oio+="\n"+message_oios[i];}
  message_oios = message_oio.split("<P>");
  message_oio=message_oios[0];
  for (i=1;i<message_oios.length;i++) { message_oio+="\n\n"+message_oios[i];}
  message_oios = message_oio.split("<BR>");
  message_oio=message_oios[0];
  for (i=1;i<message_oios.length;i++) {message_oio+="\n"+message_oios[i];}
  message_oios = message_oio.split("<LI>");
  message_oio=message_oios[0];
  for (i=1;i<message_oios.length;i++) {message_oio+="\n* "+message_oios[i];}
  message_oios = message_oio.split("<");
  message_oio=message_oios[0];
  for (i=1;i<message_oios.length;i++) {
    temp_oios = message_oios[i].split(">");
    temp_oio="";
    if (temp_oios.length>1) { temp_oio=temp_oios[1]; } else { temp_oio=message_oios[i]; }
    message_oio+=temp_oio;
  }
  if (confirm(message_oio)) {}
}
var temp_top_oio;

function show_oio() {
  if (ns_oio) {show_ns_oio();}
  else {
    temp_top_oio = (ns6_oio ? window.pageYOffset : d_oio.body.scrollTop)-(ns6_oio ? document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height").substring(0,document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height").length-2) : optinover.offsetHeight)-1;
    optinover.style.top=temp_top_oio;
    if (ns6_oio) { shadow.style.top=0; } else {shadow.style.top=0-optinover.offsetHeight;}
    optinover.style.visibility='visible';
    shadow.style.visibility='visible';
    move_oio();
    if (!ns6_oio) {window.document.body.onscroll=repos_oio;}
  }
}

function move_oio() {
  if (optinover.style.top.substring(0,optinover.style.top.length-2)<140+(ns6_oio ? window.pageYOffset : d_oio.body.scrollTop)) {
    temp_top_oio+=step;
    optinover.style.top = temp_top_oio;
    shadow.style.top = temp_top_oio+step;
    setTimeout("move_oio()",10);
  }
}

function go() { setTimeout("show_oio()",1000); }
