(function() {

  document.write('<style type="text/css">#fireflyBarArea a:visited, #fireflyBarArea a:active, #fireflyBarArea a:link { color: #527CCE; text-decoration: none; }#fireflyBarArea a:hover, #fireflyBarArea a:visited:hover { color: #ff9933; text-decoration: none;}</style><div id="fireflyBar" style="position:fixed;bottom:0px;right:0px;text-align:right;z-index:99998;"><table border="0" cellpadding="0" cellspacing="0" height="20" style="line-height:0px;padding:0px;margin:0px"><tr style="padding:0px;margin:0px"><td valign="top" style="padding:0px;margin:0px"><img src="http://static.onfirefly.com/web/barLeft.gif" width="3" height="20" style="padding:0px;margin:0px;border:0;"></td><td id="fireflyBarArea" style="height:20px;background:url(http://static.onfirefly.com/web/barMid.gif) top left repeat-x;font-family: Arial, sans-serif;font-size:10px;color:#666666;vertical-align:middle;line-height:10px;letter-spacing:0px;text-transform:none;">&nbsp;<div id="fireflyPeopleOn" style="font-weight:bold;display:inline">...</div>&nbsp;Here, <div id="fireflyInFirefly" style="font-weight:bold;display:inline">...</div>&nbsp;Chatting <img src="http://static.onfirefly.com/web/barBar.gif" width="2" height="10" style="margin:0px;padding:0px;border:0;vertical-align:bottom;padding-left:3px;padding-right:3px;"> <a href="javascript:void(0)" onClick="FIREFLY.open_firefly()">Start Chatting</a> <img src="http://static.onfirefly.com/web/barBar.gif" width="2" height="10" style="padding:0px;margin:0px;border:0;vertical-align:bottom;padding-left:3px;padding-right:3px;"> <a href="javascript:void(0)" onClick="document.getElementById(\'fireflyBar\').style.display=\'none\';">Close</a>&nbsp; </td><td valign="top" style="padding:0px;margin:0px"><img src="http://static.onfirefly.com/web/barRight.gif" width="3" height="20" style="padding:0px;margin:0px;border:0"></td><td width="12" style="font-size:10px">&nbsp;</td></tr></table></div>');

  var agt = navigator.userAgent.toLowerCase();
  var FIREFLYbarUserFunc = undefined;
  var cmode = document.compatMode;

  if (agt.indexOf("msie") != -1 && (cmode == undefined || cmode != "CSS1Compat" || agt.indexOf("msie 7") == -1))
  {
    if (window.onscroll)
      FIREFLYbarUserFunc = window.onscroll;
    window.onscroll = function()
    {
      var top = document.documentElement.scrollTop; 
      var left = document.documentElement.scrollLeft; 

      if (top == 0 && document.body.scrollTop)
      {
	top = document.body.scrollTop;
	left = document.body.scrollLeft;
      }

      document.getElementById('fireflyBar').style.top = top + document.documentElement.clientHeight - 20;//document.getElementById('fireflyBar').offsetHeight;
      document.getElementById('fireflyBar').style.left = left + document.documentElement.clientWidth - ((agt.indexOf("msie 7")!=-1)?400:document.getElementById('fireflyBar').offsetWidth);

      if (FIREFLYbarUserFunc != undefined)
	FIREFLYbarUserFunc();
    }

    document.getElementById('fireflyBar').style.position = "absolute";
  }


 })()
