// ---------------------------------------------------------
// PageNav.js 
// ---------------------------------------------------------
var gstPageName = "";


// ----------------------------------------------------------
// FUNCTION: MM_findObj(n, d)
// ----------------------------------------------------------
function MM_findObj(n, d) { //v3.0
  	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); 
	}
	return x;
}

// ----------------------------------------------------------
// FUNCTION: MM_swapImage()
// ----------------------------------------------------------
function MM_swapImage() { //v3.0
  var i,j=0,x;
  var 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];
    }
  }	
}

// ----------------------------------------------------------
// FUNCTION: MM_swapImgRestore(
// ----------------------------------------------------------
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: Load_Pics()
// ----------------------------------------------------------
function Load_Pics(){
	
	if (document.images) {
  		welcome_f1 = new Image(150, 28); welcome_f1.src = "images/link_welcome.gif";
		welcome_f2 = new Image(150, 28); welcome_f2.src = "images/link_welcome_f2.gif";
	  	team_f1 = new Image(150, 28); team_f1.src = "images/link_team.gif";
		team_f2 = new Image(150, 28); team_f2.src = "images/link_team_f2.gif";
		services_f1 = new Image(150, 28); services_f1.src = "images/link_services.gif";
		services_f2 = new Image(150, 28); services_f2.src = "images/link_services_f2.gif";
		
		directions_f1 = new Image(150, 28); directions_f1.src = "images/link_directions.gif";
		directions_f2 = new Image(150, 28); directions_f2.src = "images/link_directions_f2.gif";
		fees_f1 = new Image(150, 28); fees_f1.src = "images/link_fees.gif";
		fees_f2 = new Image(150, 28); fees_f2.src = "images/link_fees_f2.gif";
		forms_f1 = new Image(150, 28); forms_f1.src = "images/link_forms.gif";
		forms_f2 = new Image(150, 28); forms_f2.src = "images/link_forms_f2.gif";
		contact_f1 = new Image(150, 28); contact_f1.src = "images/link_contact.gif";
		contact_f2 = new Image(150, 28); contact_f2.src = "images/link_contact_f2.gif";
		qanda_f1 = new Image(150, 28); qanda_f1.src = "images/link_qanda.gif";
		qanda_f2 = new Image(150, 28); qanda_f2.src = "images/link_qanda_f2.gif";
		npp_f1 = new Image(150, 28); npp_f1.src = "images/link_npp.gif";
		npp_f2 = new Image(150, 28); npp_f2.src = "images/link_npp_f2.gif";
		
	 	top_f1 = new Image(75, 25); top_f1.src = "images/btn_top.gif";
		top_f2 = new Image(75, 25); top_f2.src = "images/btn_top_f2.gif";
		
	
		
	}	
}


// ----------------------------------------------------------
// FUNCTION: Write_NavItem
// ----------------------------------------------------------
function Write_NavItem(stName, stLink, stTip)
{
	if (gstPageName == stName ){
	    document.write('<TR><TD>');
		document.writeln('<IMG height="28" src="images/link_'+stName+'_f3.gif" width="150" border=0" '); 
		document.writeln('name="'+stName+'" alt="'+stTip+'"></TD></TR>');
	}
	else {				
	    document.write('<TR><TD><A onmouseover="MM_swapImage(');
		document.write("'"+stName+"','','images/link_"+stName+"_f2.gif', 1); ");
		document.writeln('" onmouseout="MM_swapImgRestore();" href="'+stLink+'"> ');
		document.writeln('<IMG height="28" src="images/link_'+stName+'.gif" width="150" border=0" '); 
		document.writeln('name="'+stName+'" alt="'+stTip+'"></A></TD></TR>');
	}
}	
// ----------------------------------------------------------
// FUNCTION: Write_HorzRule
// ----------------------------------------------------------
function Write_HorzRule(stColspan, stImg)
{
	stRule = "images/horz_rule.gif"
	if (stImg == "LT"){
		stRule = "images/bgnd_horzrule_light.gif"
	}
	document.writeln('<tr><td colspan="'+stColspan +'">');
		document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
				
		// horz rule with spacer			
		document.write  ('<tr><td align="left" width="100%" background="'+stRule+'">');
		document.writeln('<img src="images/pic_spacer.gif" alt="" width="1" height="11" border="0"></td>');				
		document.write('<td><img src="images/pic_spacer.gif" alt="" width="14" height="11" border="0">');
		document.writeln('</td></tr></table>');	
	document.writeln('</td></tr>');	
}


// ----------------------------------------------------------
// FUNCTION: Begin_Page
// ----------------------------------------------------------
function Begin_PageNav(stPageName)
{
	gstPageName = stPageName;
	
	Load_Pics();
	
	document.writeln('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="1">');
	document.writeln('<a name=top><table width="100%" border="0" cellspacing="0" cellpadding="0">');
	
		// begin Left pane 
		document.writeln('<tr><td width="170" background="images/ht_sidebar_300.gif" valign="top" align="left">');
		
			// begin menu cell
			document.writeln('<table width="170" height="500" background="images/ht_sidebar_400.gif" border="0" cellspacing="0" cellpadding="0">');		
				document.writeln('<tr><td valign="top"><span class="menu">');
				document.writeln('<table width="100%" background="" border="0" cellspacing="0" cellpadding="0">');
				
					document.writeln('<tr><td rowspan="3" align="left" width="5" height="100%"><img src="images/pic_spacer.gif" ');
					document.writeln(' alt="" width="5" height="10" border="0"></td>');
								
					document.writeln('<td align="left" width="150" height="100%"><img src="images/pic_spacer.gif" ');
					document.writeln(' alt="" width="150" height="170" border="0"></td>');
					
					document.writeln('<td align="left" width="15" height="100%"><img src="images/pic_spacer.gif" ');
					document.writeln(' alt="" width="15" height="170" border="0"></td></tr>');
											
					document.writeln('<tr><td align="left" valign="top">');	
					document.writeln('<table width="150" background="" border="0" cellspacing="0" cellpadding="0">');	
					
					// --------------------------------------------
					// items
					// --------------------------------------------
					Write_NavItem("welcome","index.html", "Welcome (Home)");
					Write_NavItem("team","team.html", "Our Team");	
					Write_NavItem("services","counseling.html", "Services We Offer");
					Write_NavItem("directions","stratford.html", "Directions to Our Offices");	
					Write_NavItem("fees","fees.html", "About Our Fees");
					Write_NavItem("forms","forms.html", "Forms");	
					Write_NavItem("contact","contact.html", "Contact Us");
					Write_NavItem("qanda","qanda.html", "Q&A Forum");		
					Write_NavItem("npp","nppshort.html", "Your Privacy");								
					
					document.writeln('</table>');	
										
					document.writeln('</td><td align="left" width="15" height="100%">&nbsp;</td></tr>');				
				document.writeln('</table></span></td></tr>');
						
			document.writeln('</table>');		
			// end menu
			
		// end Left Pane (with a transparent spacer to fix Netscape width issues)
		document.writeln('<img src="images/pic_spacer.gif" alt="" width="170" height="10" border="0"></td>');
		
		// begin Right pane
		document.writeln('<td align="left" valign="top" width="100%">');
		document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
		document.writeln('<tr><td>');
		    
			// page header
			document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
			document.write  ('<tr>');
			document.writeln('');
			document.write  ('<td height="150" width="100%" valign="middle" align="right" background="images/ht_banner_bgnd.gif">');
			document.write  ('<img src="images/ht_logo.gif" alt="Personal Growth Concepts"  width="600" height="150" border="0">');
			document.writeln('</td></tr></table>');
			
		document.writeln('</td></tr><tr><td>');
			
			// Page Title and Top Nav Buttons	
			document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">');
			
			// verticle spacer			
			document.writeln('<tr><td colspan="2" width="95%"><img src="images/pic_spacer.gif" ');
			document.writeln('alt="spacer" width="3" height="8" border="0"></td></tr>'); 
			
			// <HR> Page Title <HR>
			document.writeln('<tr><td align="left" valign="middle" width="95%">'); 
				document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
						
				//document.write  ('<tr><td align="left" width="100%" background="images/horz_rule.gif">');
				//document.writeln('<img src="images/pic_spacer.gif" alt="" width="1" height="16" border="0"></td></tr>');	
				document.write  ('<tr><td align="center" valign="top">'); 	
			
				document.writeln('<img src="images/pghd_'+stPageName+'.gif" alt="+stPageName+"  width="500" height="50" border="0"></td></tr>');				
				//document.write  ('<tr><td align="left" width="100%" background="images/horz_rule.gif">');
				//document.writeln('<img src="images/pic_spacer.gif" alt="" width="1" height="12" border="0"></td></tr>');	
				document.writeln('</table></td>');
			
			    // Nav Buttons	
			    // document.writeln('<td width="160" align="center" valign="bottom">');
				/*
				// Home Button
				if (gstPageName == "welcome"){
					document.writeln('<img src="images/btn_home_d.gif" alt="" ');
					document.write('width="75" height="25" border="0" >');
				}
				else {				
					stName="home"; stNum="1"; stLink="index.html"; stTip="home page"; 
					document.writeln('<a onmouseover="MM_swapImage(');
					document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
					document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
					document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="75" border=0" '); 
					document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');					
				}
					
				// Contact Button
				if (gstPageName == "contact"){
					document.writeln('<img src="images/btn_contact_d.gif" alt="" ');
					document.write('width="75" height="25" border="0" >');
				}
				else {	
					stName="btn_contact"; stNum="1"; stLink="contact.html"; stTip="contact us";
					document.writeln('<a onmouseover="MM_swapImage(');
					document.write  ("'"+stName+stNum+"','','images/"+stName+"_f2.gif', 1); ");
					document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
					document.write  ('<img height="25" src="images/'+stName+'.gif" width="75" border=0" '); 
					document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');				
				}							
				document.write  ('<img src="images/pic_spacer.gif" alt="spacer" width="3" height="10" border="0">');
				*/
				
				//document.writeln('<img src="images/pic_spacer.gif" alt="" width="165" height="20" border="0" align="top"></td>');

			document.writeln('</tr></table>');
		
		document.writeln('</td></tr><tr><td>');
		
		// media HTML writes rest of Right pane
		document.writeln('<table width="100%" border="0" cellspacing="2" cellpadding="2" align="center">');	
	
}


// ----------------------------------------------------------
// FUNCTION: End_Page
// ----------------------------------------------------------
function End_PageNav()
{
		// end body cell
		document.writeln('</table></td></tr>');
		
	
		//---- Contact Us items --------
		document.writeln('<tr><td>');
			document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
			
			// horz rule with spacer			
			document.write  ('<tr><td align="left" width="100%" background="images/horz_rule.gif">');
			document.writeln('<img src="images/pic_spacer.gif" alt="" width="1" height="16" border="0"></td>');				
			document.write('<td><img src="images/pic_spacer.gif" alt="" width="14" height="10" border="0">');
			document.writeln('</td></tr></table>');	
		document.writeln('</td></tr>');	
	
		//---- bottom page navigation items --------
		document.writeln('<tr><td>');
			document.writeln('<span class="options"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"><tr>');
			document.writeln('<td align="left"><a href="http://www.humanitects.com"><img src="images/ht_advert.gif" alt="humanitects" border="0"></a></td>');
			
			
			// added staff login link on Team page
			if (gstPageName == "team"){
				document.writeln('<td width="98%" align="center" nowrap><a href="http://www.personalgrowthconcepts.com/forums/index.php?act=Login&CODE=00">Staff Login</a></td>');
			}
			else {
				document.writeln('<td width="98%" align="center" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;</td>');
			}
			
			document.writeln('<td valign="middle" align="right">');
	
			// Home Button
			if (gstPageName == "welcome"){
				document.writeln('<img src="images/btn_home_d.gif" alt="" ');
				document.write('width="75" height="25" border="0" >');
			}
			else {				
				stName="home"; stNum="2"; stLink="index.html"; stTip="home page"; 
				document.writeln('<a onmouseover="MM_swapImage(');
				document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
				document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
				document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="75" border=0" '); 
				document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');					
			}
			
			// Top of Page Button			
			stName="top"; stNum="1"; stLink="#top"; stTip="top of page";
			document.writeln('<a onmouseover="MM_swapImage(');
			document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
			document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
			document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="75" border=0" '); 
			document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');					
			document.writeln('</td>');
				
			document.writeln('<td><img src="images/pic_spacer.gif" alt="" width="10" height="10" border="0"></td>');
			document.writeln('</tr><tr><td colspan="3" height="20">&nbsp;</td></tr></table></span>');	
		document.writeln('</td></tr></table>');
		//---- end bottom page navigation items ----
		
	// end outermost table and HTML body
	document.writeln('</td></tr></table></body>');
		
}

// ----------------------------------------------------------
// FUNCTION: Write_ListItems
// ----------------------------------------------------------
function Write_ListItems(stPageName, stList, stPrev, stNext, stNum)
{
	document.writeln('<tr><td colspan="2" >');
	document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
	document.writeln('<tr><td align="left" valign="middle" width="95%" class="HeadSm">'); 
	document.writeln('<b>'+stPageName+'</b></td>');
	
	document.write('<td width="165" align="center" valign="bottom"><img src=');	
	document.writeln('"images/pic_spacer.gif" alt="" width="165" height="10" border="0"><br>');	
	Write_ListBtns(stList, stPrev, stNext, stNum);
	document.writeln('</td>');
	document.writeln('</tr></table></td></tr>');
}	

// ----------------------------------------------------------
// FUNCTION: Write_ListBtns
// ----------------------------------------------------------
function Write_ListBtns(stList, stPrev, stNext, stNum)
{	
	// List Button
	if (stList == ""){
		document.writeln('<img src="images/btn_list_d.gif" alt="" ');
		document.write('width="50" height="25" border="0" >');
	}
	else {
		stName="list"; stLink=stList; stTip="view list";
		document.writeln('<a onmouseover="MM_swapImage(');
		document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
		document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
		document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="50" border=0" '); 
		document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');				
	}
	// Prev Button
	if (stPrev == ""){
		document.writeln('<img src="images/btn_prev_d.gif" alt="" ');
		document.write('width="50" height="25" border="0" >');
	}
	else {		
		stName="prev"; stLink=stPrev; stTip="previous item";
		document.writeln('<a onmouseover="MM_swapImage(');
		document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
		document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
		document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="50" border=0" '); 
		document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');				
	}
	
	// Next Button
	if (stNext == ""){
		document.writeln('<img src="images/btn_next_d.gif" alt="" ');
		document.write('width="50" height="25" border="0" >');
	}
	else {		
		stName="next"; stLink=stNext; stTip="next item";
		document.writeln('<a onmouseover="MM_swapImage(');
		document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
		document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
		document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="50" border=0" '); 
		document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');						
	}
	document.writeln('<img src="images/pic_spacer.gif" alt="" width="4" height="10" border="0">');
	document.write('<img src="images/pic_spacer.gif" alt="" width="165" height="10" border="0" align="top">');	
}


// ----------------------------------------------------------------------
// Begin_PageTabs)
// ----------------------------------------------------------------------
function Begin_PageTabs()
{
	// begin outer table
	document.writeln('<TABLE width="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD>');
	
	// begin tabs table
	document.writeln('<span class="Tabs">');
	document.writeln('<TABLE align="left" BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR>');
}

// ----------------------------------------------------------------------
// Add_PageTab()
// ----------------------------------------------------------------------
function Add_PageTab(stItem, stLink, stWidth)
{
	// write a tab 
    if(stLink==""){
		document.writeln('<TD><IMG SRC="images/tab_left_sel.gif" WIDTH="5" HEIGHT="21" BORDER=0></TD>'); 
    	document.writeln('<TD width="'+stWidth+'" class="Sel" background="images/tab_ctr_sel.gif"><IMG SRC="images/tab_link_'+stItem+'_sel.gif" WIDTH="130" HEIGHT="21" BORDER=0></TD>');
		document.writeln('<TD><IMG SRC="images/tab_right_sel.gif" WIDTH="5" HEIGHT="21" BORDER=0></TD>');
	}
	else{
		document.writeln('<TD><IMG SRC="images/tab_left_unsel.gif" WIDTH="5" HEIGHT="21" BORDER=0></TD>'); 
    	document.writeln('<TD width="'+stWidth+'" class="UnSel" background="images/tab_ctr_unsel.gif">');
		document.writeln('<a href="'+stLink+'"><IMG SRC="images/tab_link_'+stItem+'_unsel.gif" WIDTH="130" HEIGHT="21" BORDER=0></a></TD>');
		document.writeln('<TD><IMG SRC="images/tab_right_unsel.gif" WIDTH="5" HEIGHT="21" BORDER=0></TD>');
	}	
}

// ----------------------------------------------------------------------
// Begin_PageTabBody()
// ----------------------------------------------------------------------
function Begin_PageTabBody()
{
	// end tabs table 
    document.writeln('</TR></TABLE></span></TD>');
	
	// right spacer and end tabs row
	document.write('<td rowspan="2"><img src="images/pic_spacer.gif" alt="" width="14" height="10" border="0">');
	document.writeln('</td></TR>');
	
	// begin border row and table
	document.writeln('<TR valign="top"><TD>'); 
	document.writeln('<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#0000B9" bordercolordark="#0000B9">');
	document.writeln('<TR valign="top"><TD height="300" >');

	// begin inner table and row
	document.writeln('<table width="95%" border="0" align="center"><tr><td>');	
	
}	

// ----------------------------------------------------------------------
// End_PageTabs()
// ----------------------------------------------------------------------
function End_PageTabs()
{
  	// end of inner table
  	document.writeln('</TD></TR></TABLE>');
	
  	// end of border table
  	document.writeln('</TD></TR></TABLE>');
	
  	// end of outer table
  	document.writeln('</TD></TR></TABLE>');
}
