//****** MAIN NAVIGATION *******//
function RLinks(txt,url,hasChildren,parentId){
	this.txt = txt;
	this.url = url;
	this.hasChildren = hasChildren;
	this.parentId = parentId;
	this.children = new Array();
}
var _rlinks = new Array();
_rlinks[0]=new RLinks('About Agni Yoga','javascript:parent.location.href="ay_info.html";',false,null);
_rlinks[1]=new RLinks('Contact','javascript:parent.location.href="ay_contact.html"',false,null);
_rlinks[2]=new RLinks('Groups','javascript:parent.location.href="ay_groups.html"',false,null);
_rlinks[3]=new RLinks('Compilations','javascript:parent.location.href="ay_compilations.html"',true,null);
_rlinks[3].children[0] = new RLinks('Comprehensive Compilations','javascript:parent.location.href="ay_list_of_compilations.html"',false,3);
_rlinks[3].children[1] = new RLinks('Gleanings','javascript:parent.location.href="ay_list_of_gleanings.html"',false,3);
_rlinks[4]=new RLinks('Order Info','javascript:parent.location.href="ay_booklist.html"',false,null);
_rlinks[5]=new RLinks('Downloads','javascript:parent.location.href="ay_downloads.html"',false,null);
_rlinks[6]=new RLinks('Search','javascript:parent.location.href="search.html"',false,null);

function writeRLinks(ndx,childNdx){
	var htmls = "<TABLE WIDTH='120px' BORDER='0' ALIGN='LEFT' CELLPADDING='0' CELLSPACING='5'>";
	htmls += "\n\t<TR><TD ROWSPAN='3'>&nbsp;</TD><TD CLASS='common_text' VALIGN='TOP'>";
	htmls += "\n<DIV ALIGN='LEFT'><A HREF='javascript:parent.location.href=\"index.html\"'>";
	htmls += "\n<IMG SRC='gifs/maitreya_small.gif' WIDTH='80' HEIGHT='86' ALIGN='MIDDLE' BORDER='0'></A></DIV>";
	htmls += "\n</TD></TR><TR><TD><BR></TD></TR><TR><TD CLASS='common_text' ALIGN=LEFT VALIGN='TOP' NOWRAP>";	
	for(var i=0; i<_rlinks.length; i++){
		if(i==ndx){			
			var prnt = _rlinks[i];
			if(prnt.children && prnt.children.length>0){
				if(childNdx!=null)
					htmls += "\n<A CLASS='ay' onMouseOver='return true;' HREF='"+prnt.url+"'>"+_rlinks[i].txt+"</A><BR>";
				else
					htmls += "\n<SPAN CLASS='ay_sel'>"+_rlinks[i].txt+"</SPAN><BR>";
				for(var j=0; j<prnt.children.length; j++){
					var child = prnt.children[j];
					if(childNdx!=null && childNdx==j){
						htmls += "\n<SPAN CLASS='ay_sel_submenu'>&nbsp;&nbsp;&nbsp;&nbsp;"+child.txt+"</SPAN><BR>";
					}else{
						htmls+="\n<A CLASS='ay_submenu' HREF='"+child.url+"' onMouseOver='return true;'>&nbsp;&nbsp;&nbsp;&nbsp;"+child.txt+"</A><BR>";
					}
				}
			}else{
				htmls += "\n<SPAN CLASS='ay_sel'>"+_rlinks[i].txt+"</SPAN><BR>";
			}
		}else{
			htmls+="\n<A HREF='"+_rlinks[i].url+"' CLASS='ay' onMouseOver='return true;'>"+_rlinks[i].txt+"</A><BR>";
		}
	}
	htmls += "\n</TD></TR></TABLE>";
	document.write(htmls);
}
//************ FOOTER ***********//
function writeFooter(){
	var footer="";
	footer += '<HR WIDTH="100%" ALIGN="CENTER" NOSHADE SIZE="1" CLASS="ay_hr">';
	footer += '<TABLE WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0" BGCOLOR="#666666">';
	footer += '<TR>';
	footer += '<TD CLASS="bottom_addrInTable" ALIGN="CENTER"> 319 West 107th Street, New York, NY 10025-2799<BR>';
	footer += 'phone (212)864-7752 &#149; fax (212)864-7704 &#149; e-mail: <A HREF="mailto:info@agniyoga.org" CLASS="bottom_addrInTable">info@agniyoga.org</A>';
	footer += '</TD>';
	footer += '</TR>';
	footer += '</TABLE>';
	document.write(footer);
}
