<!-- Begin

// ------------------------------
// Interbook Hyperlink Management
// ------------------------------


// manualType = "refman" or "userman" or "getstart", etc.
// manualTOC = refmanTOC or usermanTOC or getstartTOC, etc.
// manualWindow = "refwin" or "userwin" or "gswin", etc.
// htmlPage is the destination of the hypertext link:
//     filename.html#anchorname or filename.html
// 
function loadManual(htmlPage, manualDir, manualTOC, manualWindow) {
   framecode = 
      "<frameset rows='80,*'  border='0'>"
      + "<frame src='../../"
      + manualDir
      + "/onlinedoc/mantitle.html' name='ManualTitle' scrolling=no>"
      + "<frameset cols='300, *' bordercolor='black'>"
      + "<frameset rows='0,*' bordercolor=black>"
      + "<frame src='../../"
      + manualDir
      + "/html/"
      + manualTOC
      + ".html' name='code' scrolling='no' border='0'>"
      + "<frame src='../onlinedoc/emptyTOC.html' NAME='ManualContents'>"
      + "</frameset>"
      + "<frame src='../../"
      + manualDir
      + "/html/" 
      + htmlPage
      + "' name='ManualBody'>"
      + "</frameset>"
      + "</frameset>";

   page = window.open("", manualWindow);
   page.document.open();
   page.document.write(framecode);
   page.document.close();
   page.focus();
}

function loadManualWithoutTOC(htmlPage, manualDir, manualWindow) {
   framecode = 
      "<frameset rows='80,*'  border='0'>"
      + "<frame src='../../"
      + manualDir
      + "/onlinedoc/mantitle.html' name='ManualTitle' scrolling=no>"
      + "<frame src='../../"
      + manualDir
      + "/html/" 
      + htmlPage
      + "' name='ManualBody'>"
      + "</frameset>";

   page = window.open("", manualWindow);
   page.document.open();
   page.document.write(framecode);
   page.document.close();
   page.focus();
}

function loadJavadocRef(path, manualDir, manualWindow)
{
   framecode = 
      "<frameset rows='100,*'  bordercolor='black' border=2>"
      + "<frame src='../../"
      + manualDir
      + "/onlinedoc/mantitle.html' name='ManualTitle' scrolling=no>"
      + "<FRAMESET cols='20%,80%'>"
      + "<FRAMESET rows='30%,70%'>"
      + "<FRAME src='../../"
      + manualDir
      + "/html/overview-frame.html' name='packageListFrame'>"
      + "<FRAME src='../../"
      + manualDir
      + "/html/allclasses-frame.html' name='packageFrame'>"
      + "</FRAMESET>"
      + "<FRAME src='../../"
      + manualDir
      + "/html/"
      + path
      + "' name='classFrame'>"
      + "</FRAMESET>"
      + "</frameset>";

   page = window.open("", manualWindow);
   page.document.open();
   page.document.write(framecode);
   page.document.close();
   page.focus();
}


// {{To use links from a manual to an other one
// you must define your own function as described below.}}
// Example: how to use the loadManualWithoutTOC function to use
// links to a 2-frames manual (type srcgenman).
//

function loadRef(htmlPage) {
   loadManual(htmlPage, "refman", "CPLEX_CPP_RefTOC", "refwin");

}

// Example: how to use the loadJavadocRef function to use
// links to a javadoc generated manual (type javadocman).
//
//function loadJavaAPI(htmlPage) {
//   loadJavadocRef(htmlPage, "javadocman", "javadocwin");
//}
//
// Example: how to use the loadManual function to use links to 
// a 3-frames manual (type wwman).

function loadUsr(htmlPage) {
   loadManual(htmlPage, "userman", "CplexUsrTOC", "userwin");
}





// ------------------------
// Combo Boxes Function
// ------------------------
function gotomanual(form)
{
var manual=form.othermanuals.options[form.othermanuals.selectedIndex].value;

  if (manual == "refman") {  
    newWindow = windowOpen('../../refman/onlinedoc/index.html', 'refmanwin');
  }
  if (manual == "userman") {  
    newWindow = windowOpen('../../userman/onlinedoc/index.html', 'userwin');
  }
  if (manual == "relnotes") {  
    newWindow = windowOpen('../../relnotes/onlinedoc/index.html', 'relwin');
  }
  if (manual == "getstart") {  
      newWindow = windowOpen('../../getstart/onlinedoc/index.html', 'getstartwin');
  }
  if (manual == "advrefman") {  
      newWindow = windowOpen('../../advrefman/onlinedoc/index.html', 'advrefwin');
  }
}


// ------------------------
// Window Opening Mechanism
// ------------------------

if (document.all) {
  x = window.screenLeft;
  y = window.screenTop;
}
else {
  x = window.screenX;
  y = window.screenY;
}

function windowOpen(filename,windowname) {
  newWindow = window.open(filename,windowname,'top=' + y + ',screenY=' + y + ',left=' + x + ',screenX=' + x + ',menubar=yes,scrollbars=yes,toolbar=yes,status=yes,resizable=yes');
  if (window.focus) {
    newWindow.focus();
  }
}

//------------
// windowAdd is similar to windowOpen, but doesn't close the
// opener window.
// Used for example to open the search window without closing the 
// manual window.
// -----------
function windowAdd(filename,windowname) {
  newWindow = window.open(filename,windowname,'top=' + y + ',screenY=' + y + ',left=' + x + ',screenX=' + x + ',menubar=yes,scrollbars=yes,toolbar=yes,status=yes,resizable=yes');
  if (window.focus) {
    newWindow.focus();
  }
}

function setWindowLoc() {
  if (document.all) {
    x = window.screenLeft;
    y = window.screenTop;
  }
  else {
    x = window.screenX;
    y = window.screenY;
  }
}

function checkMove () {
  curScreenX = 
    document.all ? window.screenLeft : window.screenX;
  curScreenY = 
    document.all ? window.screenTop : window.screenY;
  if (curScreenX != oldScreenX || curScreenY != oldScreenY) {
    window.setWindowLoc();
  }
  oldScreenX = curScreenX;
  oldScreenY = curScreenY;
}

// -------------------------
// Navigation bar management
// -------------------------

// Based on watermark script by Paul Anderson, CNET Builder.com. All rights reserved.

function initNavBar() {
markW = 100;       // pixels wide
markH = 40;       // pixels high
markX = 99;      // percent right
markY = 90;      // percent down
markRefresh = 20; // milliseconds

// set common object reference
if (!document.all) document.all = document;
if (!document.all.waterMark.style) document.all.waterMark.style = document.all.waterMark;

wMark = document.all.waterMark.style;
wMark.width = markW;
wMark.height = markH;
navDOM = window.innerHeight; // Nav DOM flag
}
 
function setVals() {
 barW = 0; // scrollbar compensation for PC Nav
 barH = 0;
 if (navDOM) {
  if (document.height > innerHeight) barW = 20;
  if (document.width > innerWidth) barH = 20;
  } else {
  innerWidth = document.body.clientWidth;
  innerHeight = document.body.clientHeight;
  }
 posX = ((innerWidth - markW)-barW) * (markX/100);
 posY = ((innerHeight - markH)-barH) * (markY/100);
 }

function wRefresh() {
 wMark.left = posX + (navDOM?pageXOffset:document.body.scrollLeft);
 wMark.top = posY + (navDOM?pageYOffset:document.body.scrollTop);
 }

function markMe() {
 setVals();
 window.onresize=setVals;
 markID = setInterval ("wRefresh()",markRefresh);
 }

// ----------------------
// Menu Tracking Function
// ----------------------

function setMenuTracking() {
  wfami = typeof parent.frames["code"];
  if (wfami != "undefined") {
    if(parent.frames['code'].MTMDisplayMenu != null) {
      parent.frames['code'].MTMTrack = true;
      setTimeout("parent.frames['code'].MTMDisplayMenu()", 250);
    }
  }
}

// --------------------------
// Suppress JavaScript Errors
// --------------------------

function stopError() {
  return true;
}



//  End -->


