//****** 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('Sull’Agni Yoga','javascript:parent.location.href="ay_it_info.html";',false,null);
_rlinks[1]=new RLinks('Testi da scaricare','javascript:parent.location.href="ay_it_downloads.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[2]=new RLinks('Cerca','javascript:parent.location.href="search_it.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);
}
//************ END FOOTER ***********//

//************ ay_nav.js ***********//
function BookLink(url, txt, img){
	this.url = url;
	this.txt = txt;
	this.img = img;
}
var _links = new Array();
_links[0]  = new BookLink("ay_it_lomg1.html"    , "Foglie del Giardino di Morya I" , "leaves_of_moryas_1924_i.gif" );
_links[1]  = new BookLink("ay_it_lomg2.html"    , "Foglie del Giardino di Morya II", "leaves_of_moryas_1925_i.gif" );
_links[2]  = new BookLink("ay_it_community.html", "Nuova Era - Comunita"           , "new_era_community_1926_i.gif");
_links[3]  = new BookLink("ay_it_ay.html"       , "Agni Yoga"                      , "agni_yoga_1929_i.gif"        );
_links[4]  = new BookLink("ay_it_infinity1.html", "Infinito I"                     , "infinity_1930_i.gif"         );
_links[5]  = new BookLink("ay_it_infinity2.html", "Infinito II"                    , "infinity_1930-2_i.gif"       );
_links[6]  = new BookLink("ay_it_hierarchy.html", "Gerarchia"                      , "hierarchy_1931_i.gif"        );
_links[7]  = new BookLink("ay_it_heart.html"    , "Cuore"                          , "heart_1932_i.gif"            );
_links[8]  = new BookLink("ay_it_fw1.html"      , "Mondo del Fuoco I"              , "fiery_world_1933_i.gif"      );
_links[9]  = new BookLink("ay_it_fw2.html"      , "Mondo del Fuoco II"             , "fiery_world_1934_i.gif"      );
_links[10] = new BookLink("ay_it_fw3.html"      , "Mondo del Fuoco III"            , "fiery_world_1935_i.gif"      );
_links[11] = new BookLink("ay_it_aum.html"      , "Aum"                            , "aum_1936_i.gif"              );
_links[12] = new BookLink("ay_it_broth.html"    , "Fratellanza"                    , "brotherhood_1937_i.gif"      );
_links[13] = new BookLink("ay_it_supm1.html"    , "Sovramundano I"                 , "supermundane1_1938_i.gif"    );
_links[14] = new BookLink("ay_it_supm2.html"    , "Sovramundano II"                , "supermundane2_1938_i.gif"    );
_links[15] = new BookLink("ay_it_supm3.html"    , "Sovramundano III"               , "supermundane3_1938_i.gif"    );
_links[16] = new BookLink("ay_it_supm4.html"    , "Sovramundano IV"                , "supermundane4_1938_i.gif"    );


function writeImg(ndx){
	var s="<IMG SRC='ay_book_images/"+_links[ndx].img+"' BORDER=1>";
	document.write(s);
}
function writeLinks(ndx){
	var s="";
	for(var i=0; i<_links.length; i++){
		if(i==17) s+="<IMG SRC=\"/gifs/type_emb4.gif\"></IMG><BR>";
		if(i!=ndx)
			s+="\n<NOBR><A HREF='javascript:parent.document.location.href=\""+_links[i].url+"\"' CLASS='sideBookList' onMouseOver='status=\"\"; return true;' onMouseOut=''>"+_links[i].txt+"</A></NOBR><BR>";
		else
			s+="\n<NOBR><SPAN CLASS='sideBookListSel'>"+_links[i].txt+"</SPAN></NOBR><BR>";
	}
	document.write(s);
}
//************ end ay_nav.js ***********//

