/****************************** Marieb, Essentials of Human Anatomy and Physiology, 9/e - WebDevr Dario Wong */

//load external google analytics file
function loadScript(url) {document.write('<script src="', url, '" type="text/javascript"></script>');}
loadScript("http://www.google-analytics.com/urchin.js");

/*---------- Array for chapter titles ---------*/
var CHAPTER_PREFIX = 0;
var CHAPTER_TITLE = 1;
var ehap9Chp = new Array(); // Array to hold all chapter titles

ehap9Chp["01"] = ["Chapter 1", "The Human Body: An Orientation"];
ehap9Chp["02"] = ["Chapter 2", "Basic Chemistry"];
ehap9Chp["03"] = ["Chapter 3", "Cells and Tissues"];
ehap9Chp["04"] = ["Chapter 4", "Skin and Body Membranes"];
ehap9Chp["05"] = ["Chapter 5", "The Skeletal System"];
ehap9Chp["06"] = ["Chapter 6", "The Muscular System"];
ehap9Chp["07"] = ["Chapter 7", "The Nervous System"];
ehap9Chp["08"] = ["Chapter 8", "Special Senses"];
ehap9Chp["09"] = ["Chapter 9", "The Endocrine System"];
ehap9Chp["10"] = ["Chapter 10", "Blood"];
ehap9Chp["11"] = ["Chapter 11", "The Cardiovascular System"];
ehap9Chp["12"] = ["Chapter 12", "The Lymphatic System and Body Defenses"];
ehap9Chp["13"] = ["Chapter 13", "The Respiratory System"];
ehap9Chp["14"] = ["Chapter 14", "The Digestive System and Body Metabolism"];
ehap9Chp["15"] = ["Chapter 15", "The Urinary System"];
ehap9Chp["16"] = ["Chapter 16", "The Reproductive System"];

/*---------- Array for Activities ---------*/
var ACT_TITLE = 0;
var ACT_PATH = 1;
var ehap9Act = new Array(); // Array to hold all activities in the form ehap9Act["code"] = ["activity_title", "activity_MS_file_name"]
ehap9Act["lbo"] =	["Levels of Biological Organization", "Act1A.html"];
ehap9Act["dvc"] =	["Dorsal and Ventral Cavities", "Act1B.html"];
ehap9Act["bp"] =	["Body Planes", "Act1C.html"];
ehap9Act["atodt"] =	["Anatomical Terminology: Orientation and Directional Terms", "Act1D.html"];
ehap9Act["tsa"] =	["The Structure of Atoms", "Act2A\/st01\/frame.html"];
ehap9Act["celo"] =	["Common Elements in Living Organisms", "Act2B.html"];
ehap9Act["ea"] =	["Electron Arrangement", "Act2C\/st01\/frame.html"];
ehap9Act["ib"] =	["Ionic Bonds", "Act2D\/st01\/frame.html"];
ehap9Act["cb"] =	["Covalent Bonds", "Act2E\/st01\/frame.html"];
ehap9Act["cabs"] =	["Characteristics of Acids, Bases, and Salts", "Act2F.html"];
ehap9Act["pcs"] =	["Parts of the Cell: Structure", "Act3A.html"];
ehap9Act["spm"] =	["Structure of the Plasma Membrane", "Act3B.html"];
ehap9Act["mt"] =	["Membrane Transport", "Act3C.html"];
ehap9Act["sp"] =	["Selective Permeability", "Act3D.html"];
ehap9Act["pt"] =	["Passive Transport", "Act3E.html"];
ehap9Act["ict"] =	["Identifying Connective Tissue", "Act3F.html"];
ehap9Act["ss"] =	["Structure of the Skin", "Act4A.html"];
ehap9Act["mscb"] =	["Microscopic Structure of Compact Bone", "Act5A.html"];
ehap9Act["ctf"] =	["Common Types of Fractures", "Act5B.html"];
ehap9Act["fb"] =	["Facial Bones", "Act5C.html"];
ehap9Act["tv"] =	["Typical Vertebra", "Act5D.html"];
ehap9Act["cob"] =	["Classification of Bones", "Act5E.html"];
ehap9Act["tsj"] =	["Types of Synovial Joints", "Act5F.html"];
ehap9Act["ctwsm"] =	["Connective Tissue Wrappings of Skeletal Muscle", "Act6A.html"];
ehap9Act["masf"] =	["Microscopic Anatomy of Skeletal Fiber", "Act6B.html"];
ehap9Act["olsm"] =	["Organizational Level of Skeletal Muscles", "Act6C.html"];
ehap9Act["gmr"] =	["Graded Muscle Responses", "Act6D.html"];
ehap9Act["motb"] =	["Muscles of the Body", "Act6E.html"];
ehap9Act["psm"] =	["Posterior Surface Musculature", "Act6F.html"];
ehap9Act["gctf"] =	["Glial Cells and Their Functions", "Act7A.html"];
ehap9Act["con"] =	["Classification of Neurons", "Act7B.html"];
ehap9Act["thbss"] =	["The Human Brain: Sagittal Section", "Act7C.html"];
ehap9Act["potb"] =	["Parts of the Brain", "Act7D.html"];
ehap9Act["mob"] =	["Meninges of the Brain", "Act7E.html"];
ehap9Act["aotsc"] =	["Anatomy of the Spinal Cord", "Act7F.html"];
ehap9Act["cn"] =	["Cranial Nerves", "Act7G.html"];
ehap9Act["soan"] =	["Structure of a Nerve", "Act7H.html"];
ehap9Act["docn"] =	["Descriptions of Cranial Nerves", "Act7I.html"];
ehap9Act["dosn"] =	["Distribution of Spinal Nerves", "Act7J.html"];
ehap9Act["isote"] =	["Internal Structures of the Eye", "Act8A.html"];
ehap9Act["oote"] =	["Optics of the Eye", "Act8B.html"];
ehap9Act["ise"] =	["Internal Structures of the Ear", "Act8C.html"];
ehap9Act["hattc"] =	["Hormones and their Target Cells", "Act9A.html"];
ehap9Act["iclib"] =	["Ionic Calcium Levels in Blood", "Act9B.html"];
ehap9Act["rbsl"] =	["Regulation of Blood Sugar Levels by Insulin and Glycogen", "Act9C.html"];
ehap9Act["fe"] =	["Formed Elements", "Act10A.html"];
ehap9Act["eaoth"] =	["External Anatomy of the Heart", "Act11A.html"];
ehap9Act["fsoth"] =	["Frontal Section of the Heart", "Act11B.html"];
ehap9Act["icsh"] =	["Intrinsic Conduction System of the Heart", "Act11C.html"];
ehap9Act["ac"] =	["Arterial Circulation", "Act11D.html"];
ehap9Act["vsc"] =	["Veins of the Systemic Circulation", "Act11E.html"];
ehap9Act["lcv"] =	["Lymphatic Collecting Vessels and Regional Lymph Nodes", "Act12A.html"];
ehap9Act["eiar"] =	["Events in Allergic Reactions", "Act12B.html"];
ehap9Act["aurt"] =	["Anatomy of the Upper Respiratory Tract", "Act13A.html"];
ehap9Act["gt"] =	["Gas Transport", "Act13B.html"];
ehap9Act["ds"] =	["Digestive System", "Act14A.html"];
ehap9Act["bsaw"] =	["Basic Structure of the Alimentary Wall", "Act14B.html"];
ehap9Act["gta"] =	["Gastrointestinal Tract Activities", "Act14C.html"];
ehap9Act["ocr"] =	["Overview of Cellular Respiration", "Act14D.html"];
ehap9Act["afn"] =	["Anatomy and Function of the Nephron", "Act15A.html"];
ehap9Act["na"] =	["Nephron Activity", "Act15B.html"];
ehap9Act["efp"] =	["Early Filtrate Processing", "Act15C.html"];
ehap9Act["mra"] =	["Male Reproductive Anatomy: Sagittal View", "Act16A.html"];
ehap9Act["tfmc"] =	["The Female Menstrual Cycle", "Act16B.html"];

function writeChTitle(chNum, chElem)
{
	var arrayElem = ehap9Chp[chNum];
	var prefix = arrayElem[CHAPTER_PREFIX];
	var title = arrayElem[CHAPTER_TITLE];
	
	switch (chElem)
	{
		case ('cg'):
			document.write('<div class="cgChapter">Chapter Guide<br \/>' + prefix + '<br \/>' + title + '<\/div>');
			break;
		default:
			document.write('<div class="cgChapter">' + prefix + ': ' + title + '<\/div>');
			break;
	}
}

function writeActLink(chNum, actTitleCode)
{
	var arrayElem = ehap9Act[actTitleCode];
	var title = arrayElem[ACT_TITLE];
	var filePath = arrayElem[ACT_PATH];
	
	document.write('<a href="javascript:void(0);" onclick="javascript:writeAct(\'' + chNum + '\', \'' + filePath + '\');" class="generalLink">' + title + '</a>');
}

function writeAct(chNum, filePath)
{	
	var msPath = 'http:\/\/media.pearsoncmg.com\/bc\/bc_marieb_ehap_9\/activities\/chapter';
	var completePath = msPath + chNum + '\/' + filePath;
	var actWinAttrib = 'location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=800,height=600,top=0,left=0,screenX=0,screenY=0';
	var actWin = window.open(completePath, 'aWin', actWinAttrib);
	if (actWin.opener == null)
	{
		actWin.opener = window;
	}
	actWin.focus();
}

/*---------- Glossary ---------*/
function openGloss()
{
	var glossaryPath = 'http:\/\/media.pearsoncmg.com\/bc\/bc_marieb_ehap_9\/glossary\/index.html';
	var glossWin = window.open(glossaryPath, 'glossary', 'location=no,menubar=no,resizable=no,status=no,toolbar=no,width=600,height=550,top=0,left=0,screenX=0,screenY=0');
	if (glossWin.opener == null)
	{
		glossWin.opener = window;
	}
	glossWin.focus();	
}

/*--------- Flashcards ----------*/
function openFlash()
{
	var flashPath = 'http:\/\/media.pearsoncmg.com\/bc\/bc_marieb_ehap_9\/flashcards\/index.html';
	var flashWin = window.open(flashPath, 'flashcards', 'location=no,menubar=no,resizable=no,status=no,toolbar=no,width=670,height=525,top=0,left=0,screenX=0,screenY=0');
	if (flashWin.opener == null)
	{
		flashWin.opener = window;
	}
	flashWin.focus();
}

/*--------- Instructor Resources/Media Manager ----------*/
function openIRMMLink(fileName)
{
	var msFilePath = 'http:\/\/media.pearsoncmg.com\/bc\/bc_marieb_ehap_9\/ir\/mm\/';
	
	var completeFilePath = msFilePath + fileName;
	
	var mmGlobalWin = window.open(completeFilePath, 'irMMWin', 'location=no,menubar=no,status=no,toolbar=no,resizable=yes,width=800,height=600,top=10,left=10,screenX=10,screenY=10');
	if (mmGlobalWin.opener == null)
	{
		mmGlobalWin.opener = window;
	}
	mmGlobalWin.focus();
}

function redirectCareerPage(careerPage)
{
	var careerMSPath = 'http:\/\/media.pearsoncmg.com\/bc\/bc_marieb_ehap_9\/careers\/';
	location.href = careerMSPath + careerPage;
}

// Topnav
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_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_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];}
}