/** Global XmlHttpRequest Object. Could be used by any function */
var xhr = new XHR();

include_once('/Scripts/forms.js');
include_once('/people/scripts/tabbedcontainers.js');

function popGuestComment()
{
	var tempHtml = '<textarea id="guestComment" style="width:300px;height:160px;'+
					' onkeypress="return checkMaxLength(event,this,255)"></textarea><br />';
	jsDialog.SetContents("Write a few words about this user",tempHtml);
	jsDialog.SetOkFunction(sendGuestComment);
	jsDialog.ShowCenter(320,240,true);
}

function sendGuestComment()
{
	var value = trim(document.getElementById('guestComment').value);
	if (value.length == 0) return;
	doPostBack('act=addcomment&member_id='+memberId+'&value='+value,'listener.php');
}

function showMemberPic(picPath)
{
	
	picPath = picPath.split('/');
	picPath = '/users_pics_old/' + picPath[picPath.length-1];
	$('alternateContainer').innerHTML = '<input type="button" onclick="hideMemberPic()" value="Back" />'+
										'<br/><br/><img src="'+picPath+'" />';
	fx.SetCallback(showMemberPicEnd);
	fx.FadeOut('mainContainer');
}

function showMemberPicEnd()
{
	$('mainContainer').style.display = 'none';
	fx.SetCallback(null);
	fx.FadeIn('alternateContainer');
}

function hideMemberPic()
{
	fx.SetCallback(hideMemberPicEnd);
	fx.FadeOut('alternateContainer');
}
function hideMemberPicEnd()
{
	$('alternateContainer').style.display = 'none';
	fx.SetCallback(null);
	fx.FadeIn('mainContainer');
}