function printme2(searchstr, dest)
{
	if (document.getElementById(searchstr).value != "")
	{
		// Continental variables contain a two dimentional array with the name and URL of the blogs
		// example: africas[5]['name'] and africas[5]['url']
		var c = new Array();
		c[0] = getLieux();
		c[1] = getEcoles();
		c[2] = getReligions();        		
		c[3] = getParcs();
		c[4] = getSculptures();
		c[5] = getPeintures();		
		c[6] = getEpinettes();
		c[7] = getPyramides();
        		

		
		var results = new Array();
		var arr_counter = 0;
		var resultsHTML = "";
		
		//for (i in c)
		for (var i = 0; i < c.length; i++)
		{
			//for (x in c[i])
			for (var x = 0; x < c[i].length; x++)
			{
				var tmp = document.getElementById(searchstr).value;
				if ( c[i][x][0].substring(0, tmp.length).toLowerCase() ==  tmp.toLowerCase())
				{
					results[arr_counter] = c[i][x];
					arr_counter++;
				}
			}
		}
		
		//for (i in results)
		for (var i = 0; i < results.length; i++)
		{
			resultsHTML += "<a href=\"" + results[i][1] + "\" target=\"_top\">" + results[i][0] + "</a><br>";
		}
		
		if (results.length != 0)
		{
			resultsHTML = resultsHTML.substring(0, resultsHTML.length-2);
			resultsHTML += ".";
			document.getElementById(dest).innerHTML = resultsHTML;
		}
		
		else
		{
			document.getElementById(dest).innerHTML = "No results.";
		}
		
		
	}
	
	else
	{
		document.getElementById(dest).innerHTML = "";
	}
}

function printme(s)
{
	printme2(s, 'text');
}

function expand(submenu)
{
	if (document.getElementById(submenu).style.display == 'none')
	{
        document.getElementById(submenu).style.display = 'block';
    }
	else
	{
        document.getElementById(submenu).style.display = 'none';
    }
}

function initMenu()
{
	// Continental variables contain a two dimentional array with the name and URL of the blogs
	// example: africas[5]['name'] and africas[5]['url']
	var c = new Array();
		c[0] = getLieux();
		c[1] = getEcoles();
		c[2] = getReligions();        		
		c[3] = getParcs();
		c[4] = getSculptures();
		c[5] = getPeintures();		
		c[6] = getEpinettes();
		c[7] = getPyramides();           

	
	//for (i in c)
	for (var i = 0; i < c.length; i++)
	{
		var html = "<ul>";
		//for (x in c[i])
		for(var x = 0; x < c[i].length; x++)
		{
			//html += " &nbsp; - <a href=\"" + c[i][x][1] + "\" target=\"_top\">" + c[i][x][0] + "</a><br>";
			html += "<li><a href=\"" + c[i][x][1] + "\" target=\"_top\">" + c[i][x][0] + "</a></li>";
		}
		html += "</ul>";
		
		if (i == 0) { document.getElementById('Lieux').innerHTML = html; }		
		if (i == 1) { document.getElementById('Ecoles').innerHTML = html; }
 		if (i == 2) { document.getElementById('Religions').innerHTML = html; }		
		if (i == 3) { document.getElementById('Parcs').innerHTML = html; }
		if (i == 4) { document.getElementById('Sculptures').innerHTML = html; }
 		if (i == 5) { document.getElementById('Peintures').innerHTML = html; }	       		
		if (i == 6) { document.getElementById('Epinettes').innerHTML = html; }
		if (i == 7) { document.getElementById('Pyramides').innerHTML = html; }

	}
}
