var messenger = null;
var hideAfter = 3;
var hideTimer = null;
function showCopyMsg()
{
  if (isIE)
  {
  hideMessenger();
  messenger=new jsPopupMessenger(225,140);
  messenger.show('<span style="color:#f0f;">您已经复制成功</span><br /><span style="margin-left:55px;">古人云:独乐乐不如众乐乐</span>');
  hideTimer=setTimeout('hideMessenger()',1000*hideAfter);
  }
}
function showBrowserMsg()
{
  if (!isIE)
  {
  hideMessenger();
  messenger=new jsPopupMessenger(270,150);
  messenger.show('<span style="color:#f0f;">vapee 友情提示：</span><br /><span style="display:block;margin-left:55px;">本 vapee 用 Internet Explorer 观看可获得最佳效果！</span>');
  hideTimer=setTimeout('hideMessenger()',1000*hideAfter);
  }
}


function alertDowning()
{
  hideMessenger();
  messenger=new jsPopupMessenger(260,130);
  messenger.show('正在下载，请稍后再点击按钮');
  hideTimer=setTimeout('hideMessenger()',1000*hideAfter);
}
function hideMessenger()
{
  if (hideTimer != null)
  {
    clearTimeout(hideTimer);
    hideTimer = null;
  }
  if (messenger != null)
  {
    messenger.doHide();
  }
}
function jsPopupMessenger(w,h)
{
  this.w = w;
  this.h = h;
  this.show = function(msg)
  {
  $(_mId).style.display = 'block';
  $('msgBodyTitle').innerHTML = ('<img src="/images/m1.gif" width="55" height="55" border="0" alt="" />'+msg);
  //$('msgBodyTitle').innerHTML = ('<img src="/images/m1.gif" style="width:55px;height:55px;border:0;float:left;" alt="" />'+msg);
    
  $(_mId).style.width = this.w+'px';
  $(_mId).style.height = this.h+'px';
//  alert($(_mId).innerHTML+msg);
  }
  this.doHide = function ()
  {
  if ($(_mId))
  {
    document.body.removeChild($(_mId));
  }
  }
  function $(id){return document.getElementById(id);}
//  var mDiv = null;
  var _mId = "messenger";
  if (!$(_mId))
  {
  mDiv = document.createElement('div');
  mDiv.id = _mId;
  mDiv.innerHTML = '<div style="position:absolute;z-index:9999;width:'+w+'px;height:'+h+'px;left:0;top:0;border:1px solid #9d9d9d;background-color:#fff;"><div id="msgt" style="border-top:1px solid #fff;padding:5px 0 3px 5px;color:#fff;background-color:#aaa;font-weight:bold;font-size:14px;">系统提示信息</div><p id="msgBodyTitle" style="padding:5px;margin:0;"></p><p style="text-align:center;padding:0;margin:0;"><input id="mOk" type="button" value=" 确 定 " onclick="document.body.removeChild(document.getElementById(\'messenger\'));" /></p></div><div style="background-color:#000;position:absolute;z-index:9998;top:6px;left:6px;width:'+(w+2)+'px;height:'+(h+2)+'px;filter:alpha(opacity=20);opacity:0.2"></div>';
  document.body.appendChild(mDiv);
  }
  mstyle = $(_mId).style;
  mstyle.position = "absolute";
  mstyle.fontSize = '13px';
  mstyle.width = this.w+'px';
  mstyle.height = (this.h+20)+'px';
  mstyle.zIndex = 9998;
  mstyle.display = 'block';
  mstyle.border = '0px solid #9d9d9d';
  mstyle.left = ((document.documentElement.clientWidth / 2) - ($(_mId).offsetWidth / 2))+'px';
  mstyle.top = (document.documentElement.scrollTop + (document.documentElement.clientHeight-$(_mId).offsetHeight)/2)+'px'

//  alert(document.documentElement.scrollTop+'  '+document.documentElement.clientHeight+'  '+document.documentElement.scrollLeft+'  '+document.documentElement.clientWidth);
}

