//--**************************************************************
//--Declare variables
var sw = screen.availWidth;
var sh = screen.availHeight;
var locDefault_fasb = "http://www.1800net.com/nprc/nprc_bottom.asp"
var locDefault_omb = "http://www.1800net.com/nprc/nprc_bottom.asp"
var locDefault_other = "http://www.1800net.com/nprc/nprc_bottom.asp"
var dbPage_fasb = new Array();
var dbPage_omb = new Array();
var dbPage_other = new Array();
function addItem(sLocation, sName) {
   this.location = sLocation;
   this.name = sName;
 }
//--**************************************************************
//--**************************DATABASE****************************
//--**************************************************************

//--***************************FASB*******************************
dbPage_fasb[1] = new addItem(locDefault_fasb, "Financial Acctg Stds Menu");
dbPage_fasb[2] = new addItem("http://www.1800net.com/nprc/fasb116.html", "FASB-116");
dbPage_fasb[3] = new addItem("http://www.1800net.com/nprc/fasb117.html", "FASB-117");
dbPage_fasb[4] = new addItem("theFASB", "Fin Acctg Stds Board");
dbPage_fasb[5] = new addItem("theGASB", "Govt Acctg Stds Board");
//--****************************OMB*******************************
dbPage_omb[1] = new addItem(locDefault_omb, "OMB Circulars Menu");
dbPage_omb[2] = new addItem("http://www.whitehouse.gov/omb/circulars/a021/a21_2004.html", "&nbsp;&nbsp;A-021 Cost Princ for Ed Inst");
dbPage_omb[3] = new addItem("http://www.whitehouse.gov/omb/circulars/a050/a050.html", "&nbsp;&nbsp;A-050 Audit Followup");
dbPage_omb[4] = new addItem("http://www.whitehouse.gov/omb/circulars/a089/a089.html", "&nbsp;&nbsp;A-089 Cat of Fed Dom Asst");
dbPage_omb[5] = new addItem("http://www.whitehouse.gov/omb/circulars/a110/a110.html", "&nbsp;&nbsp;A-110 Admin Reqmts");
dbPage_omb[6] = new addItem("http://www.whitehouse.gov/omb/circulars/a119/a119.html", "&nbsp;&nbsp;A-119 Dev & Use of Vol Stds");
dbPage_omb[7] = new addItem("http://www.whitehouse.gov/omb/circulars/a122/a122_2004.html", "&nbsp;&nbsp;A-122 Cost Principles");
dbPage_omb[8] = new addItem("http://www.whitehouse.gov/omb/circulars/a123/a123_rev.html", "&nbsp;&nbsp;A-123 Mgmt Acct & Control");
dbPage_omb[9] = new addItem("http://www.whitehouse.gov/omb/circulars/a127/a127.html", "&nbsp;&nbsp;A-127 Fin Mgmt Systems");
dbPage_omb[10] = new addItem("http://www.whitehouse.gov/omb/circulars/a133/a133.html", "&nbsp;&nbsp;A-133 Audits");
dbPage_omb[11] = new addItem("http://www.whitehouse.gov/omb/circulars/a134/a134.html", "&nbsp;&nbsp;A-134 Fin Acctg Princ & Stds");
dbPage_omb[12] = new addItem("http://www.whitehouse.gov/omb/circulars/a136/a136_rev_2005.pdf", "&nbsp;&nbsp;A-136 Financial Reporting Requirements");
dbPage_omb[13] = new addItem("http://www.whitehouse.gov/omb/circulars/index.html", "&nbsp;&nbsp;Circulars Related To:");
dbPage_omb[14] = new addItem("http://www.whitehouse.gov/omb/circulars/index-budget.html", "&nbsp;&nbsp;&nbsp;&nbsp;Budget");
dbPage_omb[15] = new addItem("http://www.whitehouse.gov/omb/circulars/index-slg.html", "&nbsp;&nbsp;&nbsp;&nbsp;State & Local Govts");
dbPage_omb[16] = new addItem("http://www.whitehouse.gov/omb/circulars/index-education.html", "&nbsp;&nbsp;&nbsp;&nbsp;Edu & Non-Profit Orgs");
dbPage_omb[17] = new addItem("http://www.whitehouse.gov/omb/circulars/index.html", "&nbsp;&nbsp;&nbsp;&nbsp;All Circulars");
dbPage_omb[18] = new addItem("http://www.whitehouse.gov/omb/circulars/a133_compliance/01/01toc.html", "Compliance Supp-March 2001");
dbPage_omb[19] = new addItem("http://www.whitehouse.gov/omb/circulars/a133_compliance/02/02toc.html", "Compliance Supp-March 2002");
dbPage_omb[20] = new addItem("http://www.whitehouse.gov/omb/circulars/a133_compliance/03/03toc.html", "Compliance Supp-March 2003");
dbPage_omb[21] = new addItem("http://www.whitehouse.gov/omb/circulars/a133_compliance/04/04toc.html", "Compliance Supp-March 2004");
dbPage_omb[22] = new addItem("http://www.whitehouse.gov/omb/circulars/a133_compliance/05/cs5updates.html", "Compliance Supp-2005 Update");
dbPage_omb[23] = new addItem("http://www.whitehouse.gov/omb/grants/index.html", "OMB Grants Management");
dbPage_omb[24] = new addItem("http://www.whitehouse.gov/omb/", "Office Of Mgmt and Budget");
//--**************************OTHER*******************************
dbPage_other[1] = new addItem(locDefault_other, "Other Resources Menu");
dbPage_other[2] = new addItem("http://www.1800net.com/nprc/govdocs.html", "Obtaining Govt Docs");
dbPage_other[3] = new addItem("http://www.1800net.com/nprc/howto.html", "Setting Up a Non-Profit Org");
dbPage_other[4] = new addItem("http://www.cfda.gov/", "Cat of Fed Domest Assist");
dbPage_other[5] = new addItem("http://www.aicpa.org/", "American Institute of CPAs");
dbPage_other[6] = new addItem("http://www.gao.gov/", "General Accounting Office");
dbPage_other[7] = new addItem("http://www.gao.gov/govaud/ybk01.htm", "''The Yellow Book''");
dbPage_other[8] = new addItem("http://www.irs.gov/charities/index.html", "IRS Info for Exempt Orgs");
dbPage_other[9] = new addItem("inet_npo", "The Internet Nonprofit Center");
dbPage_other[10] = new addItem("jfcpa_hp", "John Farino, CPA Home Page");
//--**************************************************************
//--*********************END DATABASE*****************************
//--**************************************************************
//--Begin database verification
var totalPages_fasb = dbPage_fasb.length;
var totalPages_omb = dbPage_omb.length;
var totalPages_other = dbPage_other.length;
function verify(who) {
	var i = 0;
	if (who == "fasb") {
		for (i = 1; i < (totalPages_fasb); ++i) {
			if (!dbPage_fasb[i]) {
				alert("FASB database Item# " + i + " is missing.");
				dbPage_fasb[i]  = new addItem(locDefault_fasb, locDefault_fasb);
			}
			else {
				if (dbPage_fasb[i].location == "" || dbPage_fasb[i].location == " ") {
					alert("FASB database Item# " + i + " URL is missing.");
					dbPage_fasb[i].location = locDefault_fasb;
				}
				if (dbPage_fasb[i].name == "" || dbPage_fasb[i].name == " ") {
					alert("FASB database Item# " + i + " name is missing.");
					dbPage_fasb[i].name = dbPage_fasb[i].location;
				}
			}
		}
	}
	if (who == "omb") {
		for (i = 1; i < (totalPages_omb); ++i) {
			if (!dbPage_omb[i]) {
				alert("OMB database Item# " + i + " is missing.");
				dbPage_omb[i]  = new addItem(locDefault_omb, locDefault_omb);
			}
			else {
				if (dbPage_omb[i].location == "" || dbPage_omb[i].location == " ") {
					alert("OMB database Item# " + i + " URL is missing.");
					dbPage_omb[i].location = locDefault_omb;
				}
				if (dbPage_omb[i].name == "" || dbPage_omb[i].name == " ") {
					alert("OMB database Item# " + i + " name is missing.");
					dbPage_omb[i].name = dbPage_omb[i].location;
				}
			}
		}
	}
	if (who == "other") {
		for (i = 1; i < (totalPages_other); ++i) {
			if (!dbPage_other[i]) {
				alert("Other database Item# " + i + " is missing.");
				dbPage_other[i]  = new addItem(locDefault_other, locDefault_other);
			}
			else {
				if (dbPage_other[i].location == "" || dbPage_other[i].location == " ") {
					alert("Other database Item# " + i + " URL is missing.");
					dbPage_other[i].location = locDefault_other;
				}
				if (dbPage_other[i].name == "" || dbPage_other[i].name == " ") {
					alert("Other database Item# " + i + " name is missing.");
					dbPage_other[i].name = dbPage_other[i].location;
				}
			}
		}
	}
}
verify("fasb");
verify("omb");
verify("other");
//--End database verification

//--Begin menu program
function go(form, who) {
	var sDest
	if (who == "fasb") {
		sDest = dbPage_fasb[form.menu_fasb.selectedIndex+1].location;
		form.menu_omb.selectedIndex = 0;
		form.menu_other.selectedIndex = 0;
		form.menu_fasb.blur();
    //--pop up window items
			if (dbPage_fasb[form.menu_fasb.selectedIndex+1].location == "theFASB") {
			open("http://www.fasb.org", "_blank","height="+(sh-200)+",width="+(sw-110)+",screenX=0,screenY=0,left=0,top=0,toolbar,location,status,scrollbars,resizable");
			form.menu_fasb.blur();
			return;
			}
			if (dbPage_fasb[form.menu_fasb.selectedIndex+1].location == "theGASB") {
			open("http://www.gasb.org", "_blank","height="+(sh-200)+",width="+(sw-110)+",screenX=0,screenY=0,left=0,top=0,toolbar,location,status,scrollbars,resizable");
			form.menu_fasb.blur();
			return;
			}
    //--end pop up window items
	}
	else if (who == "omb") {
		sDest = dbPage_omb[form.menu_omb.selectedIndex+1].location;
		form.menu_fasb.selectedIndex = 0;
		form.menu_other.selectedIndex = 0;
		form.menu_omb.blur();
	}
	else if (who == "other") {
		sDest = dbPage_other[form.menu_other.selectedIndex+1].location;
		form.menu_fasb.selectedIndex = 0;
		form.menu_omb.selectedIndex = 0;
    //--pop up window items
			if (dbPage_other[form.menu_other.selectedIndex+1].location == "jfcpa_hp") {
			open("http://www.1800net.com/jfcpa/index.html", "_blank","height="+(sh-200)+",width="+(sw-110)+",screenX=0,screenY=0,left=0,top=0,toolbar,location,status,scrollbars,resizable");
			form.menu_other.blur();
			return;
			}
			if (dbPage_other[form.menu_other.selectedIndex+1].location == "inet_npo") {
			open("http://www.nonprofits.org/", "_blank","height="+(sh-200)+",width="+(sw-110)+",screenX=0,screenY=0,left=0,top=0,toolbar,location,status,scrollbars,resizable");
			form.menu_other.blur();
			return;
			}			
			if (dbPage_other[form.menu_other.selectedIndex+1].location == "email") {
			location = "mailto:nprc@1800net.com"
			form.menu_other.blur();
			return;
			}
    //--end pop up window items
		form.menu_other.blur();
	}
	parent.nprc_bottom.location = sDest;
	self.focus();
}