var states = ['mout', 'mover', 'mdown'];
var bgcolors = ['#313c42', '#313c42', '#ffc700'];
var ftcolors = ['white', '#ccff66', 'black'];


var MENU_ITEMS = [
	[wrap_root('Home', 0),'../index.htm', null],
	[wrap_root('About',1),'../aboutus.htm', null],
	[wrap_root('Products', 1),null, null,
		[wrap_child('AVRcard'),'avrcard.htm', null],
		[wrap_child('Playground'),'playground.htm', null],
		[wrap_child('CAN-SPI Adapter'),'can_adapter.htm', null]
	],
	[wrap_root('Services', 1), null, null,
		[wrap_child('Embedded SW Design'),'../services/embedded_sw.htm', null],
		[wrap_child('Microcontroller Design'),'../services/microcontroller.htm', null],
		[wrap_child('PCB Design'),'../services/pcb_design.htm', null],
	],
	[wrap_root('Resources', 1), null, null,
		[wrap_child('Design Notes'),'../design/design_notes.htm', null],
		[wrap_child('Documents'),'../resources/documents.htm', null],
		[wrap_child('Datasheets'),'../resources/datasheets.htm', null],
		[wrap_child('Development Tools'),'../resources/avrco.htm', null]
	],
	[wrap_root('Applications', 1), null, null,
		[wrap_parent('AVRcard Projects', 'r'), null, null,
			[wrap_child('MP3 Player'), '../showcase/mp3player.htm', null]],
		[wrap_child('User Showcase'),'../showcase/showcase.htm', null]
	],
	[wrap_root('Shop',1), null, null,
		[wrap_child('Hardware Products'),'products.htm', null],
		[wrap_child('Soft Products'),'soft_products.htm', null],
		[wrap_child('Terms and Conditions'),'../terms.htm', null],
		[wrap_child('Shipping Details'),'../shipping.htm', null]
	],
];

function wrap_parent (text, pos, icon) {
	var res = new Array;
	for (var i=0; i<states.length; i++)
		res[i] =  '<table cellpadding="0" cellspacing="0" border="0" bgcolor="#DBEAF5" width="100%"><tr><td><table cellpadding="3" cellspacing="1" border="0" width="100%" height="24" bgcolor="' + bgcolors[i] + '"><tr><td valign="middle" width="100%">&nbsp;' + (icon != null ? '<img src="images/'  + icon + '" height="16">&nbsp;' : '') + '<font face="tahoma, verdana, arial" color="' + ftcolors[i] + '"><span style="font-size: 11px;">' + text + '</span></font></td><td valign="middle">' + (pos != null ? '<img src="images/' + states[i] + '_' + pos + 'arrow.gif" width="12" height="12">': '') + '</td></tr></table></td></tr></table>';
	return res;
}
function wrap_child (text, icon) {
	var res = new Array;
	for (var i=0; i<states.length; i++)
		res[i] =  '<table cellpadding="0" cellspacing="0" border="0" bgcolor="#DBEAF5" width="100%"><tr><td><table cellpadding="3" cellspacing="1" border="0" width="100%" height="24"><tr><td bgcolor="' + bgcolors[i] + '" style="padding: 3px;" valign="middle">&nbsp;' + (icon != null ? '<img src="images/'  + icon + '" height="16" align="absmiddle">&nbsp;' : '') + '<font face="tahoma, verdana, arial" color="' + ftcolors[i] + '"><span style="font-size: 11px;">' + text + '</span></font></td></tr></table></td></tr></table>';
	return res;
}
function wrap_root (text, c) {
	var res = new Array;
	for (var i=0; i<states.length; i++)
		res[i] = '<table cellpadding=0 cellspacing=0 border=0 width=100% valign="middle"><tr>' + (c ? '<td><font color=white>|</font></td>' : '') + '<td valign="middle" align="center"  width=100% height=24>&nbsp;&nbsp;<font color="' + ftcolors[i] + '"><span style="font-size: 11px;">' + text + '</span></font></td></tr></table>'
	return res;
}

