function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}


function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function loading()
{
   var tag = '';
   
   tag += '<div id="waiting" style="position:absolute; left:150px; top:150px; width:265px; height:305px; z-index:25; visibility: visible">';
   tag += '<img src="loading.jpg">';
   tag += '</div>';

   return tag;
}

function troubleshoot()
{
   var tag = '';

   tag += '<center>';
   tag += '		<table><tr><td>';
   tag += '		<iframe height="' + window.screen.height * 0.878 + '" width="' + window.screen.width * 0.988 + '" FRAMEBORDER=0 SCROLLING=yes ID=IFrame1 src="troubleshoot.htm"></iframe>';
   tag += '		</td></tr></table>';
   tag += '</center>';

   return tag;
}

function loadhtml(obj1)
{
   var tag;

   tag = loading();

   if (obj1.netscape)
   {
      tag += '<embed type="application/x-eskerplus"';
   }
   else
   {
      tag += '<object';
   }
   if (obj1 ["id"])
   {
      tag += '\nid="' + obj1.id + '"';
   }
   else if (obj1 ["name"])
   {
      tag += '\nid="' + obj1.name + '"';
   }
   if (obj1 ["classid"])
   {
      tag += '\nclassid="' + obj1.classid + '"';
   }
   if (obj1 ["codebase"])
   {
      if (obj1.netscape)
      {
         if (obj1 ["deployer"])
         {
            obj1.codebase = obj1.deployer;
         }
         
         else
         {
            var extension = obj1.codebase.indexOf (".cab");
            
            if (extension >= 0)
            {
               
               su = new netscape.softupdate.SoftwareUpdate();
               
               PIFolder = su.GetFolder("Plugins");
               
               obj1.codebase = "file:///" + PIFolder + obj1.codebase.substring (0, extension) + ".dpl" + obj1.codebase.substring (extension + 4, obj1.codebase.length);
            }
         }
      }           
      tag += '\ncodebase="' + obj1.codebase + '"';
   }
   if (obj1.width == null || obj1.width == 0 || obj1.width == "0")
   {
      obj1.width = 2;
   }
   tag += '\nwidth="' + obj1.width + '"';
   if (obj1.height == null || obj1.height == 0 || obj1.height == "0")
   {
      obj1.height = 2;
   }
   tag += '\nheight="' + obj1.height + '"';
   if (!obj1.netscape)
   {
      tag += '>';
   }
   
   if (obj1.netscape)
   {
      tag += ' hspace=0 vspace=0>';
   }
   else
   {
      tag += troubleshoot();
   }

   return tag;
}

function init()
{
   MM_showHideLayers('waiting', '', 'hide');
   if ((window.navigator.appName == "Netscape"))
   {
      if ( window["PAMain"] )
      {
         AddShortcut();
         AddServers();
         AddContentFilteredSafes();
      }
      else
      {
         setTimeout ("init()", 100);
      }
   }
   else
   {
		if (window["PAMain"])
		{
         AddShortcut();
         AddServers();
         AddContentFilteredSafes();
      }
   }
}


function writeHtml(tag)
{
   document.write(tag);
}
