var headers=new Array("about","pers","musings","sites","contact");
var xmlHttp;

function ovr(e)
{
	e.style.MozOpacity=0;
	e.style.filter="alpha(opacity=0)";
	e.style.opacity=0;
}
function out(e)
{
	e.style.MozOpacity=1;
	e.style.filter="alpha(opacity=100)";
	e.style.opacity=1;
}
function disp(e)
{
	document.getElementById(e).style.display="block";
	for (i=0; i<5; i++)
	{
		if (headers[i]!=e)
		{
			document.getElementById(headers[i]).style.display="none";
		}
	}
}

function getXmlHttpObject()
{
	xmlHttp=null;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch(e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function tumbl(t)
{
	document.getElementById("musContent").innerHTML=t;
}

function email(a,b,c)
{
	window.location="mailto:" + a + "@" + a + b + "." + c;
}

function callTumblr(s)
{
	xmlHttp=getXmlHttpObject();
	if (xmlHttp==null)
	{
		alert("Your browser does not support AJAX. This could cause problems.");
		document.getElementById("musContent").innerHTML="Your browser does not support AJAX. To see Carla's musings, please click <a href='http://carlablumenthal.tumblr.com' target='_blank'>here</a>.";
		return;
	}
	var url="tumbl.php?start=" + s;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged()
{
	if (xmlHttp.readyState==4)
	{
		tumbl(xmlHttp.responseText);
	}
}
