// Copyright IBM Corp. 2002, 2008  All Rights Reserved.
var NOSAMETIME=-1;var OFFLINE=0;var ACTIVE=32;var AWAY=64;var AWAY2=96;var NODISTURB=128;var ACTIVEMOBILE=544;var AWAYMOBILE=608;var linkId;var STStatus;var SametimeRunning=true;var paErrorMsg;var paProfileNotExistMsg;var conferenceName;var inviteText;var paPeople=null;var paPublicGroups=null;function loadMenus(event)
{
var peoplemenu_0=new WPSMenu('peoplemenu_0');if (isSametimeEnabled && SametimeRunning)
peoplemenu_0.addMenuItem(personMenuItem_chat,"STLinksCreateIM(linkId);","PAisChattingOK();");peoplemenu_0.addMenuItem(personMenuItem_email,"PAsendEmail();","true");if (isDiscoverEnabled && personMenuItems[linkId].profile != "")
peoplemenu_0.addMenuItem(personMenuItem_showprofile,"PAshowProfile();","true");if (isDiscoverEnabled && personMenuItems[linkId].documents != "")
peoplemenu_0.addMenuItem(personMenuItem_finddocs,"PAshowDocuments();","true");if (isSametimeEnabled && SametimeRunning)
peoplemenu_0.addMenuItem(personMenuItem_addtostlist,"PAshowAddToContactsUI([linkId], null);","true");if (typeof peoplemenu_more != "undefined")
{
var items=peoplemenu_more.items;var actions=peoplemenu_more.actions;for (i=0; i < items.length; i++)
{
peoplemenu_0.addMenuItem(items[i], actions[i], "true");};}window.peopleMenuContext=new WPSMenuContext();window.peopleMenuContext.addMenu(peoplemenu_0);window.peopleMenuContext.showMenu('peoplemenu_0', event)
};function PAisChattingOK()
{
var b=false;if (typeof STStatus != "undefined" && STStatus != null)
b=(STStatus == ACTIVE || STStatus == AWAY || STStatus == AWAY2 || STStatus == ACTIVEMOBILE || STStatus == AWAYMOBILE);return b;};function PAaddtoSTList(group)
{
STLinksAddToContactList(escapeSlashComma(linkId), group);};function PAsendEmail()
{
window.location=("mailto:"+personMenuItems[linkId].emailaddress);};function PAshowProfile()
{
window.open(personMenuItems[linkId].profile);};function PAshowDocuments()
{
var fSlash=linkId.indexOf("/");if (fSlash > -1)
{
var dsName=linkId.substr(0, fSlash);window.open(personMenuItems[linkId].documents+"?scope=2&search=" + dsName.replace(/\+/g, " ") + "&hidebns=1");}else
{
window.open(personMenuItems[linkId].documents+"?scope=2&search=" + linkId.replace(/\+/g, " ") + "&hidebns=1");};};var pa_stlinksPrivateGroups=new Array();function PAshowAddToContactsUI(people, publicGroups)
{
STLinksGetPrivateGroups();};function STLinksPrivateGroupsReceived(groups)
{
openAddToSTListJSP(groups);};function STLinksPrivateGroupsFailed(reason)
{
openAddToSTListJSP(null);};function openAddToSTListJSP(groups)
{
pa_stlinksPrivateGroups=new Array();if (groups != null && groups.length > 0)
{
pa_stlinksPrivateGroups=groups.split(";");}else
{
if (typeof pa_addtostlist_defaultGroup != "undefined")
pa_stlinksPrivateGroups[0]=pa_addtostlist_defaultGroup;else
pa_stlinksPrivateGroups[0]="Work";};window.open(personMenuItem_addtostlisturl, "pa_addtostlist", "resizable=yes,width=400,height=500,toolbar=no,status=no,menubar=no", true);};function STLinksAddToContactListFailed(reason)
{
alert(personMenuItem_addtostlistErr + ": " + reason);};function getStlinksPrivateGroups()
{
return pa_stlinksPrivateGroups;};function getAddToSTListPerson()
{
return linkId;};function STLinkClicked(person, personLinkText, status, event)
{
linkId=person;if (typeof STLinksCreateIM == "function")
STLinksCreateIM(escapeSlashComma(linkId));};function paServiceWriteSametimeLink(userName, displayName, bResolve, options)
{
if (typeof displayName == "undefined")
displayName=userName;SametimeRunning=false;var act= "STLinkClicked('" + userName.replace(/'/g, "\\'").replace(/"/g, "&quot;") + "', '', NOSAMETIME, event)";var s =" href=\"javascript:" + act + "\" onclick=\"" + act + ";return false;\"";s="<span> <A " + s + ">" + displayName + "</A> </span>";document.write(s);};function escapeQuote(str)
{
return str.replace(/'/g, "\\'");};