<!--
	function pdf_open()  {
	
		if (document.textbook.selection.options[document.textbook.selection.selectedIndex].value != "") {
			link = document.textbook.selection.options[document.textbook.selection.selectedIndex].value + ".pdf";
			window.open(link, "PDF");
		}
	}

////////////////////////////////////////////////////////////////////////////////////////
// Variables Defined                                                                  //
// browser : what browser the user is using                                           //
// element : depending on the browser how to target elements                          //
// currentBottomSection : Last content clicked or showing in second part              //
// currentTopSection : Last content clicked or showing in first part                  //
////////////////////////////////////////////////////////////////////////////////////////

// Browser Sniffer so that it works in IE 

	var browser;
	if (window.navigator.appName == "Microsoft Internet Explorer") {
		browser = 'ie';
	} else {
		browser = 'dom';
	}
	
	
	function find_element(el_name) {

		var element;
		
		if (browser == 'ie') {
			element = eval('document.all.' + el_name);
		} else {
			element = document.getElementById(el_name);
		}
		
		return element;
	}

	var currentBottomSection = 'contents';
	var currentTopSection = 'KeyConcepts';
	var currentTopButton = 'blankTopButton';
	var currentTopTab = 'tab1';
	var currentBottomTab = 'tab5';
	
	function show_top_content(whichContent,whichTopTab) {

		close_me = find_element(currentTopSection);
		close_me.style.display = 'none';
		
		open_me = find_element(whichContent);
		open_me.style.display = 'block';

		close_tab = find_element(currentTopTab);
		close_tab.style.backgroundColor = '#CCCCCC';

		open_tab = find_element(whichTopTab);
		open_tab.style.backgroundColor = '#FFFFFF';

		currentTopSection = whichContent;
		currentTopTab = whichTopTab;
	}

	function show_lower_content(whichContent) {

		close_me = find_element(currentBottomSection);
		close_me.style.display = 'none';
		
		open_me = find_element(whichContent);
		open_me.style.display = 'block';

		currentBottomSection = whichContent;

	}




function call(){alert("Hi!")}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


	function show_bottom_content(whichContent,whichBottomTab) {
		
		close_me = find_element(currentBottomSection);
		close_me.style.display = 'none';

		if (document.textbook.selection.options[document.textbook.selection.selectedIndex].value=="") {
			open_me = find_element('MakeSelection');
			open_me.style.display = 'block';
			
			currentBottomSection = 'MakeSelection';
		} else {
			open_me = find_element(document.textbook.selection.options[document.textbook.selection.selectedIndex].value + whichContent);
			open_me.style.display = 'block';
	
			close_tab = find_element(currentBottomTab);
			close_tab.style.backgroundColor = '#CCCCCC';

			open_tab = find_element(whichBottomTab);
			open_tab.style.backgroundColor = '#FFFFFF';

			currentBottomTab = whichBottomTab;
	
			currentBottomSection = document.textbook.selection.options[document.textbook.selection.selectedIndex].value + whichContent;
		}

	}
	
	
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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_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];}
}
	
//mktree

addEvent(window,"load",convertTrees);

// Utility function to add an event listener
function addEvent(o,e,f){
	if (o.addEventListener){ o.addEventListener(e,f,true); return true; }
	else if (o.attachEvent){ return o.attachEvent("on"+e,f); }
	else { return false; }
}

// utility function to set a global variable if it is not already set
function setDefault(name,val) {
	if (typeof(window[name])=="undefined" || window[name]==null) {
		window[name]=val;
	}
}

// Full expands a tree with a given ID
function expandTree(treeId) {
	var ul = document.getElementById(treeId);
	if (ul == null) { return false; }
	expandCollapseList(ul,nodeOpenClass);
}

// Fully collapses a tree with a given ID
function collapseTree(treeId) {
	var ul = document.getElementById(treeId);
	if (ul == null) { return false; }
	expandCollapseList(ul,nodeClosedClass);
}

// Expands enough nodes to expose an LI with a given ID
function expandToItem(treeId,itemId) {
	var ul = document.getElementById(treeId);
	if (ul == null) { return false; }
	var ret = expandCollapseList(ul,nodeOpenClass,itemId);
	if (ret) {
		var o = document.getElementById(itemId);
		if (o.scrollIntoView) {
			o.scrollIntoView(false);
		}
	}
}

// Performs 3 functions:
// a) Expand all nodes
// b) Collapse all nodes
// c) Expand all nodes to reach a certain ID
function expandCollapseList(ul,cName,itemId) {
	if (!ul.childNodes || ul.childNodes.length==0) { return false; }
	// Iterate LIs
	for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
		var item = ul.childNodes[itemi];
		if (itemId!=null && item.id==itemId) { return true; }
		if (item.nodeName == "LI") {
			// Iterate things in this LI
			var subLists = false;
			for (var sitemi=0;sitemi<item.childNodes.length;sitemi++) {
				var sitem = item.childNodes[sitemi];
				if (sitem.nodeName=="UL") {
					subLists = true;
					var ret = expandCollapseList(sitem,cName,itemId);
					if (itemId!=null && ret) {
						item.className=cName;
						return true;
					}
				}
			}
			if (subLists && itemId==null) {
				item.className = cName;
			}
		}
	}
}

// Search the document for UL elements with the correct CLASS name, then process them
function convertTrees() {
	setDefault("treeClass","mktree");
	setDefault("nodeClosedClass","liClosed");
	setDefault("nodeOpenClass","liOpen");
	setDefault("nodeBulletClass","liBullet");
	setDefault("nodeLinkClass","bullet");
	setDefault("preProcessTrees",true);
	if (preProcessTrees) {
		if (!document.createElement) { return; } // Without createElement, we can't do anything
		uls = document.getElementsByTagName("ul");
		for (var uli=0;uli<uls.length;uli++) {
			var ul=uls[uli];
			if (ul.nodeName=="UL" && ul.className==treeClass) {
				processList(ul);
			}
		}
	}
}

// Process a UL tag and all its children, to convert to a tree
function processList(ul) {
	if (!ul.childNodes || ul.childNodes.length==0) { return; }
	// Iterate LIs
	for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
		var item = ul.childNodes[itemi];
		if (item.nodeName == "LI") {
			// Iterate things in this LI
			var subLists = false;
			for (var sitemi=0;sitemi<item.childNodes.length;sitemi++) {
				var sitem = item.childNodes[sitemi];
				if (sitem.nodeName=="UL") {
					subLists = true;
					processList(sitem);
				}
			}
			var s= document.createElement("SPAN");
			var t= '\u00A0'; // &nbsp;
			s.className = nodeLinkClass;
			if (subLists) {
				// This LI has UL's in it, so it's a +/- node
				if (item.className==null || item.className=="") {
					item.className = nodeClosedClass;
				}
				// If it's just text, make the text work as the link also
				if (item.firstChild.nodeName=="#text") {
					t = t+item.firstChild.nodeValue;
					item.removeChild(item.firstChild);
				}
				s.onclick = function () {
					this.parentNode.className = (this.parentNode.className==nodeOpenClass) ? nodeClosedClass : nodeOpenClass;
					return false;
				}
			}
			else {
				// No sublists, so it's just a bullet node
				item.className = nodeBulletClass;
				s.onclick = function () { return false; }
			}
			s.appendChild(document.createTextNode(t));
			item.insertBefore(s,item.firstChild);
		}
	}
}

	function toggleLayer( whichLayer )
	{
	  var elem, vis;
	  if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById( whichLayer );
	  else if( document.all ) // this is the way old msie versions work
		  elem = document.all[whichLayer];
	  else if( document.layers ) // this is the way nn4 works
		elem = document.layers[whichLayer];
	  vis = elem.style;
	  // if the style.display value is blank we try to figure it out here
	  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
	}
	

//-->
