
function SetCookiePopup(strName, strValue, strExpires, strPath, strDomain, strSecure)
{
  document.cookie = strName + "=" + escape(strValue) +
    ( (strExpires) ? ";expires=" + strExpires.toGMTString() : "") +
    ( (strPath)    ? ";path="    + strPath                  : "") +
    ( (strDomain)  ? ";domain="  + strDomain                : "") +
    ( (strSecure)  ? ";secure"                              : "");
}

function GetCookiePopup(strName)
{
  var iStart = document.cookie.indexOf(strName + "=");
  var iLen   = iStart + strName.length + 1;
  if ((!iStart) && (strName != document.cookie.substring(0, strName.length))) { return null; }
  if (iStart == -1) { return null; }
  var iEnd = document.cookie.indexOf(";", iLen);
  if (iEnd == -1) { iEnd = document.cookie.length; }
  return(unescape(document.cookie.substring(iLen, iEnd)));
}

if (
  (GetCookiePopup('LCCMS_P_O_P_U_P_') == null) &&
  (typeof(JSGenericMenuItems) != 'undefined') &&
  (typeof(JSGenericMenuItemWidth) != 'undefined') &&
  (JSGenericMenuItems.length > 2)) {
  var iItems = Math.floor(JSGenericMenuItems.length / JSGenericMenuItemWidth);
  var iItem = 2;
  if (iItems > 1) {
    iItem = Math.round(Math.random() * (iItems - 1)) * JSGenericMenuItemWidth + 2;
  }
  var winPopup = null;
  winPopup = (bChicken=1)                                                                                                                                                                                                ;
  if (winPopup) {
    winPopup.focus();
    SetCookiePopup('LCCMS_P_O_P_U_P_', 'LCCMS');
  }
}


