function write_nvspopup_dhtml() 
{
  document.write('<div id="top_level_div" style="position:absolute; width:0px; height:0px; top:0px; left:0px; z-index:248;">');
  document.write('  <div id="second_level_div" style="position:absolute; width:339px; height:176px; overflow:hidden; z-index:249;">');
  document.write('    <div id="third_level_div" style="position:absolute; width:339px; height:176px; left:0px; z-index:250;">');
  document.write (nvs_content);
  document.write('    </div>');
  document.write('  </div>');
  document.write('</div>');
  document.write('<div id="fourth_level_div" style="position:absolute; width:0px; height:0px; left:100%; top:100%; overflow:hidden;"></div>');
}

var nvspopup_dhtml_width;
var nvspopup_dhtml_height;
var nvspopup_dhtml_delay_max;
var nvspopup_dhtml_delay;
var body_height;
var body_width;
var nvspopup_dhtml_margin;
var nvspopup_dhtml_left;
var nvspopup_dhtml_top;
var shw_timeout;

function init_nvspopup_dhtml() 
{

  nvspopup_dhtml_width     = 342; 
  nvspopup_dhtml_height    = 197; 
  nvspopup_dhtml_delay_max = 120; 
  nvspopup_dhtml_delay     = nvspopup_dhtml_delay_max;

  if ( window.outerHeight ) 
  {
    body_height = window.outerHeight;
    body_width  = window.outerWidth;
  } else 
  {
    body_height = document.body.clientHeight;
    body_width  = document.body.clientWidth;
  }

  if ( document.body.clientHeight ) 
  {
    if ( document.body.clientWidth  < body_width  ) { body_width  = document.body.clientWidth;  }
    if ( document.body.clientHeight < body_height ) { body_height = document.body.clientHeight; }
  }

  if ( document.getElementById('fourth_level_div').offsetTop ) 
  {
   if ( document.getElementById('fourth_level_div').offsetTop > 0 && document.getElementById('fourth_level_div').offsetTop < 2000 ) 
   {
      body_height = document.getElementById('fourth_level_div').offsetTop;
      body_width  = document.getElementById('fourth_level_div').offsetLeft;
    }
  }

  if ( navigator.appName == "Microsoft Internet Explorer" ) { nvspopup_dhtml_margin = 5; } else { nvspopup_dhtml_margin = 20; }
  nvspopup_dhtml_left = body_width  - nvspopup_dhtml_width  - nvspopup_dhtml_margin;
  nvspopup_dhtml_top  = body_height - nvspopup_dhtml_height - 5;

  document.getElementById('second_level_div').style.left = nvspopup_dhtml_left + "px";
  document.getElementById('second_level_div').style.top  = nvspopup_dhtml_top  + "px";
}

function show_nvspopup_dhtml() 
{
  if ( document.getElementById('second_level_div').style.visibility == "hidden" ) 
  {
    document.getElementById('second_level_div').style.visibility = "visible";
  }

  if ( nvspopup_dhtml_delay > 0 ) 
  {
    nvspopup_dhtml_delay = nvspopup_dhtml_delay - 1;
    document.getElementById('third_level_div').style.top = nvspopup_dhtml_delay + "px";
    shw_timeout = window.setTimeout('show_nvspopup_dhtml()', 3);
  } 
  else 
  {
    window.clearTimeout(shw_timeout);
    window.setTimeout('hid_nvspopup_dhtml()', imgDisplayTime * 1000);
  }
}

function hid_nvspopup_dhtml() 
{ 
  if ( nvspopup_dhtml_delay < nvspopup_dhtml_delay_max ) 
  {
    nvspopup_dhtml_delay = nvspopup_dhtml_delay + 1;
    document.getElementById('third_level_div').style.top = nvspopup_dhtml_delay + "px";
    var hid_timeout = window.setTimeout('hid_nvspopup_dhtml()', 3);
  } 
  else 
  {
    window.clearTimeout(hid_timeout);
    document.getElementById('second_level_div').style.visibility = "hidden";
  }
}


function move_nvspopup_dhtml() 
{
  var bdy_st = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
  document.getElementById("top_level_div").style.left = document.body.scrollLeft + "px";
  document.getElementById("top_level_div").style.top  = bdy_st + "px";
  var mov_timeout = window.setTimeout('move_nvspopup_dhtml()', 3);
}


if (typeof nvsMsgCookie == 'undefined' || document.cookie.indexOf('nvspopup_cookie=') == -1 )
{
	write_nvspopup_dhtml();
	init_nvspopup_dhtml();
	show_nvspopup_dhtml();
	move_nvspopup_dhtml();

	if (typeof nvsMsgCookie != 'undefined') document.cookie = 'nvspopup_cookie=1;path=/;';
}