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] = getAfrica();
		c[1] = getAsia();
		c[2] = getEurope();
		c[3] = getNAmerica();
		c[4] = getSAmerica();
		
		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=\"_new\">" + 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] = getAfrica();
	c[1] = getAsia();
	c[2] = getEurope();
	c[3] = getNAmerica();
	c[4] = getSAmerica();
	
	//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=\"_new\">" + c[i][x][0] + "</a><br>";
			html += "<li><a href=\"" + c[i][x][1] + "\" target=\"_new\">" + c[i][x][0] + "</a></li>";
		}
		html += "</ul>";
		
		if (i == 0) { document.getElementById('Africa').innerHTML = html; }
		if (i == 1) { document.getElementById('Asia').innerHTML = html; }
		if (i == 2) { document.getElementById('Europe').innerHTML = html; }
		if (i == 3) { document.getElementById('NAmerica').innerHTML = html; }
		if (i == 4) { document.getElementById('SAmerica').innerHTML = html; }
	}
}
