// popup windows for photos
// By Brenda C. Mondragon for TerraFirmA, 1998

function popUp(num) {

// the photo's file name (in this directory, case sensitive!)
pic = new Array();
pic[0]  = "meet/photos/dorset4.jpg";
pic[1]  = "meet/photos/zcb.jpg";
pic[2]  = "meet/photos/cryobab1.jpg";
pic[3]  = "meet/photos/ithreeB.jpg";
pic[4]  = "meet/photos/group.jpg";
pic[5]  = "meet/photos/diosbaby.jpg";
pic[6]  = "meet/photos/tyjm97.jpg";
pic[7]  = "meet/photos/muggbaby.jpg";
pic[8]  = "meet/photos/lucbabpor.jpg";
pic[9]  = "meet/photos/reading_rhe.jpg";
pic[10] = "meet/photos/reading_ftc.jpg";
pic[11] = "meet/photos/muggbaby2.jpg";
pic[12] = "meet/photos/lucbab.jpg";
pic[13] = "meet/photos/blvm.jpg";
pic[14] = "meet/photos/bnb.jpg";
pic[15] = "meet/photos/mbbm.jpg";
pic[16] = "meet/photos/clock.jpg";

// height corresponding to correct photo above + add 10 for "room"
ht  = new Array();
ht[0]   = "498";
ht[1]   = "210";
ht[2]   = "587";
ht[3]   = "470";
ht[4]   = "315";
ht[5]   = "210";
ht[6]   = "260";
ht[7]   = "269";
ht[8]   = "296";
ht[9]   = "390";
ht[10]  = "307";
ht[11]  = "307";
ht[12]  = "410";
ht[13]  = "358";
ht[14]  = "321";
ht[15]  = "413";
ht[16]  = "560";

// width corresponding to correct photo above + add 10 for "room"
wt = new Array();
wt[0]   = "788";
wt[1]   = "318";
wt[2]   = "376";
wt[3]   = "544";
wt[4]   = "273";
wt[5]   = "187";
wt[6]   = "310";
wt[7]   = "410";
wt[8]   = "410";
wt[9]   = "589";
wt[10]  = "524";
wt[11]  = "410";
wt[12]  = "350";
wt[13]  = "527";
wt[14]  = "502";
wt[15]  = "410";
wt[16]  = "255";

if (window.photwin) { if (!photwin.closed) { photwin.close(); }}


photwin = window.open(""+pic[num]+"", "TerraPhoto", "height="+ht[num]+",width="+wt[num]+",menubar=no,directories=no,location=no,resizable=no,scrollbars=no,toolbar=no");

} // end of function

// -->

// popup window

function launch(newURL, newName, newFeatures, orgName) {
  var simwin = open(newURL, newName, newFeatures);
  if (simwin.opener == null) {
     simwin.opener = window;
  }
  simwin.opener.name = orgName;
  return simwin;
}

function launchSim() {
  mySim = launch("simulation/start.html",
                 "Simulation",
                 "height=300,width=600,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=1,toolbar=0,z-lock=0",
                 "myWindow");
}


// -->

function stopErrors() {
 return true;
}
//window.onerror = stopErrors;
/***************************************************************************/


/***************************************************************************/
function firstFocus() {
  setTimeout('focusIt()',1000);
}
function focusIt() {
    window.onerror = stopErrors;
    if (document.forms[0].elements[0]) {
      var i;
      var max = document.forms[0].length;
  
      for( i = 0; i < max; i++ ) {
        if (document.forms[0].elements[i].type != "hidden" &&  !document.forms[0].elements[i].disabled) {
          document.forms[0].elements[i].focus();
          break;
        }
      }
    }
// body tag: onLoad="firstFocus();"
}

/***************************************************************************/
function focusNext(what,which) {
    for (var i=0;i < what.elements.length;i++) {
        if (what.elements[i].name == which) {
            what.elements[i+1].focus();
        }
    }
    return -1;
//onChange="focusNext(this.form,this.name)"
}

var DHTML = (document.getElementById || document.all || document.layers);

function getObj(name){
if (document.getElementById){
this.obj = document.getElementById(name);
this.style = document.getElementById(name).style;
}
else if (document.all){
this.obj = document.all[name];
this.style = document.all[name].style;
}
else if (document.layers){
this.obj = document.layers[name];
this.style = document.layers[name];
}
}

function togglemenu(div){
if (!DHTML) return;
var arr = div + 'img';
var y = document.getElementById(arr);
var x = new getObj(div);
if (x.style.display == 'none') {
  x.style.display='block';
  y.src='./images/darr.gif';
  y.alt='Click to collapse nested items';
} else {
 x.style.display='none';
 y.src='./images/rarr.gif';
 y.alt='Click to expand nested items';
}
}