﻿// JScript File
function KGSignInControl_CallbackTrigger_Wrapped(actionToken, cbreference)
{
  var args = "action=" + actionToken;
  
  if(cbreference != null)
  {
    eval(cbreference); 
  }
}

function KGSignInControl_CallbackDone(args, context)
{
  // Check for a session time out before completing the callback
  if (CheckSessionTimeout())
    return;
  
  alert('A copy of the activation email has been sent to you. Thank you.');
  ToggleLoginControl(0);
  
  WM_killCookie('LoginStatus');
}

function KGSignInControl_CallbackError(args, context)
{

}

function KGSignInControl_Position(e)
{
  //make sure it isn't off the page
  var x = e.x || e.pageX;
  var y = e.y || e.pageY;
  
  xPos = x<450?0:x-450;
 
  yPos = y + 10;
  var maxY = document.body.clientHeight - 180;
  if (maxY > 0 && yPos > maxY)
      yPos = maxY;
      
  UpdateKGSignInControlPos('absolute',xPos,yPos);
}

function KGSignInControl_Show(e)
{
  // this session property is used by the register page
  //    setting it here is a performance hit (triggers a call to the server) but it's already been coded like this elsewhere
  SetSessionProperty('ReturnURL', '');
  KGSignInControl_Position(e);
  ToggleLoginControl(SrmControl_SetInitial('ViewLoginBox'));
}
