var r2_cnt;
var curr_row;


function SubI_Mkr(pL){

	var left_crd, top_crd, high_crd, hO, vO, bL, eL;
	bL=CBBeginSubILayer;
	eL=CBEndSubILayer;

        high_crd = 15;
        // top_crd  = -16;

	if (j%2==1) {
		hO=113;
                top_crd = r2_cnt * 16;
		r2_cnt++;
                if (this.value_name.length > 20) {
                    high_crd = 30;
		    r2_cnt++;
                }
		if (ie) {
			bL = '<TD WIDTH=1' + CBMouseOver + '></TD><TD ';
		}
	} else {
		hO = 0;
                top_crd = curr_row * 16;
		curr_row++;
                if (this.value_name.length > 20) {
                    high_crd = 30;
		    curr_row++;
                }
		if (ie) {
			eL = '</TD><TD ';
		}
	}

	// vO = -16 * r2_cnt;

	left_crd =  1 + hO;

        if (ns6) temp_s_i = bL + ' ' + CBTop + top_crd + 'px' + CBLeft + left_crd + 'px\;' + ' width\: 112px\; height\: ' + high_crd + 'px\; background-color\: ';
        else temp_s_i = bL + ' WIDTH=112 HEIGHT=' + high_crd + ' BGCOLOR="';

	if (curr_row % 2 == 1) {
		temp_s_i += Menu.SI_EVEN_BGCOLOR;
		temp_bgcolor = Menu.SI_EVEN_BGCOLOR;
	} else {
		temp_s_i += Menu.SI_ODD_BGCOLOR;
		temp_bgcolor = Menu.SI_ODD_BGCOLOR;
	}


        if (this.strgt == 'n')  {

            if (ns6) temp_s_i += '" ID="' + this.id_name + '" class="menucursor" onclick="window.open(\''+ this.url_name + '\'); return false" onmouseover="si_rovr(\'' + pL + '\', \'' + this.id_name + '\', \'' + temp_bgcolor + '\')\;" onmouseout="si_rout()\;">';
	    else temp_s_i += '" TOP=' + top_crd + ' LEFT=' + left_crd + ' ID="' + this.id_name + '" class="menucursor" onclick="window.open(\''+ this.url_name + '\'); return false" onmouseover="si_rovr(\'' + pL + '\', \'' + this.id_name + '\', \'' + temp_bgcolor + '\')\;" onmouseout="si_rout()\;">';

            if (ns6) temp_s_i += '<A CLASS="si" onclick="this.blur()" HREF="' + this.url_name + '">&nbsp\;' + this.value_name + '</A>' + eL;
	    else temp_s_i += '<A CLASS="si" onclick="this.blur()" HREF="' + this.url_name + '">&nbsp\;' + this.value_name + '</A>' + eL;

        } else {

            if (ns6) temp_s_i += '" ID="' + this.id_name + '" class="menucursor" onclick="top.location.href=\''+ this.url_name + '\'" onmouseover="si_rovr(\'' + pL + '\', \'' + this.id_name + '\', \'' + temp_bgcolor + '\')\;" onmouseout="si_rout()\;">';
	    else temp_s_i += '" TOP=' + top_crd + ' LEFT=' + left_crd + ' ID="' + this.id_name + '" class="menucursor" onclick="top.location.href=\''+ this.url_name + '\'" onmouseover="si_rovr(\'' + pL + '\', \'' + this.id_name + '\', \'' + temp_bgcolor + '\')\;" onmouseout="si_rout()\;">';

            if (ns6) temp_s_i += '<A CLASS="si" onclick="this.blur()" HREF="' + this.url_name + '">&nbsp\;' + this.value_name + '</A>' + eL;
	    else temp_s_i += '<A CLASS="si" onclick="this.blur()" HREF="' + this.url_name + '">&nbsp\;' + this.value_name + '</A>' + eL;

        }

	return temp_s_i;

}

function SubI(iN, vN, uN, strgt){
	this.id_name = iN;
	this.value_name = vN;
	this.url_name = uN;
        this.strgt = strgt;
}

SubI.prototype.mk_si = SubI_Mkr;

function SubMenu_Mkr(totr){

	var y_rows = this.s_i.length;

	curr_row=0;
	var sW;
	var col_cnt=1;

        var temphigh = 0;
	if (this.s_i.length == 0) {
		sW=1;
	} else {
		y_rows=Math.ceil(y_rows/2);
		sW=228;
		col_cnt=2;
	}

	temp_s_m = CBBeginSubMenuLayer;

        y_rows = totr;

        if (ns6) temp_s_m += ' ' + CBTop + Menu.SM_TOP_COORD + 'px' + CBLeft + '-596px\;' + ' width\:' + sW + 'px\; height\:' + (y_rows * 16 + 1) + 'px\; background-color\: ' + Menu.SM_BGCOLOR + '" ID="' + this.id_name + '" ' + CBEndSubMenuLayer;
        else  temp_s_m += ' WIDTH=' + sW + ' HEIGHT=' + (y_rows * 16 + 1) + ' BGCOLOR="' + Menu.SM_BGCOLOR + '" ID="' + this.id_name + '" ' + CBTop + Menu.SM_TOP_COORD + CBLeft + '-596' + CBEndSubMenuLayer;

	if (ns && !ns6) temp_s_m += CBBeginSubILayer + ' WIDTH=' + sW + ' HEIGHT=' + (y_rows * 16 + 1) + ' TOP=0 LEFT=0 BGCOLOR="' + Menu.SM_BGCOLOR + '" onmouseover="si_rovr()\;" onmouseout="si_rout()\;">' + CBEndSubILayer;

	r2_cnt = 0;
	for (j = 0; j < this.s_i.length; j++){
		temp_s_m += this.s_i[j].mk_si(this.id_name);
		if (j < (this.s_i.length - 1) && (j%2 == 1) && (ie)) temp_s_m += '</TR>';
	}

	if (this.s_i.length % 2 == 1 && j > 0) {

            temphigh = this.s_i.length / 2;

            if (temphigh < 1) temphigh = 0;
            else temphigh = (parseInt(this.s_i.length / 2) * 16);

            if (ns6) temp_s_m += eF + ' ' + CBTop + temphigh + 'px' + CBLeft + '114px\;' + ' width\: 112px\; height\: 15px\; background-color\: ';
            else temp_s_m += eF + ' WIDTH=112 HEIGHT=15 TOP=' + temphigh + ' LEFT=114 BGCOLOR="';

            if (this.s_i.length % 4 == 1) {
		temp_s_m += Menu.SI_EVEN_BGCOLOR;
            } else {
		temp_s_m += Menu.SI_ODD_BGCOLOR;
	    }
	    temp_s_m +=  ' onmouseover="si_rovr()\;" onmouseout="si_rout()\;">' + CBEndSubILayer;

	}

	temp_s_m += SG + CBCloseTable + CBCloseLayer;

	return temp_s_m;
}

function SubMenu(iN, vN, uM, lstrt, totr) {
	this.id_name = iN;
	this.value_name = vN;
	this.menu_url = uM;
	this.lstrt = lstrt;
        this.totalrows = totr;
	this.s_i = new Array();
}

SubMenu.prototype.mk_submenu = SubMenu_Mkr;

function MenuI_Mkr(){

        if (this.trgt == 'n')  {

            if (ns6) temp_m_i = CBBeginLayer + ' ' + CBTop + Menu.TOP_COORD + 'px' + CBLeft + left_start + 'px\; width\: ' + this.cell_width + 'px\; height\: 18px\;' + ' background-color\: ' + Menu.MI_BGCOLOR[0] + '" ID="' + this.id_name + '" onclick="window.open(\''+ this.menu_url + '\'); return false" onmouseover="mi_rovr(\'' + this.id_name + '\', \'' + this.s_m.id_name + '\','+this.lstrt + ')\;" onmouseout="mi_rout()\;" CLASS="menucursor" ' + CBEndLayer;
            else temp_m_i = CBBeginLayer + ' BGCOLOR="' + Menu.MI_BGCOLOR[0] + '" WIDTH=' + this.cell_width + ' HEIGHT=18 ID="' + this.id_name + '" onclick="window.open(\''+ this.menu_url + '\'); return false" onmouseover="mi_rovr(\'' + this.id_name + '\', \'' + this.s_m.id_name + '\',' + this.lstrt + ')\;" onmouseout="mi_rout()\;" CLASS="menucursor" ' + CBTop  + Menu.TOP_COORD + CBLeft + left_start + CBEndLayer;

	    temp_m_i += '<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 width='+this.cell_width+'><TR valign=top><td width=1 bgcolor=#5858A8><img src="/My Web Page/images/spacer.gif" height=1 width=1></td><TD width='+ (this.cell_width - 2) +' bgcolor=#88C8F8><img src="images/spacer.gif" height=1 width=1></td><td width=1 bgcolor=#5858A8><img src="images/spacer.gif" height=1 width=1></td></tr><tr valign=top><td width=1 bgcolor=#88C8F8><img src="images/spacer.gif" height=17 width=1></td><td width=' + (this.cell_width - 1) + ' colspan=2><A HREF="' + this.menu_url + '" onclick="this.blur()" CLASS="mi">&nbsp\;<B>' + this.value_name + '</B><BR><IMG SRC="/dhtml/hnavbar/images/dn_arrow.gif" height=3 width=5 border=0 hspace='+ (ns ? 3 : 5) + '></A></TD></TR></TABLE>';

        }  else  {

            if (ns6) temp_m_i = CBBeginLayer + ' ' + CBTop + Menu.TOP_COORD + 'px' + CBLeft + left_start + 'px\; width\: ' + this.cell_width + 'px\; height\: 18px\;' + ' background-color\: ' + Menu.MI_BGCOLOR[0] + '" ID="' + this.id_name + '" onclick="top.location.href=\''+ this.menu_url + '\'" onmouseover="mi_rovr(\'' + this.id_name + '\', \'' + this.s_m.id_name + '\','+this.lstrt + ')\;" onmouseout="mi_rout()\;" CLASS="menucursor" ' + CBEndLayer;
            else temp_m_i = CBBeginLayer + ' BGCOLOR="' + Menu.MI_BGCOLOR[0] + '" WIDTH=' + this.cell_width + ' HEIGHT=18 ID="' + this.id_name + '" onclick="top.location.href=\''+ this.menu_url + '\'" onmouseover="mi_rovr(\'' + this.id_name + '\', \'' + this.s_m.id_name + '\','+this.lstrt + ')\;" onmouseout="mi_rout()\;" CLASS="menucursor" ' + CBTop  + Menu.TOP_COORD + CBLeft + left_start + CBEndLayer;

	    temp_m_i += '<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 width='+this.cell_width+'><TR valign=top><td width=1 bgcolor=#5858A8><img src="/My Web Page/images/spacer.gif" height=1 width=1></td><TD width='+ (this.cell_width - 2) +' bgcolor=#88C8F8><img src="images/spacer.gif" height=1 width=1></td><td width=1 bgcolor=#5858A8><img src="images/spacer.gif" height=1 width=1></td></tr><tr valign=top><td width=1 bgcolor=#88C8F8><img src="images/spacer.gif" height=17 width=1></td><td width=' + (this.cell_width - 1) + ' colspan=2><A HREF="' + this.menu_url + '" onclick="this.blur()" CLASS="mi">&nbsp\;<B>' + this.value_name + '</B><BR><IMG SRC="/dhtml/hnavbar/images/dn_arrow.gif" height=3 width=5 border=0 hspace='+ (ns ? 3 : 5) + '></A></TD></TR></TABLE>';

        }
	left_start += this.cell_width+3;
	temp_m_i += CBCloseLayer;
	temp_m_i += this.s_m.mk_submenu(this.totr);

	return temp_m_i;

}

function MenuI(iN, vN, sM, uM, cW, lmenu, totr, trgt) {
	this.id_name = iN;
	this.value_name = vN;
	this.menu_url = uM;
	this.cell_width = cW;
	this.lstrt = lmenu;
        this.totr = totr;
        this.trgt = trgt;
	this.s_m = new SubMenu(sM, vN, uM, lmenu, totr);
}

MenuI.prototype.mk_mi = MenuI_Mkr;

function Menu_Mkr(){
	temp_menu = '';
	for (i = 0; i < this.m_i.length; i++){
		temp_menu += this.m_i[i].mk_mi();
	}
	return temp_menu;
}

function Menu(){
	this.m_i = new Array();
}

Menu.prototype.mk_menu = Menu_Mkr;

