/*
Initialize and render the MenuBar when its elements are ready to be scripted.
*/

YAHOO.util.Event.onContentReady("navSubGlobal", function () {
	
	/*
	Instantiate a MenuBar:  The first argument passed to the 
	constructor is the id of the element in the page 
	representing the MenuBar; the second is an object literal 
	of configuration properties.
	*/
	
	var oMenuBar = new YAHOO.widget.MenuBar("navSubGlobal", { 
	                                autosubmenudisplay: true, 
	                                showdelay: 10,
	                                hidedelay: 750, 
	                                lazyload: true });
	
	/*
    Define an array of object literals, each containing 
    the data necessary to create a submenu.
*/

var aSubmenuData = [
	{
		id: "aboutus", 
		itemdata: []
	},
	{
		id: "disclosure",
		itemdata: [
		    { text: "SEC 'No Action' Letter", url: "/dacContent/secLetter.jsp" },
		    { text: "DAC Patent", url: "javascript:openPDFLink('/dacContent/dacPatent.pdf')" },
			{ text: "Annual DDAA", url: "javascript:openPDFLink('/dacContent/Dislosure%20Library/DDAAStandardAnnual.pdf')" },
			{ text: "Annual DDAA Instructions", url: "javascript:openPDFLink('/dacContent/Dislosure%20Library/DDAAStandardAnnualInstructions.pdf')" },
			{ text: "Quarterly DDAA", url: "javascript:openPDFLink('/dacContent/Dislosure%20Library/DDAAStandardQuarterly.pdf')" },
			{ text: "Quarterly DDAA Instructions", url: "javascript:openPDFLink('/dacContent/Dislosure%20Library/DDAAStandardQuarterlyInstructions.pdf')" },
			{ text: "Conduit DDAA", url: "javascript:openPDFLink('/dacContent/Dislosure%20Library/DDAAConduit.pdf')" },
			{ text: "Conduit DDAA Instructions", url: "javascript:openPDFLink('/dacContent/Dislosure%20Library/DDAAConduitInstructions.pdf')" },
			{ text: "Conduit Quarterly DDAA", url: "javascript:openPDFLink('/dacContent/Dislosure%20Library/DDAAConduitQuarterly.pdf')" },
			{ text: "Conduit Quarterly DDAA Instructions", url: "javascript:openPDFLink('/dacContent/Dislosure%20Library/DDAAConduitQuarterlyInstructions.pdf')" },
			{ text: "DDAA / CDA Supplement", url: "javascript:openPDFLink('/dacContent/Dislosure%20Library/DDAASupplement.pdf')" }
		]
	},
	{
		id: "regulatory",
		itemdata: [
			{ text: "IRS Launches Compliance Check Questionnaire ", url: "javascript:openPDFLink('http://www.irs.gov/taxexemptbond/article/0,,id=239689,00.html','irsq')" },

			{ text: "SEC Proposed Rule Registration of Municipal Advisors", url: "javascript:openPDFLink('/dacContent/Regulatory/SECProposedRuleRegiofMuniAdvisors.pdf')" },

			{ text: "IRS FAQs Record Retention", url: "javascript:openPDFLink('/dacContent/IRSGuidanceDocs/IRS-TEB_FAQs_Record_Retention_10-15-10.pdf')" },
			{ text: "SEC Release No.34-62184A (Amendment to Municipal Securities Disclosure)", url: "javascript:openPDFLink('http://www.sec.gov/rules/final/2010/34-62184a.pdf','secam')" },
			{ text: "MSRB Notice 2010-32 (EMMA Modifications)", url: "javascript:openPDFLink('http://msrb.org/Rules-and-Interpretations/Regulatory-Notices/2010/2010-32.aspx?n=1','emmamod')" }, 
			
			{ text: "IRS Notice 2010-03 (Auction Rate)", url: "javascript:openPDFLink('/dacContent/Notices/IRSn-2010-3.pdf')" },
		    { text: "IRS Notice 2009-26 (BABs)", url: "javascript:openPDFLink('/dacContent/IRSGuidanceDocs/n-09-26.pdf')" },
		    { text: "IRS Notice 2009-35 (QSCBs)", url: "javascript:openPDFLink('/dacContent/IRSGuidanceDocs/n-09-35.pdf')" },
		    { text: "IRS Notice 2009-30 (QZABs) ", url: "javascript:openPDFLink('/dacContent/IRSGuidanceDocs/n-09-30.pdf')" },
		    { text: "SEC Release No.34-59061 (EMMA)", url: "javascript:openPDFLink('http://sec.gov/rules/sro/msrb/2008/34-59061.pdf')" },
		    { text: "SEC Release No.34-59062 (15c2-12 Amend)", url: "javascript:openPDFLink('http://sec.gov/rules/final/2008/34-59062.pdf')" }

		]
	},
	
	
		/* Commented out SHEBBAR 01.24.2011
		{
		id: "streamingtrades",
		itemdata: [
		    { text: "Required Software", url: "javascript:openWindowLink('')" }
		]
	},
		*/
	{
		id: "ars",
		itemdata: [
		    { text: "View Recent ARS Auctions", url: "/dacContent/todaysARSs.jsp?type=ARS" },
		    { text: "SEC Municipal ARS Letter March 14, 2008", url: "javascript:openPDFLink('/dacContent/SECmars031408.pdf')" },
		    { text: "NABL - Auction Rate Bond Market Turmoil", url: "javascript:openPDFLink('/dacContent/NABL-CAQ.PDF')" }
		]
	},
		
		/* Commented out SHEBBAR 01.24.2011	
	{
		id: "vrdo",
		itemdata: [
		    { text: "View Variable-Rate Reports", url: "/dacContent/todaysVRDOs.jsp" }
		]
	}
	*/

	{
		id: "daclibrary",
		itemdata: []
	}
];

aSubmenuData = aSubmenuData.concat(
	[
		{
			id: "otherreports",
			itemdata: []
		}
	]
);


/*
    Subscribe to the "beforerender" event, adding a submenu 
    to each of the items in the MenuBar instance.
*/

oMenuBar.subscribe("beforeRender", function () {

   if (this.getRoot() == this) {
	   for ( var i = 0; i < aSubmenuData.length; i++ ) {
		   var smd = aSubmenuData[i];
		   if ( smd.itemdata && smd.itemdata.length > 0 ) {
			   this.getItem(i).cfg.setProperty("submenu", smd);
		   }
	   }
   }

});


/*
    Call the "render" method with no arguments since the 
    markup for this MenuBar instance is already exists in 
    the page.
*/

oMenuBar.render();
});
