//



// TNavigationPrint

function TNavigationPrint(){

	var myNavIndex = XML.getFirstItem("Config").getFirstItem("NavigationIndex").getValue()

	if(!(myNavIndex=="null"||myNavIndex=="")){

		navigation[parseInt(myNavIndex)].active = true;

		if(navigation[parseInt(myNavIndex)].parentId!=null) navigation[navigation[parseInt(myNavIndex)].parentId].open = true;

		};

	var rString = '<TABLE class="CATLINKS1STPARENT" width="100%" border="0" cellpadding="1" cellspacing="0" >';

	for(var i=0;i<navigation.length;i++) if(navigation[i].parentId==null){

		rString += navigation[i].print();

		if(navigation[i].active==true||navigation[i].open==true){

			rString += "</TABLE>"

			rString += '<TABLE class="CATLINKS2NDPARENT" width="100%" border="0" cellpadding="1" cellspacing="0" ><TR valign="top">';

			for(var j=0;j<navigation.length;j++) if(navigation[j].parentId==navigation[i].id){

				rString += navigation[j].print();

				};

			rString += "</TABLE>"

			rString += '<TABLE class="CATLINKS1STPARENT" width="100%" border="0" cellpadding="1" cellspacing="0" >';

			};

		};

		rString += "</TABLE>"

	return(rString);

	};

// TNavElemprint

function TNavElemPrint(){

	var rString = '<TR valign="top">';

	with(this){

		if(active){

			if(parentId!=null) rString += '<TD class="ACTIVECATEGORY" ><IMG SRC="assets/images/spacer.gif" width="11" height="1"></TD>'

			rString += '<TD class="ACTIVECATEGORY" ><img src="assets/images/bulletcatact.gif" width="11" height="14" alt="BulletCatAct.gif" border="0" align="bottom" hspace="0" vspace="0" class="CATNAV"></TD>'

			}

		else{

			if(parentId!=null){

				rString += '<TD class="CATLINKS2NDBULLET" ><IMG SRC="assets/images/spacer.gif" width="11" height="1"></TD>';

				rString += '<TD class="CATLINKS2NDBULLET" ><img src="assets/images/bulletcat2nd.gif" width="11" height="14" alt="BulletCat2nd.gif" border="0" align="bottom" hspace="0" vspace="0" class="CATNAV"></TD>';

				}

			else{

				rString += '<TD class="CATLINKS1STBULLET" >';

				if(!open) rString += '<img src="assets/images/bulletcat1st.gif" width="11" height="14" alt="BulletCat1st.gif" border="0" align="bottom" hspace="0" vspace="0" class="CATNAV"></TD>'

				else rString += '<img src="assets/images/bulletcat1stcls.gif" width="11" height="14" alt="BulletCat1stCls.gif" border="0" align="bottom" hspace="0" vspace="0" class="CATNAV"></TD>';

				};

			};

		if(active) rString += '<TD nowrap class="ACTIVECATEGORY"  width="100%">'

		else{

			if(parentId!=null) rString += '<TD nowrap class="CATLINKS2NDCAPTION"  width="100%">'

			else rString += '<TD nowrap colspan="2" class="CATLINKS1STCAPTION"  width="100%">'

			};

		rString += "<a href=\"javascript: changeLoc(" + this.id + ",'" + this.linkUrl + "')\" class=\"wagrunav\">";

		rString += caption;

		rString += "</a>";

		rString += "</TD>"

		rString += "</TR>";

		};

	return rString; 

	};



//



// navElem

function navElem(id,caption,linkUrl,parentId){

	this.id = id;

	this.caption = caption;

	this.linkUrl = linkUrl;

	this.parentId = parentId;

	this.print = TNavElemPrint;

	this.active = false;

	this.open = true;

	};

// navigation

var navigation = new Array();

//

navigation[0] = new navElem(0,"Penmanship Books","pi1267103738.htm",null);

navigation[1] = new navElem(1,"Book A","pd980443116.htm",0);

navigation[2] = new navElem(2,"Book B","pd982307016.htm",0);

navigation[3] = new navElem(3,"Book 1","pd408183593.htm",0);

navigation[4] = new navElem(4,"Book 2","pd-718519242.htm",0);

navigation[5] = new navElem(5,"Book 3","pd-1114603137.htm",0);

navigation[6] = new navElem(6,"Book 4","pd1266605396.htm",0);

navigation[7] = new navElem(7,"Book 5","pd-249143355.htm",0);

navigation[8] = new navElem(8,"Book 5B","pd-249943355.htm",0);

navigation[9] = new navElem(9,"Libro 5SP","pd-249943356.htm",0);

navigation[10] = new navElem(10,"Book 5PR","pd-249943357.htm",0);

navigation[11] = new navElem(11,"Book 6","pd-1240869982.htm",0);

navigation[12] = new navElem(12,"Book 7","pd308133755.htm",0);

navigation[13] = new navElem(13,"Book 8","pd742599328.htm",0);

navigation[14] = new navElem(14,"Book 9","pd742599329.htm",0);

navigation[15] = new navElem(15,"Altar Server Guide","pd-249943358.htm",0);

navigation[16] = new navElem(16,"The Story of a Country","pd-249943359.htm",0);

navigation[17] = new navElem(17,"The Holy Rosary  Video","pd-249943360.htm",0);

navigation[18] = new navElem(18,"The Holy Rosary  Audio","pd-249943360.htm",0);

navigation[19] = new navElem(19,"Subjects of Our Catholic Faith","pd-249943361.htm",0);

navigation[20] = new navElem(20,"OT:Preparation for Christianity","pd-249943362.htm",0);

// changeLoc

function changeLoc(id,linkUrl){

	XML.getFirstItem("Config").getFirstItem("NavigationIndex").putValue(id.toString());

	safeData();

	location.href = linkUrl;

	};



