var ER_menu=[	
	"Home", "index.html", 
	"Topic", "topic.html", 
	"", "",
	"Conference-at-a-Glance", "conference_at_glance.html",
	"Technical Program", "conference_program.html",
	"Keynote Speakers", "plenary_speak.html",
	"Workshops", "workshops.html",
	"Tutorials", "tutorials.html",
	"Posters & Tool Demos", "posters_demos.html", 
	"Doctoral Symposium", "doctoral_symp.html", 
	"Panels", "panels.html", 
	"Mini-Tutorials", "min_tutorials.html", 
	"Exhibitions", "tool_exhibitions.html",
	"Submissions (Closed)", "call_for_participation.html", 
	"MENU_BEGIN",
		"Research Track", "research_track.html",
		"Industrial Practice and Experience Track", "industrial_track.html",
		"Workshops", "workshops_proposals.html", 
		"Tutorials", "tutorials_proposals.html",
		"Doctoral Symposium", "doctoral_symp_submissions.html",
		"Posters &amp; Demos", "posters_demos_submissions.html", 
		"Student Volunteers", "student_volunteer.html",
		"Tool Exhibitions", "tool_exhibitions_submissions.html", 
	"MENU_END",
	"Important Dates", "important_dat.html", 
	"", "",
	"Venue", "venue.html",
	"About Barcelona", "barcelona.html",
	"Hotel", "hotel_book.html",
	"Social Events", "social_events.html",
	"Registration", "registration.html",
	"", "",
	"Conference Organization", "conference_org.html",
	"RE Conference Series", "re_conference.html",
	"", "", 
	"Noticias Locales", "http://blogs.dfwikilabs.org/re08/"
];

var RE_menu_sep_lvl=["10","5"];
var RE_menu_act_lvl=["box1verd", "box3verd"];
var RE_menu_label_lvl=["box1", "box3verd-r"];
var RE_menu_noact_lvl=["box1", "box2verd"];

function add_mailto(name, domain)
{
 document.write('<a href=mailto:' + name + '@' + domain + '>' + name + '@' + domain + '</a>');
}

function add_alias_mailto(alias, name, domain)
{
 document.write('<a href=mailto:' + name + '@' + domain + '>' + alias + '</a>');
}

function add_alias_mailto_subject(alias, name, domain, subject)
{
 document.write('<a href=mailto:' + name + '@' + domain + '?subject=' + subject + '>' + alias + '</a>');
}

function add_menu_header()
{
    document.write('<td width="205" align="left" valign="top" bgcolor="#669900" class="justified">');
	document.write('  <table width="209" border="0" align="left">');
    document.write('    <tr><td align="left" valign="top">&nbsp;</td></tr>');
}

function add_menu_footer()
{
    document.write('  </table>');
	document.write('</td>');
}

function add_menu_separation(level)
{
	document.write('    <tr><td align="left" valign="top" height='+RE_menu_sep_lvl[level]+'></td></tr>');
}

function add_menu_active(name, level)
{
	document.write('    <tr><td align="left" valign="top" class="'+RE_menu_act_lvl[level]+'">'+name+'</td></tr>');

}

function add_menu_label(name, level)
{
	document.write('    <tr><td align="left" valign="top" class="'+RE_menu_label_lvl[level]+'">'+name+'</td></tr>');

}

function add_menu_no_active(name, url, level)
{
	document.write('    <tr><td align="left" valign="top" class="'+RE_menu_noact_lvl[level]+'"><a href="'+url+'">'+name+'</a></td></tr>');
}

function add_menu(route)
{
	var x=0, level=0;
	var active=route[route.length-1];
	add_menu_header();
	while(x < ER_menu.length)
	{
		if(ER_menu[x] == "MENU_END" || ER_menu[x] == "MENU_END_LABEL")
			level--;
		else if(ER_menu[x] == "MENU_BEGIN")
			if(ER_menu[x-2] != route[level])
				while(ER_menu[x] != "MENU_END")
					x++;
			else level++;
		else if(ER_menu[x] == "MENU_BEGIN_LABEL")
			level++;
		else
		{
			if(ER_menu[x] == "")
				add_menu_separation(level);
			else if(ER_menu[x+1] == "LABEL")
				add_menu_label(ER_menu[x], level);
			else if(active == ER_menu[x] && level == route.length-1)
				add_menu_active(ER_menu[x], level);
			else
				add_menu_no_active(ER_menu[x], ER_menu[x+1], level);
			x++;
		}
		x++;
	}		
	add_menu_footer();
}

function add_top_menu()
{
	document.write('<span bordercolor="#336600">');
	document.write('  <a type="application/rss+xml" href="http://sites.upc.edu/~www-gessi/re08/news.xml">');
	document.write('    <img src="IMATGES/feed-icon-16.gif" alt="RSS" width="12" height="12" border="0" align="texttop" longdesc="news.xml">');
	document.write('  </a>');
	document.write('  <span><font face="Arial, Helvetica, sans-serif">I</font></span> ');
	document.write('  <a href="news.html">News</a> ');
	document.write('  <span><font face="Arial, Helvetica, sans-serif">I</font></span> ');
	document.write('  <a href="contact.html">Contact</a> ');
	document.write('  <span><font face="Arial, Helvetica, sans-serif">I</font> </span> ');
	document.write('  <a href="sponsors.html">Sponsors</a> ');
	document.write('  <span><font face="Arial, Helvetica, sans-serif">I</font> </span> ');
	document.write('  <a href="downloads.html">Downloads</a> ');
	document.write('</span>');
}

