var _helpTop = top;
var helpWin = null;
var helpHdrURL = "";
var isHelpJSLoaded = false;
var helpContentURL = "";
 
function openWindow(theUrl, theTitle, w, h)
{
  var ver = parseInt(navigator.appVersion, 10);
  var attr = "height=" + h + ",width=" + w + ",scrollbars=yes,resizable=yes";

  if (helpWin != null && helpWin.close != null)
    helpWin.close();

  if (ver >= 4)
    {
    var dx = (screen.width - w) >> 1;
    var dy = (screen.height - h) >> 1;

    attr += ",left=" + dx + ",top=" + dy;
    }
  helpWin = window.open(theUrl, theTitle, attr);
}

function openHelp(helpFile)
{
  helpContentURL = helpFile;
  if(unescape(document.cookie).indexOf("cc_api") != -1)
	helpHdrURL ="apiexecheader_en.htm";
  else
	helpHdrURL ="execheader_en.htm";
	
  openWindow("help/execguide_en.htm", "helpwin", 500, 320);
}

function createHelpFrame()
{
document.writeln("<FRAMESET ROWS = \'44,*\' FRAMEBORDER=\'no\' BORDER=\'no\' FRAMESPACING=\'0\'>");
document.write("<FRAME SRC=\"", opener.helpHdrURL, "\" NAME=\'helptop\' NORESIZE SCROLLING=\'NO\' ");
document.writeln("MARGINWIDTH=\'0\' MARGINHEIGHT=\'0\' FRAMEBORDER=\'no\' BORDER=\'no\' FRAMESPACING=\'0\'>");
document.write("<FRAME SRC=\"", opener.helpContentURL, "\" NAME=\'help\' NORESIZE SCROLLING=\'AUTO\' MARGINWIDTH=\'10\' ");
document.writeln("MARGINHEIGHT=\'10\' FRAMEBORDER=\'no\' BORDER=\'no\' FRAMESPACING=\'0\'>");
document.writeln("</FRAMESET>");
}

function printIsNativeSupport(){
   var ver = parseInt(navigator.appVersion, 10);
   if(navigator.appName.indexOf("Microsoft") != -1)
   {
	var agent=navigator.userAgent;
	var i = agent.indexOf("MSIE ")+5;
	return parseInt(agent.substr(i))>=5 && agent.indexOf("5.0b1")<0;
   }
   if(navigator.appName.indexOf("Netscape") != -1)
   {
   	if(ver >= 4) return true;
   }
   return false;
}
function checkHelpImage(name)
{
  var result = null;
  var cookieCopy = document.cookie + ";";
  var searchKey = name + "=";
  var stOfst = cookieCopy.indexOf(searchKey);
  var enOfst = 0;

  if (stOfst >= 0) 
  {
    stOfst += searchKey.length;
    enOfst = cookieCopy.indexOf("&", stOfst);
    result = unescape(cookieCopy.substring(stOfst, enOfst));
  }
  return result;
}

isHelpJSLoaded = true;
