function checkplugin() {
  var result = false;
  
  //document.writeln('chekplugin()');

  if (netie(-1,5)) return IE5_checkplugin('IPIX.ipxfiles.1');
  if (netie(-1,4)) return IE4_checkplugin('IPIX.ipxfiles.1');
  if (netie(4,-1)) return NN_checkplugin('application/x-ipix');
  return false;
}

function netie(net, ie) {
var appVersion = navigator.appVersion;
var xmsie = appVersion.indexOf('MSIE');
//document.writeln('AV:'+appVersion+' x:'+xmsie);
if (xmsie >= 0) appVersion = appVersion.substring(xmsie+5,xmsie+8);
else appVersion = appVersion.substring(0,3);
//document.writeln('AV2:'+appVersion);
if ((appVersion >= net && navigator.appName == 'Netscape' && net != -1) || 
    (appVersion >= ie && navigator.appName.substring(0,9) == 'Microsoft' && ie != -1)) 
    return true; 
else return false; 
}

function NN_checkplugin(mimet) {
  //document.writeln('NN_checkplugin('+mimet+')<BR>');
  var m = navigator.mimeTypes[mimet];
  if (!m) return false;
  var p = m.enabledPlugin;
  if (!p) return false;
  //document.writeln(m.type+":ENABLED BY:"+p.name+"<BR>");
  return true;
}

function IE4_checkplugin(servername) {
  //document.writeln('IE4_checkplugin('+servername+')<BR>');
  var o = null;
  eval ('o = new ActiveXObject(servername);');
  if (!o) return false;
  //document.writeln('Found:'+servername+'<BR>');
  return true;
}

function IE5_checkplugin(servername) {
  //document.writeln('IE5_checkplugin('+servername+')<BR>');
  var o = null;
  eval('try { o = new ActiveXObject(servername) } catch (Exception) {};');
  if (!o) return false;
  //document.writeln('Found:'+servername+'<BR>');
  return true;
}


