// Main menu as Javascript so that it can easily be included in all pages

function displayMenuRight(rootSite) {
document.writeln("<div id='sectionMenuRight'>"+

"	<div class='sectionMenuGroup'>"+
"		<table class='sectionSubMenuElements'>"+
"			<tr class='menuItem_L1'><td>"+
"				<span class='verySmall'><a  target='_self' class='menuItem_L1_Link' onclick='displayAllRight()'>"+
"					<span class='menuItemDescription'>Click to display all items in the menu</span>"+
"					<img src='"+rootSite+"images/navigation/expand.png'/></a></span>"+
"				<span class='verySmall'><a  target='_self' class='menuItem_L1_Link' onclick='collapseAllRight()'>"+
"					<span class='menuItemDescription'>Click to collapse all items</span>"+
"					<img src='"+rootSite+"images/navigation/collapse.png'/></a></span></td></tr>"+
"		</table>"+
"	</div>"+

"	<div class='sectionMenuGroup'>"+
"		<table class='sectionSubMenuTitle'>"+
"			<tr class='menuItem_L1'><td>"+
"				<a  target='_self' class='menuItem_L1_Link'  onclick=displayItemRight('sectionSubMenu_aboutus')>"+
"				<span class='menuItemDescription'>Click on this link for more information about us</span>"+
"				About us</a></td></tr>"+
"		</table>"+
"		<div id='sectionSubMenu_aboutus' class='sectionSubMenu'>"+
"			<table class='sectionSubMenuElements'>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/aboutus/introduction.html'>"+
"					<span class='menuItemDescription'>Who are we?</span>"+
"					Introduction</a></td></tr>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/aboutus/equipment.html'>"+
"					<span class='menuItemDescription'>Description of the equipment available at the BCRF</span>"+
"					Equipment</a></td></tr>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/aboutus/software.html'>"+
"					<span class='menuItemDescription'>Description of software available at the BCRF</span>"+
"					Software</a></td></tr>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/aboutus/computerlab.html'>"+
"					<span class='menuItemDescription'>Discover the Computer Lab of the BCRF</span>"+
"					Computer Lab</a></td></tr>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/aboutus/staff.html'>"+
"					<span class='menuItemDescription'>Bioinformatics related Staff at UNL</span>"+
"					Faculty / Staff</a></td></tr>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/aboutus/collaborators.html'>"+
"					<span class='menuItemDescription'>Our collaborators</span>"+
"					Collaborators</a></td></tr>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/aboutus/partners.html'>"+
"					<span class='menuItemDescription'>Discover our parners</span>"+
"					Partners</a></td></tr>"+
"			</table>"+
"		</div>"+
"	</div>"+

"	<div class='sectionMenuGroup'>"+
"		<table class='sectionSubMenuTitle'>"+
"			<tr class='menuItem_L1'><td>"+
"				<a  target='_self' class='menuItem_L1_Link' onclick=displayItemRight('sectionSubMenu_service')>"+
"				<span class='menuItemDescription'>Services BCRF can provide</span>"+
"				Service</a></td></tr>"+
"		</table>"+
"		<div id='sectionSubMenu_service' class='sectionSubMenu'>"+
"			<table class='sectionSubMenuElements'>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/service/description.html'>"+
"					<span class='menuItemDescription'>Description of Services offered by the Biocore facility</span>"+
"					Description</a></td></tr>"+
// "				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/service/examples.html'>"+
// "					<span class='menuItemDescription'>Examples of projects you can do</span>"+
// "					Examples</a></td></tr>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/service/charges.html'>"+
"					<span class='menuItemDescription'>Charges of Services</span>"+
"					Charges</a></td></tr>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/service/policy.html'>"+
"					<span class='menuItemDescription'>BCRF Account / Room E106 Policy</span>"+
"					Policy</a></td></tr>"+
"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/service/howtoregister.html'>"+
"					<span class='menuItemDescription'>Register now to use our services</span>"+
"					How to register?</a></td></tr>"+
"			</table>"+
"		</div>"+
"	</div>"+

"	<div class='sectionMenuGroup'>"+
"		<table class='sectionSubMenuTitle'>"+
"			<tr class='menuItem_L1'><td>"+
"				<a  target='_self' class='menuItem_L1_Link'  onclick=displayItemRight('sectionSubMenu_funding') "+
"					href='"+rootSite+"pages/funding.html'>"+
"				<span class='menuItemDescription'>Source of funding</span>"+
"				Funding</a></td></tr>"+
"		</table>"+
"			<div id='sectionSubMenu_funding' class='sectionSubMenu'>"+
"			</div>"+
"	</div>"+

"	<div class='sectionMenuGroup'>"+
"		<table class='sectionSubMenuTitle'>"+
"			<tr class='menuItem_L1'><td>"+
"				<a  target='_self' class='menuItem_L1_Link' onclick=displayItemRight('sectionSubMenu_account')>"+
"				<span class='menuItemDescription'>Crete an account in order to be able to use our services!</span>"+
"				Apply for a account</a></td></tr>"+
"		</table>"+
"			<div id='sectionSubMenu_account' class='sectionSubMenu'>"+
"				<table class='sectionSubMenuElements'>"+
	"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/account/register.php?section=doorcode'>"+
	"					<span class='menuItemDescription'>Description of Services offered by the Biocore facility</span>"+
	"					Door code</a></td></tr>"+
	"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/account/register.php?section=linuxaccount'>"+
	"					<span class='menuItemDescription'>Conferences, journals, work groups</span>"+
	"					Linux</a></td></tr>"+
	"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/account/register.php?section=rosettaaccount'>"+
	"					<span class='menuItemDescription'>Bioinformatics tools</span>"+
	"					Rosetta</a></td></tr>"+
	"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/account/register.php?section=gcgaccount'>"+
	"					<span class='menuItemDescription'>Databases available</span>"+
	"					GCG Seqweb</a></td></tr>"+
	"			</table>"+
"			</div>"+
"	</div>"+

"	<div class='sectionMenuGroup'>"+
"		<table class='sectionSubMenuTitle'>"+
"			<tr class='menuItem_L1'><td>"+
"				<a  target='_self' class='menuItem_L1_Link' onclick=displayItemRight('sectionSubMenu_faq')"+
"					href='"+rootSite+"pages/faq.html'>"+
"				<span class='menuItemDescription'>Frequently Asked Questions</span>"+
"				FAQ</a></td></tr>"+
"		</table>"+
"			<div id='sectionSubMenu_faq' class='sectionSubMenu'>"+
"			</div>"+
"	</div>"+

"	<div class='sectionMenuGroup'>"+
"		<table class='sectionSubMenuTitle'>"+
"			<tr class='menuItem_L1'><td>"+
"				<a  target='_self' class='menuItem_L1_Link' onclick=displayItemRight('sectionSubMenu_contact')"+
"					href='"+rootSite+"pages/contact.php'>"+
"				<span class='menuItemDescription'>How to contact us</span>"+
"				Contact us</a></td></tr>"+
"		</table>"+
"			<div id='sectionSubMenu_contact' class='sectionSubMenu'>"+
"			</div>"+
"	</div>"+

"	<br/>"+

"	<div class='sectionMenuGroup'>"+
"		<table class='sectionSubMenuTitle'>"+
"			<tr class='menuItem_L1'><td>"+
"				<a  target='_self' class='menuItem_L1_Link'  onclick=displayItemRight('sectionSubMenu_resources')>"+
"				<span class='menuItemDescription'>Links to bioinformatics ressources</span>"+
"				Resources</a></td></tr>"+
"		</table>"+
"			<div id='sectionSubMenu_resources' class='sectionSubMenu'>"+
"				<table class='sectionSubMenuElements'>"+
	"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/resources/atunl.html'>"+
	"					<span class='menuItemDescription'>Description of Services offered by the Biocore facility</span>"+
	"					At UNL</a></td></tr>"+
	"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/resources/aroundtheworld.html'>"+
	"					<span class='menuItemDescription'>Conferences, journals, work groups</span>"+
	"					Around the world</a></td></tr>"+
	"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/resources/tools.html'>"+
	"					<span class='menuItemDescription'>Bioinformatics tools</span>"+
	"					Tools</a></td></tr>"+
	"				<tr class='menuItem_L2'><td><a  target='_self' class='menuItem_L2_Link' href='"+rootSite+"pages/resources/databases.html'>"+
	"					<span class='menuItemDescription'>Databases available</span>"+
	"					Databases</a></td></tr>"+
	"			</table>"+
"			</div>"+
"	</div>"+

"	<div class='sectionMenuGroup'>"+
"		<table class='sectionSubMenuTitle'>"+
"			<tr class='menuItem_L1'><td>"+
"				<a  target='_self' class='menuItem_L1_Link' onclick=displayItemRight('sectionSubMenu_community')"+
"					href='"+rootSite+"pages/community.php'>"+
"				<span class='menuItemDescription'>News from the bioinformatics community</span>"+
"				Community</a></td></tr>"+
"		</table>"+
"			<div id='sectionSubMenu_community' class='sectionSubMenu'>"+
"			</div>"+
"	</div>"+
"</div>");
}


// SUBFUNCTIONS

var nbrR=7;
//var nbrR=6; 
var menuTitleRight=new Array('sectionSubMenu_aboutus',
						'sectionSubMenu_service',
						'sectionSubMenu_resources',
						'sectionSubMenu_faq',
						'sectionSubMenu_account', 
						'sectionSubMenu_contact',
						'sectionSubMenu_community');


function displayItemRight(section) {
	var style=getstyleRight(section);
	collapseAllRight();
	style.display="block";
}

function collapseAllRight() {
	for(i=0;i<nbrR;i++) {
		getstyleRight(menuTitleRight[i]).display="none";
	}
}
function displayAllRight() {
	for(i=0;i<nbrR;i++) {
		getstyleRight(menuTitleRight[i]).display="block";
	}
}

function getstyleRight(id) {
	if(document.layers)
		return document.id;
	if(document.getElementById)	{
		var obj=document.getElementById(id);
		var style=obj.style;
		return style;
	}
	if(document.all) {
		return id.style;
	}
}
