//to check for standard browser
var stdBrowser = true
function chkBv() {
stdBrowser = (document.getElementById) ? true : false
}
//==============================

//statements relevant to thesis chapters etc.
var ptr = " "
function setItem1(ptr) {
   document.getElementById(ptr).className="pointer1";
}
function setItem2(ptr) {
   document.getElementById(ptr).className="pointer2";
}

function setBtn1(ptr) {
   document.getElementById(ptr).className="btn1";
}
function setBtn2(ptr) {
   document.getElementById(ptr).className="btn2";
}

//====================================
// next re. pages with printer button
function preLoadptr(){
  //create "on" array and populate with Image objects
  onImgArray = new Array()
  onImgArray[0] = new Image(60,60)
  //set URLs for "on" images
  onImgArray[0].src = "printer2.gif"
  //create "off" array and populate with Image objects
  offImgArray = new Array()
  offImgArray[0] = new Image(60,60)
  //set URLs for "off" images
  offImgArray[0].src = "printer1.gif"
}

//===========================================
// To return to Table of Contents
function showTOC() {
  parent.left.location="thesisleft.htm";
  parent.mid.location="thesistoc.htm";
  parent.right.location="thesisright.htm";
}

//===========================================
// To switch window to show plate as full screen
var plno=0
function showPlate(plno) {
   plateHTM = "plate" + plno + ".htm";
  parent.location=plateHTM
}

//===========================================
// To show text figures in new window
var tfno=0
function showTextfig(tfno) {
var tW = screen.width
   textfigWin = "TextfigWin" + tfno;
   textfigHTM = "txtfig" + tfno + ".htm";

if (tW > 1000) {
   textfigWin = window.open(textfigHTM,textfigWin,'toolbar=0,status=0,scrollbars, resizable,top=0,left=0,width=1000,height=720');  textfigWin.focus()
}
else {
   textfigWin = window.open(textfigHTM,textfigWin,'toolbar=0,status=0,scrollbars, resizable,top=0,left=0,width=780,height=540');  textfigWin.focus()
}
}
var legno=0
var legendWin
function showLeg(legno) {
   legendWin = "LegWin" + legno;
   legendHTM = "plate" + legno + "lgnd.htm";

   legendWin=window.open(legendHTM,legendWin,
'toolbar=0,status=0,scrollbars,top0,left=0,width=400,height=250,resizable');legendWin.focus()
}
// next function relevant to all files
function setMsg(msg) {
   window.status = msg
   return true
}
//=======================================
//statements relevant to TOC, Intro, etc.

var browser = "other";
// check for 5.0 or later browsers
if (parseInt(navigator.appVersion) >= 5
   || navigator.appVersion.indexOf("MSIE 5") != -1) {
   browser="DOM";
//if navigator.appVersion.indexOf("MSIE 6") != -1) {
   browser="DOM";
} 
var chap = " "
function setChapter0(chap) {
//   if (browser=="DOM") document.getElementById(chap).className="item0";
   document.getElementById(chap).className="item0";
}
function setChapter1(chap) {
//   if (browser=="DOM") document.getElementById(chap).className="item1";
   document.getElementById(chap).className="item1";
}

function imageOn(i) {
      document.images[i].src = onImgArray[i].src
   }
function imageOff(i) {
      document.images[i].src = offImgArray[i].src
   }

function setMsg(msg) {
   window.status = msg
   return true
}

var Txtfiles=new Array(17);
Txtfiles[0]="preface.htm";
Txtfiles[1]="chapter1.htm";
Txtfiles[2]="chapter2.htm";
Txtfiles[3]="chapter3.htm";
Txtfiles[4]="chapter4.htm";
Txtfiles[5]="chapter5.htm";
Txtfiles[6]="chapter6.htm";
Txtfiles[7]="chapter7.htm";
Txtfiles[8]="chapter8.htm";
Txtfiles[9]="chapter9.htm";
Txtfiles[10]="chapter10.htm";
Txtfiles[11]="chapter11.htm";
Txtfiles[12]="chapter12.htm";
Txtfiles[13]="chapter13.htm";
Txtfiles[14]="chapter14.htm";
Txtfiles[15]="chapter15.htm";
Txtfiles[16]="chapter16.htm";
Txtfiles[17]="biblio.htm";
var Txtno=0;
var Rtfiles=new Array(17);
Rtfiles[0]="rtpreface.htm";
Rtfiles[1]="rtchapter1.htm";
Rtfiles[2]="rtchapter2.htm";
Rtfiles[3]="rtchapter3.htm";
Rtfiles[4]="rtchapter4.htm";
Rtfiles[5]="rtchapter5.htm";
Rtfiles[6]="rtchapter6.htm";
Rtfiles[7]="rtchapter7.htm";
Rtfiles[8]="rtchapter8.htm";
Rtfiles[9]="rtchapter9.htm";
Rtfiles[10]="rtchapter10.htm";
Rtfiles[11]="rtchapter11.htm";
Rtfiles[12]="rtchapter12.htm";
Rtfiles[13]="rtchapter13.htm";
Rtfiles[14]="rtchapter14.htm";
Rtfiles[15]="rtchapter15.htm";
Rtfiles[16]="rtchapter16.htm";
Rtfiles[17]="rtpreface.htm";
var Rtno=0;

function showTxt(Txtno) {
  parent.left.location="thesisbgleft.htm";
  parent.mid.location=Txtfiles[Txtno];
  parent.right.location=Rtfiles[Txtno];
}

var Lfiles=new Array(17);
Lfiles[0]="thesistocleft0.htm";
Lfiles[1]="thesistocleft1.htm";
Lfiles[2]="thesistocleft2.htm";
Lfiles[3]="thesistocleft3.htm";
Lfiles[4]="thesistocleft4.htm";
Lfiles[5]="thesistocleft5.htm";
Lfiles[6]="thesistocleft6.htm";
Lfiles[7]="thesistocleft7.htm";
Lfiles[8]="thesistocleft8.htm";
Lfiles[9]="thesistocleft9.htm";
Lfiles[10]="thesistocleft10.htm";
Lfiles[11]="thesistocleft11.htm";
Lfiles[12]="thesistocleft12.htm";
Lfiles[13]="thesistocleft13.htm";
Lfiles[14]="thesistocleft14.htm";
Lfiles[15]="thesistocleft15.htm";
Lfiles[16]="thesistocleft16.htm";
Lfiles[17]="thesistocleft17.htm";


var Pict=new Array(17);
Pict[0]= "frontsmall.jpg";
Pict[1]= "frontsmall.jpg";
Pict[2]= "matmeth2.jpg";
Pict[3]= "plate3small.jpg";
Pict[4]= "plate42small.jpg";
Pict[5]= "plate54small.jpg";
Pict[6]= "plate59small.jpg";
Pict[7]= "plate64small.jpg";
Pict[8]= "nopicture.gif";
Pict[9]= "nopicture.gif";
Pict[10]= "nopicture.gif";
Pict[11]= "nopicture.gif";
Pict[12]= "nopicture.gif";
Pict[13]= "nopicture.gif";
Pict[14]= "nopicture.gif";
Pict[15]= "nopicture.gif";
Pict[16]= "nopicture.gif";
Pict[17]= "frontsmall.jpg";


var Lno=0;
function showList(Lno) {
 if (Lno < 0 ) {
  parent.left.location="thesisleft.htm";
  parent.right.image0.src=Pict[0];
}
else {  
  parent.left.location=Lfiles[Lno];
  parent.right.image0.src=Pict[Lno];
 }
}
//-----------------------------------
//to link with print window or print frame
function printgo() {
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) { printit() }
else {alert("Sorry, your browser version can't do this.") }
}

//to print out a window...

/*
This script is written by Eric (Webcrawl@usa.net)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

function printit(){  
if (window.print) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box
    WebBrowser1.outerHTML = "";  
}
}

//to print out mid-frame of window...

/*
Based on the script above
*/

function printmid(){  
if (parent.mid.print) {
    parent.mid.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
}
}

//===============================================
//next function for pop-up scales on electron micrograph plates
function popUp(evt,currElem) {
Scale = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
if (document.all) {
	Scale.pixelTop = parseInt(evt.clientY)+10
	Scale.pixelLeft = Math.max(2,parseInt(evt.clientX)-125)
	}
else {
	if (stdBrowser) {
		Scale.top = parseInt(evt.pageY)+20 + "px"
		Scale.left = Math.max(2,parseInt(evt.pageX)-125) + "px"
		}
	else {
		Scale.top = parseInt(evt.pageY)+20
		Scale.left = Math.max(2,parseInt(evt.pageX)-125)
		}
}
Scale.visibility = "visible"
}

function popDown(currElem) {
Scale = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
Scale.visibility = "hidden"
}
//   and for scale bars on multi-e.m. plate
function setscale(sno) {
  document.getElementById("popUp1").innerHTML="<img SRC='scale" + mag[sno] + ".gif' height=64 width=209>"
}



