
var popUpWin=0, popProfileWin = 0;
var popAlertMsg = "Popup Blocker detected!\r\n\r\nWe use popup windows to access e-mail, profile lookup and many other features.\r\n\r\nPlease adjust your Popup Blocker:\r\n(1) Change setting to \"block automatic popups\" only, or\r\n(2) Add this site to your \"popup windows are allowed\" list, or\r\n(3) Allow all popups.";

function popWin(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  if (width == 0) width = 550;
  if (height == 0) height = 550;
  if (left==-999) left = (screen.width - width)/2; else if (left == 0) left = 400; else if (left < 0) left = (screen.width - width) - 12;
  if (top==-999) top = (screen.height - height)/2; else if (top == 0) top = 100;
  popUpWin = window.open(URLStr, '_popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  if (window.focus && popUpWin) popUpWin.focus();
  if (!popUpWin) alert(popAlertMsg);
}

function popProfile(theMembername,KW)
{
 if(popProfileWin)
  {
    if(!popProfileWin.closed) popProfileWin.close();
  }
  var popWidth = 675;
  var popHeight = 600;
  var popLeft = (screen.width - popWidth) - 8;
  var popTop = 4;
  popProfileWin = window.open("/profile.asp?Template=N&Username="+theMembername+"&KW="+KW, 'popUpProfile', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+popWidth+',height='+popHeight+',left='+popLeft+', top='+popTop+',screenX='+popLeft+',screenY='+popTop+'');
  if (window.focus && popProfileWin) popProfileWin.focus();
  if (!popProfileWin) alert(popAlertMsg);
}

function popProfileByUID(theUID,KW)
{
 if(popProfileWin)
  {
    if(!popProfileWin.closed) popProfileWin.close();
  }
  var popWidth = 375;
  var popHeight = 300;
  var popLeft = (screen.width - popWidth) - 8;
  var popTop = 4;
  popProfileWin = window.open("/host/account/profile.asp?Template=N&UID="+String(theUID)+"&KW="+KW, 'popUpProfile', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+popWidth+',height='+popHeight+',left='+popLeft+', top='+popTop+',screenX='+popLeft+',screenY='+popTop+'');
  if (window.focus && popProfileWin) popProfileWin.focus();
  if (!popProfileWin) alert(popAlertMsg);
}

function popIM(targetID)
{
  var myID = 0;
  if (typeof(thisUID) != "undefined")
  	myID = thisUID;
  var popImWin = window.open("/userplane/launchIM.asp?DID=" + targetID, "WMWin_"+String(myID)+"_"+String(targetID), "width=380,height=750,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=1");
  if (window.focus && popImWin) popImWin.focus();
  if (!popImWin) alert(popAlertMsg);
}

