// JavaScript Document

var xmlHttpfunction;

function updateNumber(id, highlight) {
	if (highlight)
		document.getElementById(id).style.backgroundImage = "url('/images/photo-nr-bg.jpg')";
	else
		document.getElementById(id).style.backgroundImage = "";
}

function loadPage(url) {
	document.getElementById("tabs").style.display = 'none';
	document.getElementById("prop_content").style.display = 'none';
	document.getElementById("friend_content").innerHTML = "<div style=\"text-align: center; width: 600px\"><img src=\"/graphics/loader.gif\" alt=\"Loading page...\" /></div>";
	document.getElementById("friend_content").style.display = 'block';
	
	xmlHttp		= GetXmlHttpObject();
	if (xmlHttp == null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	url		= url + "&sid=" + Math.random();
	xmlHttp.onreadystatechange	= stateChanged;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}


function goBack() {
	document.getElementById("friend_content").style.display = 'none';
	document.getElementById("tabs").style.display = 'block';
	document.getElementById("prop_content").style.display = 'block';
}




function GetXmlHttpObject() {
	var xmlHttp=null;
	try
	{
	// Firefox, Opera 8.0+, Safari
	xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		//Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function stateChanged() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState == "complete") {
		document.getElementById("friend_content").innerHTML = xmlHttp.responseText;
		//document.getElementById("friend_content").style.display = 'block';
	} 
}
