// parasite.js: detect and warn about infestations of IE parasites
// release 1.2, 13-Nov-2001
// written by Andrew Clover <and@doxdesk.com>, use freely
// parasite_list: currently known parasites. Entries are in the form
// {name, guid, can, may}. 'can' contains a string of known problems
// with the parasite and 'may' suspected ones.
var parasite_list= new Array(
  new Array('TopText', '3D7247E8-5DB8-11D4-8A72-0050DA2EE1BE', 'A', 'P'),
  new Array('VX2', '00000000-5EB9-11D5-9D45-009027C14662', 'AP', ''),
  new Array('FlashTrack', '665ACD90-4541-4836-9FE4-062386BB8F05', 'AP', ''),
  new Array('SaveNow', 'FEE7FD53-3356-4D4D-8978-2C4AE3A7E109', 'AE', 'PS'),
  new Array('webHancer', 'C900B400-CDFE-11D3-976A-00E02913A9E0', 'P', 'S'),
  new Array('Onflow', '0CEF79D8-D373-11D3-A7D3-00062962BF17', 'A', ''),
  new Array('CometCursor', '0922EC1A-9EC7-11D3-80B9-00500487BDBA', 'AP', '')
);
// parasite_url: a directory containing <parasite name>.html files with
// more information and removal instructions. Change this if you want to
// provide your own information.
var parasite_url= 'http://and.doxdesk.com/parasite/';
// text generated by the script. Change this for different languages or
// to customise the output for your site, etc.
var parasite_warn= 'Warning!';
var parasite_infest1= 'Your browser appears to have the "';
var parasite_infest2= '" parasite installed';
var parasite_prob1= '. This software ';
var parasite_can= 'can ';
var parasite_may= 'may ';
var parasite_and= ' and ';
var parasite_infestps= '. It might have been installed without your '+
                       'consent when you downloaded some other software. ';
var parasite_info= 'Information and removal instructions.';
var parasite_prob= new Array();
parasite_prob['A']= 'present you with unwanted advertising';
parasite_prob['P']= 'violate your privacy on-line';
parasite_prob['S']= 'compromise your computer\'s security';
parasite_prob['E']= 'cause stability problems and errors';
// END of user-serviceable parts
function parasite_write() {
  var i; var p;
  document.writeln('<div id="parasite" style="display: none;">');
  for (i= 0; i<parasite_list.length; i++) {
    p= parasite_list[i];
    document.writeln(
      '<object classid="clsid:'+p[1]+'" codebase="view-source:about:blank">'+
        '<img src="about:blank" id="parasite-'+p[0]+'">'+
      '</object>'
    );
  }
  document.writeln('</div>');
  window.setTimeout(parasite_check, 1000);
}
function parasite_check() {
  var i; var p; var h;
  var infestations= new Array();
  var cans= new Array(); var mays= new Array();
  for (i= 0; i<parasite_list.length; i++) {
    p= parasite_list[i];
    if (!(document.images['parasite-'+p[0]]))
      infestations[infestations.length]= p;
  }
  if (infestations.length==0) return;
  h= '<p><strong>'+parasite_warn+'</strong></p>';
  for (i= 0; i<infestations.length; i++) {
    p= infestations[i];
    h= h+'<p>'+parasite_infest1+p[0]+parasite_infest2;
    if (p[2]!='' || p[3]!='')
      h= h+parasite_prob1;
    if (p[2]!='')
      h= h+parasite_can+parasite_probs(p[2]);
    if (p[2]!='' && p[3]!='')
      h= h+','+parasite_and;
    if (p[3]!='')
      h= h+parasite_may+parasite_probs(p[3]);
    h= h+parasite_infestps;
    h= h+'<a href="'+parasite_url+p[0]+'.html">'+parasite_info+'</a></p>';
  }
  document.all['parasite'].innerHTML= h;
  document.all['parasite'].style.display= 'block';
}
function parasite_probs(s) {
  var i; var r= '';
  for (i= 0; i<s.length; i++) {
    r= r+parasite_prob[s.charAt(i)];
    if (i==s.length-2) r= r+parasite_and;
    if (i<s.length-2)  r= r+', ';
  }
  return r;
}
if (window.clientInformation)
  if (window.clientInformation.platform=='Win32')
    parasite_write();

