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

var answer1="We are the only ones on our planet that can move on the surface. I don't believe we have ever left our planet, have we? Hmmm? Yes, I'm getting general agreement on that from the root system. But so many questions. Why don't you relax and take a nap? It's not good to think too much.";
var answer2="Who knows? We don't spend a lot of time figuring things like that out. We are more into ideas, and meditation. This Lens messaging wears me out quickly. I need something to drink.";
var answer3="Everyone relaxes around us. I don't know why. We just are, so they can just be. It's a wonderful universe, if you just close your eyes (if you have them) and feel it.";
var answer4="Yes, but we try not to talk about our other friends. They like it that way. It helps them trust, which helps them relax.";
var answer5="Since they uproot from the ground, they are exposed to the starlight. So, they are green to increase the amount of photosynthesis. We spend a great deal of energy walking so we need the extra nourishment.";
var answer6="If by 'out loud' you mean by vibrating air, we are unable to do that. We talk to one another through our root system, and can connect with some advanced beings like Cogno, through a strange combination of meditation and telepathy.";
var answer7="We can separate, but can always plant back into the ground to feel the vibration of the root system. We are never really alone. There is great power in our system. More than you might know. Perhaps you will visit us one day for the best vacation of your life.";
var answer8="";
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();
}
