﻿function af_addfriend(v_uid , v_privacy ,v_gender , v_isfriend)
{
	if(v_isfriend == 1 || v_isfriend == 3 || v_privacy == "1")
	{
		openWindow('/friend/new.php?touid='+v_uid, 330, 153, '加为好友');
	}
	else
	{
		openWindow('/friend/new.php?touid='+v_uid, 430, 250, '请求加'+(v_gender=="0"?"他":"她")+'为好友');
	}
}

function af_addverify_do(v_touid , v_content)
{
	if(v_content.length == 0)
	{
		alert("请输好友附加消息!");
		return false;
	}
	document.addverifyform.touid.value = v_touid;
	document.addverifyform.content.value = v_content;
	document.addverifyform.submit();
}


function af_delfriend(v_uid, v_start)
{
	openWindow('/friend/del_dialog.php?touid='+v_uid+'&start='+v_start, 440, 180, '删除好友');
}

function af_delfriend_do(v_uid, v_start)
{
	document.delfriendform.touid.value = v_uid;
	document.delfriendform.start.value = v_start;
	document.delfriendform.ref.value = window.location;
	document.delfriendform.submit();
}

function af_addform(uri)
{
	document.write('<div>');
	document.write('<form name=addverifyform action="/friend/addverify.php" method=post>');
	document.write('<input type=hidden name=from value="'+uri+'">');
	document.write('<input type=hidden name=touid value="">');
	document.write('<input type=hidden name=content value="">');
	document.write('</form>');
	document.write('</div>');
}

function af_editFriend(v_fuid)
{
	openWindow('/friend/editfriend_dialog.php?from=self&fuid='+v_fuid, 350, 350, '好友属性');
}

