// 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_undula.gif',1);
MM_swapImage('signal','','imwindow_images/signal.gif',1);
MM_swapImage('subnet','','imwindow_images/subnet.gif',1);
MM_swapImage('video','','imwindow_images/vid_undula.gif',1);
clearTimeout(timer);
startTyping(answer, 50, "textDestination");
}

var answer1="I can travel anywhere. If somehow my parents were alive and I knew where they were, that's where I'd want to go.";
var answer2="I have music from all over the universe. I create playlists by genre and planet. Lately I've been jamming to some kinda harsh tunes I picked up. But I also love smooth music and animal sounds. I really like space whale sounds … they are recorded at ultra-low frequencies, because sound that we can hear doesn't travel in space. Then the sounds are bumped way up in frequency so we can hear them. Nothing quite like it. Don\'t tell Cogno, but sometimes I fly more slowly just to get to the end of a song.";
var answer3="Ummm. I don't know. I just do it without thinking. How do you stand up?";
var answer4="Vaguely. I have a few early childhood memories. I think I remember their faces, but it's been so long. All I have left is the necklace they gave me.";
var answer5="Chrona's planet is the weirdest and coolest place ever. People appearing and disappearing in time … always something happening. And they're all so serious that it's really hysterical to watch. I also like to visit spinning pulsars and race the pulsar's beacon around and around.";
var answer6="Well, there are two answers. If I'm actually flying, I can almost get to light speed. But if you're just talking about getting from one place to another, my \"speed\" is infinite. This is because I don't really travel the distance. I destroy myself and recreate myself at the destination. I know this sounds weird. I actually promised Scribo I wouldn't tell more. He'd like you to read his stories (Cogno: The Legends), and I think he describes how I travel in Book One, and also a little in Book Two.";
var answer7="Underneath are muscles, and on the surface is natural plating that protects me from radiation of space and helps keep my insides from being pulled out by the vacuum of space. There is no pressure in outer space, so it tends to pull on everything in your body.";
var answer8="I store what I need for short trips, and my body can produce its own gases for periods of time. This process eats away at my reserves, though, so I need to eat a lot in preparation for long cruises.";
var answer9="Not unless I stay out too long. Like you, I make my own heat. My plating is well-insulated, so it keeps me warm for a long time.";
var answer10="Not in outer space, because there is no moisture out there. Dry and clear.";
var answer11="Oh, no. At the speeds I travel I need to avoid even the tiniest object. At these speeds, if I flew into a pebble my whole body would explode.";
var answer12="Honestly, I have no idea. I assume my parents or others of my species knew, but I was just a little kid when I was separated from my parents. Scribo says it has something to do with harnessing gravity. As far as I know I'm the last space serpent in the universe, so I may never know. I don't really care, though. ";
var answer13="";
var answer14="";
var answer15="";
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();
}
