
thisPageId = ""
thisParentId = ""
for(i=0;i<mainNavTitle.length;i++){		//loop thru main navigation
	
	if(mainNavSiteMap[i]=="1"){
	document.write("<table width=100% cellpadding=3 cellspacing=0 id=sitemap border=0><tr>")
	document.write("<td width=2><img src=/images/spacer.gif width=2 height=1></td>")
	document.write("<td width=99%><a href=\"" + mainNavFileName[i] + "\">" + mainNavTitle[i].toLowerCase() + "</a></td></tr></table>")
	}
	
	
	//now write sub Navs
	//for(i=0;i<subNavFileName[thisCatIndex].length;i++){
	//if (subNavInNav[thisCatIndex][i] != "0" && subNavParent[thisCatIndex][i] == ""){
	for (j=0;j<subNavTitle[i].length;j++) {
		thisParentId = subNavParent[i][j]
		thisPageId = subNavId[i][j]
		blnCanShowPage = "True"
		if(subNavInNav[i][j] != "0" && subNavParent[i][j] == "" && subNavSiteMap[i][j]== "1"){
			selectedPageId = subNavId[i][j]
			//alert(subNavFileName[i][j]);
			//alert(selectedPageId);
			//checks to see if the ip address is qualified for the aim admission document
			if (selectedPageId == "24430") {
			    if (document.getElementById('ipqualified')) {
			        if (document.getElementById('ipqualified').value == "False") {
			            blnCanShowPage = "False"
			        }
			    }
			    //alert("blnCanShowPage=" + blnCanShowPage)
			}
			if (blnCanShowPage == "True") {
			    document.write("<table width=100% cellpadding=0 cellspacing=0 border=0 id=sitemap_sub><tr>")
			    document.write("<td width=35><img src=/images/spacer.gif width=35 height=1></td>")
			    document.write("<td width=5 style='padding-right:5px;padding-top:2px;'><img src=images/spacer.gif border=0 width=5 height=14></td>")
			    document.write("<td width=99% class=content valign=top style='padding-top:5px; padding-bottom:5px'><a href=\"" + subNavFileName[i][j] + "\">" + subNavTitle[i][j].toLowerCase() + "</a></td></tr></table>")
		    }
		
		
			hasThirdLevel = false	
			//alert(selectedPageId + " - " + thisPageId + " - " + thisParentId)										
			if(selectedPageId == thisPageId || thisParentId == selectedPageId){	//if the selected page is the page we are looping thru
																																			//or a sub page of the page we are looping thru, then show 
				for(k=0;k<subNavFileName[i].length;k++){
																					
					if(subNavParent[i][k] == selectedPageId && subNavInNav[i][k] == "1" && subNavSiteMap[i][k]== "1"){
						hasThirdLevel = true
						//alert("hi");
						document.write("<table width=100% cellpadding=0 cellspacing=0 border=0 id=sitemap_third><tr>")
						document.write("<td width=50><img src=/images/spacer.gif width=50 height=1></td>")
			            document.write("<td width=5 style='padding-right:5px;'><img src=images/spacer.gif border=0 width=5 height=14></td>")
						document.write("<td width=99% class=content style='padding-top:5px; padding-bottom:5px'><a class=sub href=\"" + subNavFileName[i][k] + "\"> " + subNavTitle[i][k].toLowerCase() + "</a></td></tr></table>")
						
					
					}
				}
			}														
		
		
		
		
		}
	}
document.write("<br>")
	 
}