/*
*/

// constants
//var ixPROJECTS_ROWID = 0;
//var goProjects = "";
//var iPROJECTS_ID = "";

//---------------------------------------------------------------

// the main class
function jclsHelp(bInit)
{
  bInit = s_Init(bInit, true);
  // methods
  this.Open = Help_Open;
  this.Init = Help_InitDo;
  this.ShowHint = Help_ShowHint;
//  this.AddProperty = Projects_AddProperty_p;
  
  //properties
  this.sPAGES_HELP = "";
  this.sTOPIC = "";
    
  if (bInit) {this.Init();}  
     
}

//---------------------------------------------------------------

function Help_InitDo()
{
  var oHelp = Help_Init();
  for (key in oHelp)
  {
    this[key] = js_GetConstant(oHelp[key], this[key]);
  }
}

/*---------------------------------------------------------*/


function Help_Open(sTopic, sSubtopic)
{  
  sTopic = s_Init(sTopic, "");
  sSubtopic = s_Init(sSubtopic, "");
  
/*  if (sTopic == "") {sTopic = document.location;}*/
  
  sw = screen.width;
  if (sw < 800)  
  { 
    helpWid = sw;
    helpHei = parseInt(screen.height / 2);
    menuBar = 'no';
  }
  else
  {
    helpWid = 800;
    helpHei = parseInt(screen.height / 1.5);
    menuBar = 'yes';
  }
  
  helpLeft = parseInt ((sw-helpWid) / 2);
  sFeatures = 'top=0, left=' + helpLeft + ', width=' + helpWid + ', height=' + helpHei + ', toolbar=no,' + 'menubar=' + menuBar + ', location=no, directories=no, resizable=yes, status=no, scrollbars=yes, fullscreen=no ';
  window.open(this.sPAGES_HELP + '?' + this.sTOPIC + '=' + sTopic + '#' + sSubtopic, 'HelpWindow', sFeatures);
  cancelBubble = true;
}

/*---------------------------------------------------------*/

function Help_ShowHint(sHintTextID, event)
{
  oHintText = htm_GetElById(sHintTextID);
  if (!oHintText) {return;}
  oHintPopupBody = htm_GetElById("HelpPopupBody");
  if (!oHintPopupBody) {return;}
  oHelpPopupWin = htm_GetElById("HelpPopupWin");
  if (!oHelpPopupWin) {return;}
  
  oHintPopupBody.innerHTML = oHintText.innerHTML; 
  
  PopUp_Show("HelpPopupWin", event);
}


