for (i=0;i<menu_arr.length;i++) {
	eval('var ' + menu_arr[i][2] + 'off = new Image();');
	eval('var ' + menu_arr[i][2] + 'on = new Image();');
	eval(menu_arr[i][2] + 'off.src = "' + img_path + menu_arr[i][0] + '";');
	eval(menu_arr[i][2] + 'on.src = "' + img_path + menu_arr[i][1] + '";');
}

var off_timer;

function ol(lyr, idx, parent) {
	clearTimeout(off_timer);

	lyr.style.backgroundColor='#6B6BB7';
	lyr.style.color='#FFFFFF';
	if (idx > -1) {
		cls(idx,menu_arr[idx][4]);
		if (menu_arr[idx][5] == '') {
			menu_arr[idx][5] = lyr;
		}
		var img = eval('document.top_' + idx);
		var img_src = eval(menu_arr[idx][2] + 'on.src');
		if (img.src != img_src) {
			img.src = img_src;
		}
		eval('document.getElementById("sub_' + idx + '").style.visibility = "visible"');
	} else {
		cls(parent,menu_arr[parent][4]);
	}
}

function cl(lyr, idx) {
	if (idx == -1) {
		lyr.style.backgroundColor='#E1E1FF';
		lyr.style.color='#000000';
	}
	off_timer = setTimeout("cls(-1,-1)",500);
}

function cls(o1, o2) {
	for (i=0;i<menu_arr.length;i++) {
		if (i != o1 && i != o2) {
			if (menu_arr[i][5] != '') {
				if (menu_arr[i][4] == -1) {
					if (menu_arr[i][2] != section) {
						menu_arr[i][5].style.backgroundColor = '#000000';
					}
				} else {	
					menu_arr[i][5].style.backgroundColor = '#E1E1FF';
					menu_arr[i][5].style.color='#000000';
				}
			}
			if (menu_arr[i][2] != section) {
				var img = eval('document.top_' + i);
				var img_src = eval(menu_arr[i][2] + 'off.src');
				if (img.src != img_src) {
					img.src = img_src;
				}
			}
			eval('document.getElementById("sub_' + i + '").style.visibility = "hidden"');
		}
	}
}

function menu() {		
	for(j=0;j<menu_arr.length;j++) {

		document.write('<div id="sub_' + j + '">');
		document.write('<table cellpadding="0" cellspacing="0" border="0" width="' + menu_arr[j][3][0] + '">');
		if(menu_arr[j][3][1] != '') {
			document.write('<tr><td height="' + menu_arr[j][3][1] + '" colspan="1"><spacer type="block" height="' + menu_arr[j][3][1] + '"></td></tr>');
		}
		document.write('<tr><td bgcolor="#FFFFFF"><table cellpadding="4" cellspacing="1" border="0" width="100%">');
		for(i=2;i<menu_arr[j][3].length;i++) {
			document.write('<tr><td class="nav" bgcolor="#E1E1FF" onClick="ln(\'' +  menu_arr[j][3][i][0] + '\');" onMouseover="ol(this,' + menu_arr[j][3][i][2] + ',' + j + ');" onMouseout="cl(this,' + menu_arr[j][3][i][2] + ');">');
			if (menu_arr[j][3][i][2] != '-1') {
				document.write('<table cellpadding="0" cellspacing="0" border="0" height="10" align="right"><tr><td valign="bottom"><img name="top_' + menu_arr[j][3][i][2] + '" src="' + img_path + 'arrow_subNav-up.gif"/></td></tr></table>');
			}
			document.write(menu_arr[j][3][i][1] + '</td></tr>');
		}
		document.write('</table></td></tr>');
		document.write('</table>');
		document.write('</div>');
	}
}


function top_nav() {
	var sOut =	'<tr>' +
			'	<td colspan="7" height="1"><spacer type="block" height="1"></td>' +
			'</tr>' +
			'<tr>' +
			'	<td width="1" height="23"><spacer type="block" width="1" height="23"></td>' +
			'	<td width="157" align="center" onClick="ln(\'http://us.rd.yahoo.com/launch/nav/lc/*' + srv + '/launchcast/default.asp\');" onMouseover="ol(this,0);" onMouseout="cl(this,0);" bgcolor="#';
	if (section == 'lcMenu') {
		sOut += '6B6BB7';
	} else {
		sOut += '000000';
	}
	sOut +=		'"><img name="top_0" src="' + img_path + 'but_LAUNCHcastRadio-';
	if (section == 'lcMenu') {
		sOut += 'over';
	} else {
		sOut += 'up';
	}
	sOut += 	'.gif"></td>' +
			'	<td width="1"><spacer type="block" width="1"></td>' +
			'<td width="127" align="center" onClick="ln(\'http://us.rd.yahoo.com/launch/nav/mv/*' + srv + '/musicvideos/default.asp\');" onMouseover="ol(this,1);" onMouseout="cl(this,1);" bgcolor="#';
	if (section == 'mvMenu') {
		sOut += '6B6BB7';
	} else {
		sOut += '000000';
	}
	sOut +=		'"><img name="top_1" src="' + img_path + 'but_musicVideos-';
	if (section == 'mvMenu') {
		sOut += 'over';
	} else {
		sOut += 'up';
	}
	sOut += 	'.gif"></td>' +
			'	<td width="1"><spacer type="block" width="1"></td>' +
			'<td width="138" align="center" onClick="ln(\'http://us.rd.yahoo.com/launch/nav/musicservices/main/evt=30749/*' + srv + '/musicengine/\');" onMouseover="ol(this,2);" onMouseout="cl(this,2);" bgcolor="#';
	if (section == 'readMenu') {
		sOut += '6B6BB7';
	} else {
		sOut += '000000';
	}
	sOut +=		'"><img name="top_2" src="' + img_path + 'but_musicservices-';
	if (section == 'readMenu') {
		sOut += 'over';
	} else {
		sOut += 'up';
	}
	sOut += 	'.gif"></td>' +
			'	<td width="1"><spacer type="block" width="1"></td>' +
			'<td width="89" align="center" onClick="ln(\'http://us.rd.yahoo.com/launch/nav/artist/*' + srv + '/artist/default.asp\');" onMouseover="ol(this,3);" onMouseout="cl(this,3);" bgcolor="#';
	if (section == 'readMenu') {
		sOut += '6B6BB7';
	} else {
		sOut += '000000';
	}
	sOut +=		'"><img name="top_3" src="' + img_path + 'but_artists-';
	if (section == 'readMenu') {
		sOut += 'over';
	} else {
		sOut += 'up';
	}
	sOut += 	'.gif"></td>' +
			'	<td width="1"><spacer type="block" width="1"/></td>' +
			'</tr>';
	document.write(sOut);
}