function chat_open_link()
{
	if (targetType == '_blank')
	{
		window.open(targetUrl);
	}
	else
	{
		window.location = targetUrl;
	}
}

function write_monliveshow_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 ('<a href="javascript: chat_open_link()"><img src="'+img_url+'" width="'+imgWidth+'" height="'+imgHeight+'" alt="" border="0"></a>');
  document.write('    </div>');
  document.write('  </div>');
  document.write('</div>');
  document.write('<div id="fourth_level_div" style="position:absolute; width:0px; height:0px; left:22%; top:101%; overflow:hidden;"></div>');
}

var monliveshow_dhtml_width;
var monliveshow_dhtml_height;
var monliveshow_dhtml_delay_max;
var monliveshow_dhtml_delay;
var body_height;
var body_width;
var monliveshow_dhtml_margin;
var monliveshow_dhtml_left;
var monliveshow_dhtml_top;
var shw_timeout;

function init_monliveshow_dhtml() 
{

  monliveshow_dhtml_width     = 340; 
  monliveshow_dhtml_height    = 180; 
  monliveshow_dhtml_delay_max = 120; 
  monliveshow_dhtml_delay     = monliveshow_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" ) { monliveshow_dhtml_margin = 5; } else { monliveshow_dhtml_margin = 20; }
  monliveshow_dhtml_left = body_width  - monliveshow_dhtml_width  - monliveshow_dhtml_margin;
  monliveshow_dhtml_top  = body_height - monliveshow_dhtml_height - 5;

  document.getElementById('second_level_div').style.left = monliveshow_dhtml_left + "px";
  document.getElementById('second_level_div').style.top  = monliveshow_dhtml_top  + "px";
}

function show_monliveshow_dhtml() 
{
  if ( document.getElementById('second_level_div').style.visibility == "hidden" ) 
  {
    document.getElementById('second_level_div').style.visibility = "visible";
  }

  if ( monliveshow_dhtml_delay > 0 ) 
  {
    monliveshow_dhtml_delay = monliveshow_dhtml_delay - 1;
    document.getElementById('third_level_div').style.top = monliveshow_dhtml_delay + "px";
    shw_timeout = window.setTimeout('show_monliveshow_dhtml()', 3);
  } 
  else 
  {
    window.clearTimeout(shw_timeout);
    window.setTimeout('hid_monliveshow_dhtml()', imgDisplayTime * 1000);
  }
}

function hid_monliveshow_dhtml() 
{ 
  if ( monliveshow_dhtml_delay < monliveshow_dhtml_delay_max ) 
  {
    monliveshow_dhtml_delay = monliveshow_dhtml_delay + 1;
    document.getElementById('third_level_div').style.top = monliveshow_dhtml_delay + "px";
    var hid_timeout = window.setTimeout('hid_monliveshow_dhtml()', 3);
  } 
  else 
  {
    window.clearTimeout(hid_timeout);
    document.getElementById('second_level_div').style.visibility = "hidden";
  }
}


function move_monliveshow_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_monliveshow_dhtml()', 3);
}


if (typeof yesMsgCookie == 'undefined' || document.cookie.indexOf('monliveshow_cookie=') == -1 )
{
	write_monliveshow_dhtml();
	init_monliveshow_dhtml();
	show_monliveshow_dhtml();
	move_monliveshow_dhtml();

	if (typeof yesMsgCookie != 'undefined') document.cookie = 'monliveshow_cookie=1;path=/;';
}


