function framePrint(whichFrame){
	parent[whichFrame].focus();
	parent[whichFrame].print();
}

function bbimg(o){
	var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}

function toggle_ptable() {
	var pt, pr;
	pt = document.getElementById("ParaTable");
	if (pt) {
		if (pt.style.display == "none") {
			document.getElementById("ParaTable").style.display = "inline";
			document.getElementById("HideParaLink").style.display = "inline";
			document.getElementById("ShowParaLink").style.display = "none";		
		} else {
			document.getElementById("ParaTable").style.display = "none";
			document.getElementById("HideParaLink").style.display = "none";
			document.getElementById("ShowParaLink").style.display = "inline";				
		}
	}
	pr = document.getElementById("player1");
	if (pr) {
		pr.Play();
	}
}

function toggle_nav() {
	var h, pr;
	h = parent.fraLeft.showhidenav;
	if (h) {
		parent.document.getElementById("fraSetAll").cols = "2,*";
		document.getElementById("ShowNav").style.display = "inline";
		document.getElementById("HideNav").style.display = "none";
		parent.fraLeft.showhidenav = false;
	} else {
		parent.document.getElementById("fraSetAll").cols = "260,*";
		document.getElementById("ShowNav").style.display = "none";
		document.getElementById("HideNav").style.display = "inline";
		parent.fraLeft.showhidenav = true;		
	}
	pr = document.getElementById("player1");
	if (pr) {
		pr.Play();
	}
}

function toggle_exp() {

	var e, t, n, pr;
	
	e = parent.fraLeft.expcolnav;
	t = parent.fraLeft.tree1;
	
	if (t) {
		n = t.nodeByURL(parent.fraRight.location.href);		
		if (e) {
			document.getElementById("colall").style.display = "inline";
			document.getElementById("expall").style.display = "none";			
			parent.fraLeft.expcolnav = false;
			t.expandAll(1);

			if (n) {
				t.ensureVisible(n.index);						
				t.selectNode(n.index);	
			}		
		} else {
			document.getElementById("colall").style.display = "none";
			document.getElementById("expall").style.display = "inline";			
			parent.fraLeft.expcolnav = true;			
			t.collapseAll(1);

			if (n) {	
				t.ensureVisible(n.index);			
				t.selectNode(n.index);					
			}		
		}
	}
	
	pr = document.getElementById("player1");
	if (pr) {
		pr.Play();
	}	
}

function sync_nav() {
	var h, e;
	h = parent.fraLeft.showhidenav;
	if (h == true) {
		document.getElementById("ShowNav").style.display = "none";
		document.getElementById("HideNav").style.display = "inline";
	} else {
		document.getElementById("ShowNav").style.display = "inline";
		document.getElementById("HideNav").style.display = "none";
	}
}

function tree_prev() {
	var t, n;
	t = parent.fraLeft.tree1;
	if (t) {
		n = t.nodeByURL(parent.fraRight.location.href);
	}
		
	if (n){
		if (t.nodeByIndex(n.index - 1)) {
			parent.fraRight.location.href = t.nodeByIndex(n.index-1).getUrl();	
			t.ensureVisible(n.index-1);	
			t.selectNode(n.index-1);
		} else {
			t.ensureVisible(n.index);
			t.selectNode(n.index);			
		}
	} else {
		parent.fraRight.location.href = t.nodeByIndex(0).getUrl();		
		t.ensureVisible(0);
		t.selectNode(0);
	}
	sync_nav();
	
}

function tree_next() {
	var t, n;
	t = parent.fraLeft.tree1;
	if (t) {
		n = t.nodeByURL(parent.fraRight.location.href);
	}
	
	if (n){
		if (t.nodeByIndex(n.index + 1)) {	
			parent.fraRight.location.href=t.nodeByIndex(n.index+1).getUrl();				
			t.ensureVisible(n.index+1);		
			t.selectNode(n.index+1);
		} else {
			t.ensureVisible(n.index);
			t.selectNode(n.index);			
		}
	} else {
		parent.fraRight.location.href=t.nodeByIndex(0).getUrl();		
		t.ensureVisible(0);		
		t.selectNode(0);
	}
	sync_nav();
}

function tree_up() {
	var t, n, np;
	
	t = parent.fraLeft.tree1;
	if (t) {
		n = t.nodeByURL(parent.fraRight.location.href);	
	}

	if (n){
		np = n.getParent();
		if (np && (np.index!= -1) )  {
			parent.fraRight.location.href=t.nodeByIndex(np.index).getUrl();			
			t.ensureVisible(np.index);			
			t.selectNode(np.index);
		} else {
			t.ensureVisible(n.index);
			t.selectNode(n.index);			
		}
	}
	sync_nav();	
}

function tree_goto(nodeURL) {
	var t, n;

	t = parent.fraLeft.tree1;
	if (t) {
		n = t.nodeByURL(nodeURL);
	}
	
	if (n) {
		parent.fraRight.location.href=t.nodeByIndex(n.index).getUrl();
		t.ensureVisible(n.index);
		t.selectNode(n.index);
	}
	sync_nav();	
}

function tree_sync(nodeURL) {
	var t, n;

	t = parent.fraLeft.tree1;
	if (t) {
		n = t.nodeByURL(nodeURL);
	}	
	if (n) {
		t.ensureVisible(n.index);
		t.selectNode(n.index);
	}
	sync_nav();
}

function tree_prevcat() {
	var t, n, pn, ni;
	t = parent.fraLeft.tree1;
	if (t) {
		n = t.nodeByURL(parent.fraRight.location.href);
	}
		
	if (n){
		ni = n.index;
		do {
			ni--;
			pn = t.nodeByIndex(ni);			
			if (pn) {
				if (!pn.level) break;
			}			
 		} while ( (ni >= 0) && (pn));
		
		if (!pn || ni < 0) {
			t.selectNode(0);
			t.ensureVisible(t.nodeByIndex(ni + 1));	
			parent.fraRight.location.href = t.nodeByIndex(ni + 1).getUrl();			
		} else {			
			if (!pn.level) {
				parent.fraRight.location.href = t.nodeByIndex(pn.index).getUrl();
				t.ensureVisible(pn);	
				t.selectNode(pn.index);
			}
		}
	}
	sync_nav();	
}

function tree_nextcat() {
	var t, n, pn, ni;
	t = parent.fraLeft.tree1;
	if (t) {
		n = t.nodeByURL(parent.fraRight.location.href);
	}
		
	if (n){
		ni = n.index;			
		do {
			ni++;
			pn = t.nodeByIndex(ni);
			if (pn) {
				if (!pn.level) break;
			}			
 		} while (pn);
		
		if (pn) {
			if (!pn.level) {
				parent.fraRight.location.href = t.nodeByIndex(pn.index).getUrl();
				t.ensureVisible(pn);	
				t.selectNode(pn.index);				
			}		
		}
		
	}
	sync_nav();	
}

function gotocoverpage() {
	parent.fraLeft.location.reload();
	parent.fraRight.location.href="http://www.egr.msu.edu/igw/DL/cover.htm";
	parent.document.getElementById("fraSetAll").cols = "260,*";
}

function tree_search() {
	var t, k, i, n, nc, nf, npf;
	found = new Array(512);
	t = parent.fraLeft.tree1;
	
	k = document.treesearchform.keywords.value;
	if ((k.length == 0) || (!t)) {
		return;
	} else {
		t.collapseAll(1);
		t.selectNode(-1);
		i = 0;
		nf = 0;
		while (n = t.nodeByIndex(i)) {
			nc = n.getCaption().toLowerCase();
			if ( nc.indexOf(k.toLowerCase()) != -1 ) {
				found[i] = 1;
				nf++;
			} else {
				found[i] = 0;
			}
			i++;
		}
		if (!nf) {
			parent.fraRight.document.open();
			parent.fraRight.document.writeln('<html>');
			parent.fraRight.document.writeln('<head>');
			parent.fraRight.document.writeln('<title>IGW Visualization Library</title>');
			parent.fraRight.document.writeln('<LINK href="http://www.egr.msu.edu/igw/DL/styles.css" type=text/css rel=stylesheet>');
			parent.fraRight.document.writeln('</head>');						
			parent.fraRight.document.writeln('<body>');			
			parent.fraRight.document.writeln('<table width="100%" border="0">');
			parent.fraRight.document.writeln('<tr>');
			parent.fraRight.document.writeln('<td class="pagetitle">');
			parent.fraRight.document.writeln('<a name="pagetop">Search results: NO page in IGW library matches keyword '+ '"'+ k +'"'+'.</a>');
			parent.fraRight.document.writeln('</td>');			
			parent.fraRight.document.writeln('</tr>');		
			parent.fraRight.document.writeln('<tr ><td valign="top" class="tb"><img alt="" src="http://www.egr.msu.edu/igw/DL/images/1pix.gif" width="4" height="4"></td></tr>');				
			parent.fraRight.document.writeln('</table>');			
			parent.fraRight.document.writeln('</body>');			
			parent.fraRight.document.writeln('</html>');															
			parent.fraRight.document.close();			
		} else {
			parent.fraRight.document.open();
			parent.fraRight.document.writeln('<html>');
			parent.fraRight.document.writeln('<head>');
			parent.fraRight.document.writeln('<title>IGW Visualization Library</title>');
			parent.fraRight.document.writeln('<LINK href="http://www.egr.msu.edu/igw/DL/styles.css" type=text/css rel=stylesheet>');			
			parent.fraRight.document.writeln('</head>');						
			parent.fraRight.document.writeln('<body>');			
			parent.fraRight.document.writeln('<table width="100%" border="0">');
			parent.fraRight.document.writeln('<tr>');
			parent.fraRight.document.writeln('<td colspan="3" class="pagetitle">');
			if (nf == 1) {
				parent.fraRight.document.writeln('<a name="pagetop">Search results: '+ nf +' page in IGW library matches keyword '+ '"'+ k +'"'+'.</a>');				
			} else {
				parent.fraRight.document.writeln('<a name="pagetop">Search results: '+ nf +' pages in IGW library match keyword '+ '"'+ k +'"'+'.</a>');				
			}			
			parent.fraRight.document.writeln('</td>');			
			parent.fraRight.document.writeln('</tr>');			
			parent.fraRight.document.writeln('<tr><td colspan="3" valign="top" class="tb"><img alt="" src="http://www.egr.msu.edu/igw/DL/images/1pix.gif" width="4" height="4"></td></tr>');
			i = 0;
			npf = 0;				
			pf = new Array(3);
			pf[0] = -1; 
			pf[1] = -1; 
			pf[2] = -1; 				
			while (n = t.nodeByIndex(i)) {					
				if (found[i] == 1) {
					pf[npf] = i;											
					if ((npf % 3) == 2) {
						parent.fraRight.document.writeln('<tr>');						
						if (t.nodeByIndex(pf[0]).getUrl()) {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="'+t.nodeByIndex(pf[0]).getUrl()+'" class="tablelink"><img src="'+t.nodeByIndex(pf[0]).getUrl().replace(".htm", "-th.gif")+'" border="0"></a></td>');
						} else {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="null" class="tablelink"><img src="" border="0"></a></td>');						
						}
						if (t.nodeByIndex(pf[1]).getUrl()) {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="'+t.nodeByIndex(pf[1]).getUrl()+'" class="tablelink"><img src="'+t.nodeByIndex(pf[1]).getUrl().replace(".htm", "-th.gif")+'" border="0"></a></td>');							
						} else {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="null" class="tablelink"><img src="" border="0"></a></td>');													
						}
						if (t.nodeByIndex(pf[2]).getUrl()) {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="'+t.nodeByIndex(pf[2]).getUrl()+'" class="tablelink"><img src="'+t.nodeByIndex(pf[2]).getUrl().replace(".htm", "-th.gif")+'" border="0"></a></td>');							
						} else {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="null" class="tablelink"><img src="" border="0"></a></td>');													
						}
						parent.fraRight.document.writeln('</tr>');
						parent.fraRight.document.writeln('<tr>');						
						if (t.nodeByIndex(pf[0]).getUrl()) {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="'+t.nodeByIndex(pf[0]).getUrl()+'" class="tablelink">'+t.nodeByIndex(pf[0]).getCaption()+'</a></td>');
						} else {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="null" class="tablelink">'+t.nodeByIndex(pf[0]).getCaption()+'</a></td>');						
						}
						if (t.nodeByIndex(pf[1]).getUrl()) {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="'+t.nodeByIndex(pf[1]).getUrl()+'" class="tablelink">'+t.nodeByIndex(pf[1]).getCaption()+'</a></td>');
						} else {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="null" class="tablelink">'+t.nodeByIndex(pf[1]).getCaption()+'</a></td>');						
						}				
						if (t.nodeByIndex(pf[2]).getUrl()) {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="'+t.nodeByIndex(pf[2]).getUrl()+'" class="tablelink">'+t.nodeByIndex(pf[2]).getCaption()+'</a></td>');
						} else {
							parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="null" class="tablelink">'+t.nodeByIndex(pf[2]).getCaption()+'</a></td>');						
						}		
						parent.fraRight.document.writeln('</tr>');
						parent.fraRight.document.writeln('<tr>');						
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center">&nbsp;</td>');
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"></td>');
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"></td>');
						parent.fraRight.document.writeln('</tr>');
						parent.fraRight.document.writeln('<tr><td colspan="3" valign="top" class="tb"><img alt="" src="http://www.egr.msu.edu/igw/DL/images/1pix.gif" width="4" height="4"></td></tr>');							
						npf = 0;
						pf[0] = -1; 
						pf[1] = -1; 
						pf[2] = -1; 
					} else {
						npf++;							
					}
				}
				i++;
			}			
			if ( pf[0] != -1) {
				parent.fraRight.document.writeln('<tr>');						
				if (pf[0]!=-1) {
					if (t.nodeByIndex(pf[0]).getUrl()) {
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="'+t.nodeByIndex(pf[0]).getUrl()+'" class="tablelink"><img src="'+t.nodeByIndex(pf[0]).getUrl().replace(".htm", "-th.gif")+'" border="0"></a></td>');
					} else {
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="null" class="tablelink"><img src="" border="0"></a></td>');						
					}
				} else {
					parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center">&nbsp;</td>');					
				}
				if (pf[1]!=-1) {
					if (t.nodeByIndex(pf[1]).getUrl()) {
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="'+t.nodeByIndex(pf[1]).getUrl()+'" class="tablelink"><img src="'+t.nodeByIndex(pf[1]).getUrl().replace(".htm", "-th.gif")+'" border="0"></a></td>');							
					} else {
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="null" class="tablelink"><img src="" border="0"></a></td>');													
					}
				} else {
					parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center">&nbsp;</td>');					
				}
				parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center">&nbsp;</td>');					
				parent.fraRight.document.writeln('</tr>');
				parent.fraRight.document.writeln('<tr>');						
				if (pf[0]!=-1) {
					if (t.nodeByIndex(pf[0]).getUrl()) {
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="'+t.nodeByIndex(pf[0]).getUrl()+'" class="tablelink">'+t.nodeByIndex(pf[0]).getCaption()+'</a></td>');
					} else {
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="null" class="tablelink">'+t.nodeByIndex(pf[0]).getCaption()+'</a></td>');						
					}
				} else {
					parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center">&nbsp;</td>');										
				} 
				if (pf[1]!=-1) {
					if (t.nodeByIndex(pf[1]).getUrl()) {
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="'+t.nodeByIndex(pf[1]).getUrl()+'" class="tablelink">'+t.nodeByIndex(pf[1]).getCaption()+'</a></td>');
					} else {
						parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"><a href="null" class="tablelink">'+t.nodeByIndex(pf[1]).getCaption()+'</a></td>');
					}
				} else {
					parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center">&nbsp;</td>');										
				} 
				parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center">&nbsp;</td>');
				parent.fraRight.document.writeln('</tr>');
				parent.fraRight.document.writeln('<tr>');						
				parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center">&nbsp;</td>');
				parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"></td>');
				parent.fraRight.document.writeln('<td width="33%" align="middle" vAlign="center"></td>');
				parent.fraRight.document.writeln('</tr>');
				parent.fraRight.document.writeln('<tr><td colspan="3" valign="top" class="tb"><img alt="" src="http://www.egr.msu.edu/igw/DL/images/1pix.gif" width="4" height="4"></td></tr>');							

			}
			parent.fraRight.document.writeln('</table>');			
			parent.fraRight.document.writeln('</body>');
			parent.fraRight.document.writeln('</html>');
			parent.fraRight.document.close();			
		}
	}
}

