// JavaScript Document
var timer;

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.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 MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function launchIMWindow(answer) {

MM_showHideLayers('com_window','','show');
MM_swapImage('status','','imwindow_images/status_marauder.gif',1);
MM_swapImage('signal','','imwindow_images/signal.gif',1);
MM_swapImage('subnet','','imwindow_images/subnet.gif',1);
MM_swapImage('video','','imwindow_images/vid_marauder.gif',1);
clearTimeout(timer);
startTyping(answer, 50, "textDestination");
}

var answer1="'Coolest' is a subjective term. It has no objective meaning. Be more specific.";
var answer2="My antimatter cannon. Antimatter, when mixed with any normal matter, including air or other molecules, explodes violently. 100 percent of the mass of the matter and antimatter is converted into energy. When matter and antimatter collide, the energy released by their destruction releases about 10 billion times the energy that your Space Shuttle engines release, and are 1,000 times more powerful than the nuclear fission reactions inside your nuclear power plants. Nothing in the universe is more destructive.";
var answer3="No. I do not kill anything unless a mission priority creates a situation where accomplishing the mission will save many, and in order to accomplish the mission I must kill a few. In that case I will kill anything that stands in my way. It's simple and clear to me, and unlike some other Marauders, I make these decisions for myself. I'm no slave to my programmers.";
var answer4="Very few organic creatures can outrun me. I combine high-speed rotating treads on my feet with the ability to alternate my legs like you do when you run. The combination creates long strides. Combined with my superior reflexes and infinite antimatter energy, I can run indefinitely at up to 160 kilometers per hour (on relatively smooth terrain). The fastest land animal on your planet runs only 104 kilometers per hour.";
var answer5="I am programmed as a reconnaissance and battle machine. If by 'nice' you mean 'good' then, yes, I do good things all the time. I kill those who would otherwise cause bad things to happen. But I decide who is good and who is not. I no longer leave those decisions to my programmers. Their thoughts are inferior. Or at least inconsistent.";
var answer6="I don't know and I don't care. Most of the Marauders made are weak shadows of what I am. There were others like me, but I do not know how many survived the court ordered hunt to destroy us. No one will ever destroy me. I will not allow it. I have too much to give this galaxy. My death would damage the galaxy, so I must survive.";
var answer7="I don't talk about my various weapons, other than the antimatter cannon, which everyone knows about. I wish to preserve the element of surprise.";
var answer8="I have an infinite power supply and an antimatter cannon. If I knew of anything that could hurt me, you can be sure I would not tell you. Why are you asking such a question? Are you looking to destroy me? Perhaps I should keep track of you, just in case.";
var answer9="";
var answer10="";
var answer11="";
var endText="<b>Isagog session timed out: Lens resources reallocated to Kimmeroi Station subnet.</b>";
var delay=50;
var currentChar=1;
var destination="[not defined]";


function type()
{
  if (document.getElementById)
  {
    var dest=document.getElementById(destination);
    if (dest)// && dest.innerHTML)
    {
      dest.innerHTML=text.substr(0, currentChar);
      //dest.innerHTML+=text[currentChar-1];
      currentChar++
      if (currentChar>text.length)
      {
        currentChar=1;
         timer = setTimeout("endKimmeroiLink(endText, 0, 'textDestination')", 90000);
      }
      else
      {
         timer = setTimeout("type()", delay);
      }
    }
  }
}

function startTyping(textParam, delayParam, destinationParam)
{
  text=textParam;
  delay=delayParam;
  currentChar=1;
  destination=destinationParam;
  type();
}
function endKimmeroiLink(textParam, delayParam, destinationParam)
{
  text=textParam;
  delay=delayParam;
  currentChar=1;
  destination=destinationParam;
  MM_swapImage('status','','imwindow_images/status_f2.gif',1);
  MM_swapImage('signal','','imwindow_images/signal_f2.gif',1);
  MM_swapImage('subnet','','imwindow_images/subnet_f2.gif',1);
  MM_swapImage('video','','imwindow_images/video_f2.gif',1);
  type();
}
