// configure path to "navbar.js".  It can be relative or absolute.  We set it
// as relative here so that the demo works on file:// protocol.
_NavBar_url = "navbar";

// this function constructs a label based on variable _NavBar_pageID which
// should be defined in the HTML file.
function L(label) {
	if (_NavBar_pageID.toLowerCase() == label.toLowerCase())
		label = "!" + label;
	return label;
}

// pass ID-s of some DIV-s as parameters:
//  - "content" is the DIV where the menu will be displayed
//  - "beforemenu" is a DIV that will appear in the nav. bar, before sections (optional)
//  - "aftermenu" is a DIV that will appear in the nav. bar but after the sections (optional)
var menu = new NavBar("content", "beforemenu", "aftermenu");
// No Control Buttons
menu.prefs["no-controls"] = true;

// gets rid of header and footer link
menu.prefs["home-text"] = ""

// adds top control buttons
menu.openMenu(true);

// sets links to open in frame 'mainFrame'
menu.prefs["link-target"] = "mainFrame"

// DEFINITION OF MENU SECTIONS.

// first section
new NavSection(menu, // parent menubar
	       "Learn About The System", // section title

	       [ // array of menu items

		       // Item starting with "!" is the current one.
		       // It will gain an additional CSS class (item-disabled).
		       // It's best to only have _one_ item like this for the whole menu.

		       // order:
		       //    1: menu item label
		       //    2: url for this menu item
		       //    3: the "title" attribute (tooltip)
		       //    4: path to an icon for the menu item (null or "" for no icon)

		       // 1                        2                 3                                      4
		       // label                    url               tooltip                                icon
		       [  L("Basic Immigration Facts"), "../learn_about_the_system/basic_immigration_facts/", "Detailed summary of important immigration information"],
		       [  L("Frequently Asked Questions"), "../learn_about_the_system/frequent_questions/",   "Answers to common questions about immigration"],
		       [  L("Criminal Penalties"), "../learn_about_the_system/criminal_penalties/", "Penalties associated with illegal immigration activity"],
		       [  L("DV Lottery Information"),  "../learn_about_the_system/dv_lottery_information/",  "Details regarding the Diversity Visa Lottery"]
		       ]);

new NavSection(menu, "Utilize The AV Network", [
		       [ L("Directory of Attorneys"), "../the_av_network/list_of_attorneys/", "Names and bios of AV attorneys" ],
		       [ L("Consult an Attorney"), "../the_av_network/consultation_policy/", "How to meet with an AV attorney" ],
		       [ L("Office Locations"), "../the_av_network/office_locations/", "Where AV attorneys office" ],
		       [ L("Do I Need A Lawyer?"), "../the_av_network/do_i_need_a_lawyer/", "When is legal representation appropriate?" ]
		       ]);

new NavSection(menu, "Healthcare Professionals", [
		       [ "Physicians", "../healthcare_professionals/physicians/", "Information for medical doctors" ],
		       [ "Health Care Certifications", "../healthcare_professionals/healthcare_certifications/", "Information for other healthcare professionals" ]/*,
		       [ "Physical Therapists (Coming Soon!)", "../healthcare_professionals/physical_therapists/", "Information for physical therapists coming soon" ],
		       [ "Occupational Therapists (Coming Soon!)", "../healthcare_professionals/occupational_therapists/", "Information for occupational therapists coming soon" ]*/
		       ]);

new NavSection(menu, "Chronicles and Updates", [
		       [ "Current AV Chronicle", "../chronicles_and_updates/chronicles/current.htm", "Most recently published Americanvisas.com Chronicle" ],
			null,
		       [ "AV Chronicle Archive", "../chronicles_and_updates/chronicles", "Americanvisas.com Chronicle since 2000"],
		       [ "Other News and Updates", "../chronicles_and_updates/updates", "Immigration news and updates"],
			   [ "Processing Times", "../chronicles_and_updates/processing_times", "USCIS processing status"]
		       ]);

new NavSection(menu, "Search", "search-section"); // look in the HTML code for a DIV with ID="html-section"

// second section
new NavSection
(menu, "Links",
 [
	 [ "Employment Opportunities", "../links/employment_opportunities", "Employment Opportunities"],
	 [ "Executive and Federal Agencies", "../links/executive_office_and_federal_agencies", "Executive and Federal Agencies"],
	 [ "Fedworld and GPO", "../links/fedworld_and_gpo/", "Fedworld and GPO"],
	 [ "Human Rights and Asylum", "../links/human_rights_and_asylum", "Human Rights and Asylum"],
	 [ "IRS and Taxes", "../links/irs_and_taxes", "IRS and Taxes"],
	 [ "Judicial", "../links/judicial", "Judicial"],
	 [ "Legislative", "../links/legislative", "Legislative"],
	 [ "News Services", "../links/news_services", "News Services"],
	 [ "International Students", "../links/student_links", "Student Links"],
	 [ "Summaries of US Immigration Law", "../links/summaries", "Summaries of US Immigration Law"],
	 [ "US Citizen Services", "../links/us_citizen_services", "US Citizen Services"],

]);

new NavSection
(menu, "En Espa&ntilde;ol",
 [
	 [ "Datos Generales de Migraci&oacute;n", "../spanish/facts.htm"],
	 [ "Directorio de Abogados de Migracion", "../spanish/who.htm"],
	 [ "Informaci&oacute;n de la Consultaci&oacute;n Inicial de Migraci&oacute;n", "../spanish/contact.htm"],
	 [ "Pena Criminal", "../spanish/crime.htm"],
	 [ "&iquest;Necesito un Abogado?", "../spanish/need.htm"]

]);
// note, the last 4 links above open in a window with the name "_blank"--that is, a new window ;-)

//  label            url                                       tooltip                     icon

// call generate to create the menubar
menu.generate(false, true);
menu.sync(true);

// set current values in preferences panel

/*function comboSelectValue(c, val) {
	var ops = c.getElementsByTagName("option");
	for (var i = 0; i < ops.length; ++i) {
		var op = ops[i];
		op.selected = (op.value == val);
	}
};

document.getElementById("autohide").checked = menu.prefs["auto-hide"];
document.getElementById("monosection").checked = menu.prefs["mono-section"];
document.getElementById("tooltips").checked = menu.prefs["tooltips"];
comboSelectValue(document.getElementById("animation"), menu.prefs["animation"]);
*/
menu.prefs["mono-section"] = true
menu.prefs["animation"] = 2
menu.prefs["tooltips"] = true
menu.prefs["auto-hide"] = false
