function Hyperlink(s, u, l)
{
		this.section 	= s;	
		this.url 		= u;
		this.label 		= l;
}

function Menu(current_section)
{
		this.section 	= current_section;	
		this.link 		= new Array();
		
		if(current_section == "portfolio")
		{
			this.link.push(new Hyperlink("accueil", "../index.html","Accueil"));
			this.link.push(new Hyperlink("demarche", "../demarche.html","D&eacute;marche"));		
			this.link.push(new Hyperlink("portfolio", "index.php","Portfolio"));
			this.link.push(new Hyperlink("expositions",	"../expositions.html","Expositions"));
			this.link.push(new Hyperlink("cv", "../cv.html","Contact &amp; CV"));	
		}
		else
		{
			this.link.push(new Hyperlink("accueil", "index.html","Accueil"));
			this.link.push(new Hyperlink("demarche", "demarche.html","D&eacute;marche"));		
			this.link.push(new Hyperlink("portfolio", "catalogue/index.php","Portfolio"));
			this.link.push(new Hyperlink("expositions",	"expositions.html","Expositions"));
			this.link.push(new Hyperlink("cv", "cv.html","Contact &amp; CV"));	
		}
		
		this.print  = _print;	
		this.getGET = _getGET;	
		
		this.language 	= this.getGET("Lang");	
		
		if(this.language == "")
		{
			this.language = "FR";
		}
}

function _getGET(current_key)
{
	var section, token, queryStr, pair, param, key, value;

	if(location.search.indexOf("=") != -1)
	{
		queryStr = location.search;
		
		queryStr = queryStr.substring(1, queryStr.length + 1);		// Remove the initial ?.
		
		pair = new Array();
		pair = queryStr.split("&");
		
		for(var k=0; k < pair.length; k++)				
		{		
			token = new Array();								
			token = pair[k].split("=");

			key 	= token[0].toString();
			value	= token[1].toString();			
						
			if(key == current_key)
			{
				return value;
			}
		}
	}

	return "";	
}

function _print()
{
	var toggleLang, toggleLangCode;
	
	if(this.language != "FR")
	{
		toggleLang 		= "Fran&ccedil;ais";
		toggleLangCode 	= "FR";
	}
	else
	{
		toggleLang 		= "English";
		toggleLangCode 	= "EN";
	}
		
	document.write("<table border='0' width='100%' id='link_menu'>");
	document.write("<tr>");	
	
	for( var k=0; k <  this.link.length; k++ )				
	{							
		var section 		= this.link[k].section;								
		var url   			= this.link[k].url + "?Lang=" + this.language;
		var label 			= this.link[k].label;
		
		if(section == this.section)
		{							
			document.write("<td class='text' id='current'><span id='current'>" + label + "</span></td>");	
			document.write("<td class='text'><img src='images/square.gif' width='8' style='margin-left:5px; margin-top:2px;'></td>");		
		}
		else
		{							
			document.write("<td class='text'><a href=\"" + url + "\">" + label + "</a></td>");	
		}

		if(k != this.link.length-1) document.write("<td class='spacer'>&nbsp;</td>");			
	}
	
	//document.write("<td>&nbsp;</td>");		
	//document.write("<td align='right' class='text'><a href='?Lang=" + toggleLangCode + "'>" + toggleLang + "</a></td>");		
	  
	document.write("</tr>");
	document.write("</table>");	  
}
