var xmlhttp;

function setupMemberPage() 
{
    getMemberProfile(0,0,0);
}

function getMemberProfile(yr, mem, pic)
{
    xmlhttp=GetXmlHttpObject();
    if (xmlhttp==null) {
	alert ("Your browser does not support AJAX!");
	return;
    }
    var url="member_profile.php";
    url=url+"?yr="+yr;
    url=url+"&mem="+mem;
    url=url+"&pic="+pic;
    xmlhttp.onreadystatechange=stateChanged;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}

function stateChanged()
{
    if (xmlhttp.readyState==4) {
	document.getElementById("mem_profile").innerHTML
	    = xmlhttp.responseText;
    }
}

function GetXmlHttpObject() 
{
    if (window.XMLHttpRequest) {
	// code for IE7+, Firefox, Chrome, Opera, Safari
	return new XMLHttpRequest();
    }
    if (window.ActiveXObject) {
	// code for IE6, IE5
	return new ActiveXObject("Microsoft.XMLHTTP");
    }
    return null;
}

function toggleLayer( whichLayer )
{
    var elem, vis;
    if( document.getElementById ) // this is the way the standards work
	elem = document.getElementById( whichLayer );
    else if( document.all ) // this is the way old msie versions work
	elem = document.all[whichLayer];
    else if( document.layers ) // this is the way nn4 works
	elem = document.layers[whichLayer];
    vis = elem.style;
    // if the style.display value is blank we try to figure it out here
    if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
    vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function togProfile()
{
    toggleLayer("profileFav");
    toggleLayer("profileMore");
    toggleLayer("profileLess");
}

