/* http://www.w3schools.com/ajax/ */
function getFeeds(site, id)
{
	var xmlhttp;
	var msg = "<p> No feeds read yet!</p>"
	try
	{
		xmlhttp = new XMLHttpRequest();
	}
	catch(e)
	{
		try
		{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try 
			{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				alert("Your browser does not support ajax!");
				return false;
			}
		}
	}
	xmlhttp.onreadystatechange = function()
	{
		if(xmlhttp.readyState == 4)
		{
			msg = xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET", site, true);
	xmlhttp.send(null);
	
	document.getElementById(id).innerHTML=msg;
}

function ajaxFunction(page)
{
	var xmlhttp;
	var msg = "<h1>Under Construction</h1><p>This link is under construction! Please visit again.</p>"
	try
	{
		xmlhttp = new XMLHttpRequest();
	}
	catch(e)
	{
		try
		{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try 
			{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				alert("Your browser does not support ajax!");
				return false;
			}
		}
	}
	xmlhttp.onreadystatechange = function()
	{
		if(xmlhttp.readyState == 4)
		{
			var lis = document.getElementsByTagName("li");
			var i;
			for(i=0;i<lis.length;i++) 
			{
				lis[i].className = "none";
			}
			document.getElementById(page).className = "active";
			if(xmlhttp.status == 200)
				msg = xmlhttp.responseText;
			document.getElementById('content').innerHTML = msg;
		}
	}
	xmlhttp.open("GET", page+".html", true);
	xmlhttp.send(null);
}

/*ajaxFunction('home');*/

window.onload=show;
function show(id) 
{
	var d = document.getElementById(id);
	for(var i=1;i<=10;i++)
	{
		if(document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
	if(d) {d.style.display='block';}
}

