///////////////////////////////////////////////////////////////////////////
//
//  ULTIMATE DROPDOWN MENU VERSION 3.4.1b by Brothercake
//  http://www.brothercake.com/dropdown/ 
//
//  Link-wrapping routine by Brendan Armstrong
//  KDE modifications by David Joham
//  Opera reload/resize routine by Michael Wallner
//  http://www.wallner-software.com/
//
//  This script featured on Dynamic Drive (http://www.dynamicdrive.com)
//
///////////////////////////////////////////////////////////////////////////


// *** POSITIONING AND STYLES *********************************************



var menuALIGN = "left";		// alignment
var absLEFT = 	0;			// absolute left or right position (if menu is left or right aligned)
var absTOP = 	81; 		// absolute top position

var staticMENU = false;		// static positioning mode (ie5,ie6 and ns4 only)

var stretchMENU = false;	// show empty cells
var showBORDERS = false;	// show empty cell borders

var baseHREF = "/framework/";	// base path to .js files for the script (ie: resources/)
var zORDER = 	1000;		// base z-order of nav structure (not ns4)

var mCOLOR = 	"ffffff";	// main nav cell color
var rCOLOR = 	"ffffff";	// main nav cell rollover color
var bSIZE = 	0;			// main nav border size
var bCOLOR = 	"black"		// main nav border color
var aLINK = 	"000000";	// main nav link color
var aHOVER = 	"990000";	// main nav link hover-color (dual purpose)
var aDEC = 		"none";		// main nav link decoration
var fFONT = 	"arial";	// main nav font face
var fSIZE = 	12;			// main nav font size (pixels)
var fWEIGHT = 	"bold"		// main nav font weight
var tINDENT = 	7;			// main nav text indent (if text is left or right aligned)
var vPADDING = 	3;			// main nav vertical cell padding
var vtOFFSET = 	0;			// main nav vertical text offset (+/- pixels from middle)

var keepLIT =	true;		// keep rollover color when browsing menu
var vOFFSET = 	0;			// shift the submenus vertically
var hOFFSET = 	12;			// shift the submenus horizontally

//var smCOLOR = 	"FFCC00";	// submenu cell color (gold)
var smCOLOR = 	"EEEEEE";
var srCOLOR = 	"ffffff";	// submenu cell rollover color
var sbSIZE = 	1;			// submenu border size
var sbCOLOR = 	"black"		// submenu border color
var saLINK = 	"333333";	// submenu link color
var saHOVER = 	"990000";	// submenu link hover-color (dual purpose)
var saDEC = 	"none";		// submenu link decoration
var sfFONT = 	"arial";	// submenu font face
var sfSIZE = 	12;			// submenu font size (pixels)
var sfWEIGHT = 	"bold"		// submenu font weight
var stINDENT = 	5;			// submenu text indent (if text is left or right aligned)
var svPADDING = 1;			// submenu vertical cell padding
var svtOFFSET = 0;			// submenu vertical text offset (+/- pixels from middle)

var shSIZE =	2;			// submenu drop shadow size
var shCOLOR =	"999999";	// submenu drop shadow color (grey)
var shOPACITY = 75;			// submenu drop shadow opacity (not ie4,ns4 or opera)

var keepSubLIT = true;		// keep submenu rollover color when browsing child menu
var chvOFFSET = -12;		// shift the child menus vertically
var chhOFFSET = 7;			// shift the child menus horizontally

var closeTIMER = 200;		// menu closing delay time

var cellCLICK = true;		// links activate on TD click
var aCURSOR = "hand";		// cursor for active links (not ns4 or opera)

var altDISPLAY = "";		// where to display alt text
var allowRESIZE = false;	// allow resize/reload

var redGRID = false;		// show a red grid
var gridWIDTH = 0;			// override grid width
var gridHEIGHT = 0;			// override grid height
var documentWIDTH = 0;		// override document width

var hideSELECT = false;		// auto-hide select boxes when menus open (ie only)
var allowForSCALING = false;	// allow for text scaling in mozilla 5

var xwid = screen.width;
xwid = xwid - 5;

var dacMenuItems = [
	{
		label: "Home",
		labelwidth: 52,
		action: showStandaloneHomePageURL
	},
	{
		label: "Contact",
		labelwidth: 62,
		width: 100,
		action: "#",
		subitems: [
			{
				label: "Contact Us",
				action: "/dacContent/contactUs.jsp"
			},
			{
				label: "About Us",
				action: "/dacContent/aboutUs.jsp"
			}
		]
	},
	{
		label: "Disclosure",
		labelwidth: 78,
		width: 240,
		action: "#",
		subitems: [
		    {
		    	label: "SEC 'No Action' Letter ",
		    	action: "/dacContent/secLetter.jsp" 
		    },
		    {
		    	label: "DAC Patent",
		    	action: "/dacContent/dacPatent.pdf" 
		    },
		    {
		    	label: "Standard DDA",
		    	action: "/dacContent/Dislosure%20Library/DDAA082009.pdf",
		    	target: "_blank"
		    },
		    {
		    	label: "Standard DDA Instructions",
		    	action: "/dacContent/Dislosure%20Library/CDAposteffINSTR07022009.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "Conduit DDA",
		    	action: "/dacContent/Dislosure%20Library/DDAAConduit082009.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "Conduit DDA Instructions",
		    	action: "/dacContent/Dislosure%20Library/CDAposteffINSTRCond07022009.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "Quarterly DDA",
		    	action: "/dacContent/Dislosure%20Library/DDAAQuarterly082009.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "Notice & Amendment to DDAA",
		    	action: "/dacContent/Dislosure%20Library/DACddaamdtsec12.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "Notice & Amendment to DDAA Conduit",
		    	action: "/dacContent/Dislosure%20Library/DACddaamdtconduitsec13.pdf", 
		    	target: "_blank"
		    }
		]
	},
	{
		label: "Regulatory",
		labelwidth: 80,
		width: 275,
		action: "#",
		subitems: [
			{
		    	label: "Tax Credit Stripping Advisory",
		    	action: "/dacContent/Notices/NABLJan2010.pdf", 
		    	target: "_blank"
		    }, 
			
			{
		    	label: "MSRB Proposed EMMA Modifications",
		    	action: "/dacContent/Notices/MSRBPropChanFeb102010.pdf", 
		    	target: "_blank"
		    }, 
		
			{
		    	label: "IRS Notice 2010-03 (Auction Rate)",
		    	action: "/dacContent/Notices/IRSn-2010-3.pdf", 
		    	target: "_blank"
		    },
			{
		    	label: "SEC Proposed Amendment 34-60332",
		    	action: "/dacContent/Notices/SECpropAmmend34-60332.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "MSRB Notice 2009-44",
		    	action: "/dacContent/Notices/MSRBNotice2009-44.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "MSRB Notice 2009-43",
		    	action: "/dacContent/Notices/MSRBNotice2009-43.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "MSRB Notice 2009-42",
		    	action: "/dacContent/Notices/MSRBNotice2009-42.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "IRS Notice 2009-26 (BABs)",
		    	action: "/dacContent/IRSGuidanceDocs/n-09-26.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "IRS Notice 2009-35 (QSCBs)",
		    	action: "/dacContent/IRSGuidanceDocs/n-09-35.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "IRS Notice 2009-30 (QZABs) ",
		    	action: "/dacContent/IRSGuidanceDocs/n-09-30.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "SEC Release No.34-59061 (EMMA)",
		    	action: "http://sec.gov/rules/sro/msrb/2008/34-59061.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "SEC Release No.34-59062 (15c2-12 Amend)",
		    	action: "http://sec.gov/rules/final/2008/34-59062.pdf", 
		    	target: "_blank"
		    }
		]
	},
	{
		label: "Streaming Trades",
		requireslogin: true,
		labelwidth: 124,
		width: 125,
		action: "#",
		subitems: [
		    {
		    	label: "Required Software",
		    	action: "javascript:openWindowLink('')" 
		    }
		]
	},
	{
		label: "Index",
		labelwidth: 62,
		width: 275,
		action: "#",
		subitems: [
		    {
		    	label: "DAC Index",
		    	action: "/dacContent/dacIndex.jsp" 
		    },
		    {
		    	label: "Bond Insurer Ratings",
		    	action: "/dacContent/BondInsurerRatings102009.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "US News Best Hospitals",
		    	action: "/dacContent/US%20News%20Best%20Hospitals.pdf", 
		    	target: "_blank"
		    }
		]
	},
	{
		label: "ARS",
		labelwidth: 32,
		width: 260,
		action: "#",
		subitems: [
		    {
		    	label: "View Recent ARS Auctions",
		    	action: "/dacContent/todaysARSs.jsp?type=ARS" 
		    },
		    {
		    	label: "SEC Municipal ARS Letter March 14, 2008",
		    	action: "/dacContent/SECmars031408.pdf", 
		    	target: "_blank"
		    },
		    {
		    	label: "NABL - Auction Rate Bond Market Turmoil",
		    	action: "/dacContent/NABL-CAQ.PDF", 
		    	target: "_blank"
		    }
		]
	},
	{
		label: "VRDO",
		labelwidth: 42,
		width: 230,
		action: "#",
		subitems: [
		    {
		    	label: "View Variable-Rate Reports",
		    	action: "/dacContent/todaysVRDOs.jsp" 
		    }
		]
	}
];

if ( ftfReportsAuthorized ) {
	dacMenuItems.push (
    	{
    		label: "Compliance Report",
    		labelwidth: 134,
    		action: "/dacContent/ftfReport.jsp?filter=A"
    	}
    );
}

if ( specialReportsAuthorized ) {
	dacMenuItems.push (
    	{
    		label: "Other Reports",
    		labelwidth: 114,
    		action: "/dacAdmin/reportsMenu.jsp",
	    	target: "_blank"
    	}
    );
}

function initMenu()
{
	var topm, i = 0;
	
	menus[i++] = topm = new menu(20, "horizontal", "topmenu", 0, 52, 0, 2, "img:/framework/images/menu_bg.gif", "img:/framework/images/menu_bgon.gif", "Arial,Helvetica", 9, "bold", 
			"bold", "white", "white", 0, "white", 6, "", false, false, true, false, 0, false, 0, 0, "cccccc");

	var j, ii = 1;
	for ( j = 0; j < dacMenuItems.length; j++ ) {
		var z = dacMenuItems[j];
		if ( isLoggedIn || !z.requireslogin ) {
			var action = z.action;
			if ( action == "#" ) {
				action = "/dacContent/submenu.jsp?menu=" + escape(z.label);
			}
			var iix = 0;
			if ( z.subitems && (z.subitems.length > 0) ) {
				iix = ii++;
			}
			topm.addItem(action, z.target || "", z.labelwidth, "center", z.label, iix);
		}
	}
	
	for ( j = 0; j < dacMenuItems.length; j++ ) {
		var z = dacMenuItems[j];
		if ( isLoggedIn || !z.requireslogin ) {
			if ( z.subitems && (z.subitems.length > 0) ) {
				var m = menus[i++] = new menu(z.width, "vertical", null, 0, 0, 0, 0, "white", "#006db0", "Arial,Helvetica", 9, "", 
						"bold", "black", "white", 1, "lightblue", 2, 0, false, true, false, false, 0, false, 0, 0, "gray");
				var k, kk = 0;
				for ( k = 0; k < z.subitems.length; k++ ) {
					var y = z.subitems[k];
					if ( isLoggedIn || !y.requireslogin ) {
						if ( kk > 0 ) {
							m.addSeparator(1, "lightblue");
						}
						m.addItem(y.action, y.target || "", 18, "left", y.label, 0);
						kk++;
					}
				}
			}
		}
	}
}

var windowHandle = '';
function openWindowLink(url)
	{

		windowHandle = window.open("/msrb_ticker.html","","width="+xwid+",height=25,toolbar=no,resizable=yes,scrollbars=no");
		windowHandle.moveTo(0,0);
	}
