//=============================================================================
// File:    Fluidwell General Internet Library
// Version: 1.1
// Date:    4 March 2005
// Note:    WindowsXP causes long delays when functions return values that are
//          not used. So only use return ...; when it is used, otherwise just
//          use return;.
//=============================================================================

var MenuTimer = -1;
var MenuShown = "";
var MenuToShow = "";
var MainBackground = "";
var LowResLogo="logos/logo2000_065.gif";
var HighResLogo="logos/logo2000_130.jpg";
var PrinterImage="images/printer-wide.gif";
var DatasheetImage="images/datasheet-wide.gif";
var NoDatasheetImage="images/nodatasheet-wide.gif";
var SmallDatasheetImage="images/pdf.gif";
var SpacerImage="images/spacer.gif";
var BodyBackground="css/bg_unit_bl.jpg";
var BG_Menu_Top_SEL="css/bg_sel.gif";
var BG_Menu_Top_NAV="css/bg_nav.gif";
var BG_Menu_Bottom_LEFT="css/bg_bottom_left.gif";
var BG_Menu_Bottom_NAV="css/bg_bottom_nav.gif";
var BG_Menu_Bottom_RIGHT="css/bg_bottom_right.gif";
var FileBaseDir;
var CSSDir="css/";
var DownloadDir="download/";
var SchematicsDir="schematics/";
var PhotoDir="photos/";
var LCDDir="lcd/";
var PopupWidth=207;
var CopyrightYear="2009";
var SubMenuAddition="&nbsp;-&nbsp;";
var NavigateAddition="<SPAN CLASS=\"NavigateBlack\"> -&gt; </SPAN>"

if (self.location.protocol=="file:")
{ FileBaseDir=self.location.hostname;
}
else if (self.location.hostname=="server")
{ FileBaseDir="http://server/mirror/";
}
else if (self.location.hostname=="192.168.11.10")
{ FileBaseDir="http://192.168.11.10/mirror/";
}
else if (self.location.hostname=="srv01")
{ FileBaseDir="http://srv01/Intranet/mirror/";
}
else if (self.location.hostname=="192.168.11.1")
{ FileBaseDir="http://192.168.11.1/Intranet/mirror/";
}
else if (self.location.hostname=="srv01.fluidwell.local")
{ FileBaseDir="http://srv01.fluidwell.local/Intranet/mirror/";
}
else if (self.location.hostname=="192.168.11.1")
{ FileBaseDir="http://192.168.11.1/Intranet/mirror/";
}
else if (self.location.hostname=="www.xs4all.nl")
{ FileBaseDir="http://www.xs4all.nl/~fluidwe/";
}
else
{ FileBaseDir="http://www.fluidwell.com/";
}

//=============================================================================
// Detect if the browser is ie
function IsIE() 
{
  var CSAg = window.navigator.userAgent;
  return CSAg.indexOf("MSIE") > 0;
}

//=============================================================================
function nothing()
{ // This function really does nothing... :)
}

//=============================================================================
// Popup the image filename given in URL
// The image is assumed to be located in "FileBaseDir+PhotoDir+URL"
// If the popup window is already present, it is cleared, filled and activated.
function PopUpImg(URL)
{ alert("PopUpImg vervangen door A link naar imagepopup.html!");
  my_window= window.open ("", "PopUpImg","width=400,height=450"); 
  my_window.document.body.innerHTML="";
  // write TITLE property before document.title property!
  my_window.document.write("<HTML><HEAD><TITLE>Fluidwell</TITLE></HEAD>");
  my_window.document.title=URL.substring(0,URL.indexOf("."))+" - Fluidwell";
  my_window.document.write("<BODY BGCOLOR=\"#004d7F\"><TABLE HEIGHT=\"100%\" CELLSPACING=\"10\" WIDTH=\"100%\"><TR><TD WIDTH=\"350\" HEIGHT=\"350\" BGCOLOR=\"#FFFFFF\" ALIGN=\"CENTER\" VALIGN=\"MIDDLE\"><IMG SRC=\""+FileBaseDir+PhotoDir+URL+"\" WIDTH=\"350\" HEIGHT=\"350\" ALIGN=\"CENTER\"><TR><TD ALIGN=\"CENTER\" HEIGHT=\"50\"><input width=\"200\" type=\"button\" onClick=\"self.close()\" value=\"Close\"></TABLE></BODY></HEAD>");
  my_window.focus();
}

//=============================================================================
// This function returns the x-pos of 'obj'
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
	{ 
  	curleft += obj.x;
  }
	return curleft;
}

//=============================================================================
// This function returns the y-pos of 'obj'
function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
	{ 
  	curtop += obj.y;
  }
	return curtop;
}


//=============================================================================
function ShowPopUpMenu(menuLabel, frameObject, x, y, z)
{ 
  if (!frameObject)
  {
    return;
  }
  menuLabelBase=menuLabel+"Base";
  if (frameObject.document.getElementById)
  {
    menuObjectBase = frameObject.document.getElementById(menuLabelBase);
  }
  else if (frameObject.document.all)
  {
    menuObjectBase = frameObject.document.all[menuLabelBase];
  }
  else if (frameObject.document.layers)
  {
    menuObjectBase = frameObject.document.layers[menuLabelBase];
  }
  if (x<0)
  {
    if (menuObjectBase)
    {
      x=findPosX(menuObjectBase);
      if (x<document.body.scrollLeft) 
      { 
        x=document.body.scrollLeft;
      }
      else if (x>0)
      { 
        x=x-1;
        fx=-1;
        if (window.innerWidth)
        {
          fx=window.innerWidth;
        }
        if (fx==-1)
        { 
          if (menuObjectBase.document)
          {
            if (menuObjectBase.document.body)
            {
              if (menuObjectBase.document.body.offsetWidth)
              {
                fx=menuObjectBase.document.body.offsetWidth;
              }
            }
          }
        }
        if (fx!=-1)
        { 
          if ((fx+document.body.scrollLeft)<(x+z+20))
          { 
            x=fx+document.body.scrollLeft-(z+20); // 20 for scroll bar
          }
        }

      }
      else 
      {
        x=0;
      }
    }
  }
  if (y<0)
  {
    if (menuObjectBase)
    {
      y=findPosY(menuObjectBase)+35;
    }
  }

  if (frameObject.document.getElementById)
  {
    menuObject = frameObject.document.getElementById(menuLabel);
  }
  else if (frameObject.document.all)
  {
    menuObject = frameObject.document.all[menuLabel];
  }
  else if (frameObject.document.layers)
  {
    menuObject = frameObject.document.layers[menuLabel];
  }
  if (menuObjectBase)
  { // Make heading keep its selection background
    if (menuObjectBase.className!="MenuSelected")
    { 
      bcktext="url("+FileBaseDir+BG_Menu_Top_SEL+")";
      if (document.layers)
      { // this means NS4 browser and does not support the style property!
        if (menuObjectBase.background != bcktext)
        {
          menuObjectBase.background = bcktext;
        }
      }
      else if (menuObjectBase.style.background != bcktext)
      {
        menuObjectBase.style.background = bcktext;
      }
    }
  }

  if (menuObject)
  {
    if (document.layers)
    { // this means NS4 browser and does not support the style property!
      menuObject.left = x;
      menuObject.top = y;
      menuObject.width = z;
      menuObject.visibility = "show";
    }
    else
    {
      menuObject.style.left = x;
      menuObject.style.top = y;
      menuObject.style.width = z;
      menuObject.style.visibility = "visible";
    }
  }
}

//=============================================================================
// Remove any pop-up menu shown on screen and put back original backgrounds
// Get all menu items and set them to hidden / move them out of sight
function HideMenus(menuLabel)
{ // give the ID of the currently shown popup-menu in menuLabel so it is not hidden.
  // To force all menus hidden set menuLabel to ''
  for (i=0;i<menuArrayName.length;i++)
  { 
    if (menuLabel!="PopUp"+menuArrayName[i][0])
    { // First, remove popup menu
      menuName="PopUp"+menuArrayName[i][0];
      if (document.getElementById)
      {
        el = document.getElementById(menuName);
      }
      else if (document.all)
      {
        el = document.all[menuName];
      }
      else if (document.layers)
      {
        el = document.layers[menuName];
      }
      if (el)
      {
        if (document.layers)
        { // this means NS4 browser and does not support the style property!
          el.visibility = "hide";
          el.top = -1000;
        }
        else
        {
          el.style.visibility = "hidden";
          el.style.top = -1000;
        }
      }
      // Second, remove selection image from top row
      menuNameBase="PopUp"+menuArrayName[i][0]+"Base";
      if (document.getElementById)
      {
        el = document.getElementById(menuNameBase);
      }
      else if (document.all)
      {
        el = document.all[menuNameBase];
      }
      else if (document.layers)
      {
        el = document.layers[menuNameBase];
      }
      if (el)
      {
        if (el.className!="MenuSelected")
        {
          bcktext="url("+FileBaseDir+BG_Menu_Top_NAV+")";
          if (document.layers)
          { // this means NS4 browser and does not support the style property!
            if (el.background != bcktext)
            {
              el.background = bcktext;
            }
          }
          else
          {
            if (el.style.background != bcktext)
            {
              el.style.background = bcktext;
            }
          }
        }
        else
        {
          bcktext="url("+FileBaseDir+BG_Menu_Top_SEL+")";
          if (document.layers)
          { // this means NS4 browser and does not support the style property!
            if (el.background != bcktext)
            {
              el.background = bcktext;
            }
          }
          else
          {
            if (el.style.background != bcktext)
            {
              el.style.background = bcktext;
            }
          }
        }
      }
    }
  }
  MenuShown=menuLabel;
}

//=============================================================================
// Remove any pop-up menu shown on screen if we are not inside a popup-menu item
function HideMenusFromBody()
{
  if (MenuTimer!=-1) 
  { // If MenuTimer is enabled we are NOT located inside a popup-menu item,
    // since they turn off the timer!
    HideMenus('');
  }
}

//=============================================================================
// Search the menuArray for the given menuitem
function GetXMenu(MenuName)
{
  if (MenuName)
  { 
    if (MenuName!="")
    {
      for (i=0;i<menuArrayName.length;i++)
      {
        for (j=0;j<menuArrayName[i].length;j++)
        {
          if (MenuName==menuArrayName[i][j])
          {
            return i;
          }
        }
      }
    }
  }
  return -1;
}

//=============================================================================
// Search the menuArray on the given X coordinate for the given Y coordinate
function GetYMenu(MenuName)
{
  if (MenuName)
  { 
    if (MenuName!="")
    {
      for (i=0;i<menuArrayName.length;i++)
      {
        for (j=1;j<menuArrayName[i].length;j++)
        { // j=0 points to the XMenu name!
          if (MenuName==menuArrayName[i][j])
          {
            return j;
          }
        }
      }
    }
  }
  return -1;
}

//=============================================================================
// Search the productsArrayName for the given productitem
function GetPMenu(ProductName)
{
  if (ProductName)
  {
    if (ProductName!="")
    {
      for (j=0;j<productsArrayName.length;j++)
      {
        if (productsArrayName[j]==ProductName)
        {
          return j;
        }
      }
    }
  }
  return -1;
}

//=============================================================================
// Search the productsArrayScreen for the given productitem
function GetPMenuScreen(ProductName)
{
  if (ProductName)
  {
    if (ProductName!="")
    {
      for (j=0;j<productsArrayScreen.length;j++)
      {
        if (productsArrayScreen[j]==ProductName)
        {
          return j;
        }
      }
    }
  }
  return -1;
}

//=============================================================================
// Cancel current timeout and start a new one
function StartMenuTimer(menuLabel)
{ 
  if (MenuShown=="")
  { // Currenly no menu is shown
    if (menuLabel!="")
    { // We need to show a menu, so we delay the display
      StopMenuTimer();
      MenuToShow=menuLabel;
      MenuTimer=window.setTimeout("ShowMenu()",250);
    }
    else
    { // We may have move over the control very quickly so the timeout is started
      // Now we may have moved out, so we stop the timeout
      StopMenuTimer();
    }
  }
  else
  { // We currently show a menu, now see if it is different to the new menu
    if (menuLabel!=MenuShown)
    { 
      if (menuLabel!="")
      { // We need to show a different menu, stop the timer that may have been started to hide the current menu
        StopMenuTimer();
        HideMenus('');
        MenuToShow=menuLabel;
        ShowMenu();
      }
      else
      { // We need to show no menu -> remove current menu with delay
        StopMenuTimer();
        MenuToShow=menuLabel;
        MenuTimer=window.setTimeout("HideMenus('')",500);
      }
    }
    else
    { // We need to show the same menu, stop the timer that may have been started to hide the current menu
      StopMenuTimer();
    }
  }
}

//=============================================================================
// Force immediate showing of the selected menu
function ShowMenuNow(menuLabel)
{ menuLabel="PopUp"+menuLabel;
  //alert(menuLabel+"-"+MenuShown);
  if (menuLabel!="")
  { if (menuLabel!=MenuShown)
    { // We need to show a different menu, stop the timer that may have been started to hide the current menu
      StopMenuTimer();
      HideMenus('');
    }
    MenuToShow=menuLabel;
    ShowMenu();
  }
}

//=============================================================================
// Process the actual request of the menu timer
function ShowMenu()
{ 
  if (MenuToShow!="") 
  {
    MenuShown=MenuToShow;
    ShowPopUpMenu(MenuShown,self,-1,-1,(PopupWidth+2));
  }
}
//=============================================================================
// Cancel current timeout
function StopMenuTimer()
{
  if (MenuTimer!=-1)
  {
    window.clearTimeout(MenuTimer);
    MenuTimer=-1;
  }
}

//=============================================================================
// Create the title line to put into the HTML files
// Get the information from the menuArray
function CreateTitle(MenuName,ProductName)
{
  XMenu=GetXMenu(MenuName);
  YMenu=GetYMenu(MenuName);
  PMenu=GetPMenu(ProductName);
  //NewTitle=document.title;
  NewTitle="Fluidwell";
  if (XMenu!=-1)
  { 
    if (YMenu!=-1)
    {
      NewTitle=menuArrayScreen[XMenu][YMenu]+" - "+NewTitle;
    }
    else
    {
      NewTitle=menuArrayScreen[XMenu][0]+" - "+NewTitle;
    }
  }
  if (PMenu!=-1)
  {
    NewTitle=productsArrayScreen[PMenu]+" - "+productsArrayTitle[PMenu]+" - "+NewTitle;
  }
  document.title=NewTitle;
}

//=============================================================================
// Create the lines to put into the HTML files
function CreateTopMenu(MenuName,ProductName)
{ HTML="";
  if ((MenuName=="") && (self.location.search!=""))
  { // check to see if the URL specifies a MenuName...
    MenuName=self.location.search;
    if (MenuName.charAt(0)=='?')
    {
      MenuName=MenuName.substring(1,MenuName.length);
    }
  }
  CreateTitle(MenuName,ProductName);

  XMenu=GetXMenu(MenuName);
  YMenu=GetYMenu(MenuName);
  PMenu=GetPMenu(ProductName);
  
  // Write dropdown boxes outside table element?
  // write drop down items for menubar
  for (i=0;i<menuArrayName.length;i++)
  {
    if (i==XMenu) // && (YMenu==-1))
    {
      PopupClassX=" class=\"MenuPopUpSelected\" ";
    }
    else
    {
      PopupClassX=" class=\"MenuPopUpUnselected\" ";
    }
    if (menuArrayName[i].length>1)
    { // this means we have more than just the heading, we have a submenu
      if (IsIE())
      { // ie height adjustment
        HTML=HTML+"    <DIV NOWRAP ID=\"PopUp"+menuArrayName[i][0]+"\""+PopupClassX+"STYLE=\"left: 0; height: "+((menuArrayName[i].length-1)*16+3).toString()+";\"  onmouseover=\"StopMenuTimer();\" onmouseout=\"StartMenuTimer('');\">\r\n";
      }
      else
      { // netscape height adjustment
        HTML=HTML+"    <DIV NOWRAP ID=\"PopUp"+menuArrayName[i][0]+"\""+PopupClassX+"STYLE=\"left: 0; height: "+((menuArrayName[i].length-1)*16+1).toString()+";\" onmouseover=\"StopMenuTimer();\" onmouseout=\"StartMenuTimer('');\">\r\n";
      }
      
      for (j=1;j<menuArrayName[i].length;j++)
      { 
        if ((i==XMenu) && (j==YMenu))
        {
          PopupClassY=" class=\"MenuPopUpSelected\" ";
        }
        else
        {
          PopupClassY=" class=\"MenuPopUpUnselected\" ";
        }
        ScreenContent=menuArrayScreen[i][j];
        if (ScreenContent.length)
        { if (ScreenContent.charAt(0)==' ') 
          { // we make our indent text here!
            ScreenContent=SubMenuAddition+ScreenContent.substring(1,ScreenContent.length);
          }
        }
        if ((menuArrayLink[i][j]=='') && (menuArrayScreen[i][j]==''))
        { // empty line means we insert a HR
          if (IsIE())
          { // ie width and top adjustment
            HTML=HTML+"      <HR"+PopupClassY+"style=\"top: "+((j-1)*16+8).toString()+"; width: "+(PopupWidth)+";\">\r\n";
          }
          else
          { // netscape width and top ajustment
            HTML=HTML+"      <HR"+PopupClassY+"style=\"top: "+((j-1)*16).toString()+"; width: "+(PopupWidth+1)+"\" NOSHADE SIZE=\"1\">\r\n";
          }
        }
        else if (menuArrayLink[i][j]=='')
        { // only empty link, just insert the text that is not a link...
          if (IsIE())
          { // ie width adjustment
            HTML=HTML+"      <SPAN"+PopupClassY+" style=\"top: "+((j-1)*16).toString()+"; width: "+(PopupWidth)+";\">&nbsp;"+ScreenContent+"</SPAN>\r\n";
          }
          else
          { // netscape width adjustment
            HTML=HTML+"      <SPAN"+PopupClassY+" style=\"top: "+((j-1)*16).toString()+"; width: "+(PopupWidth+1)+";\">&nbsp;"+ScreenContent+"</SPAN>\r\n";
          }
        }
        else
        {
          if (IsIE())
          { // ie width adjustment
            HTML=HTML+"      <A"+PopupClassY+"href=\""+FileBaseDir+menuArrayLink[i][j]+"\" onclick=\"HideMenus('');document.body.onclick=null;\" style=\"top: "+((j-1)*16).toString()+"; width: "+(PopupWidth)+";\">&nbsp;"+ScreenContent+"</A>\r\n";
          }
          else
          { // netscape width adjustment
            HTML=HTML+"      <A"+PopupClassY+"href=\""+FileBaseDir+menuArrayLink[i][j]+"\" onclick=\"HideMenus('');document.body.onclick=null;\" style=\"top: "+((j-1)*16).toString()+"; width: "+(PopupWidth+1)+";\">&nbsp;"+ScreenContent+"</A>\r\n";
          }
        }
      }
      HTML=HTML+"    </DIV>\r\n";
      HTML=HTML+"\r\n";
    }
  }
  
  
        //LastSubMenu=menuArrayScreen[i][1]; // we need this parameter if the submenu has a submenu (indent)

        
        
        

  HTML=HTML+"  <!-- Top Menu insertion -->\r\n";
  HTML=HTML+"  <A NAME=\"Top\"></A>\r\n";
  HTML=HTML+"  <TABLE CLASS=\"FramesMaster\" ID=\"FramesMaster\">\r\n";
  HTML=HTML+"  <TR VALIGN=\"TOP\"><TD><TD WIDTH=\"770\" ID=\"FrameW\">";
  HTML=HTML+"  <TABLE CLASS=\"Frames\" ID=\"FrameH\">\r\n";
  HTML=HTML+"    <TR VALIGN=\"TOP\" HEIGHT=\"65\">\r\n";
  //HTML=HTML+"      <TD ROWSPAN=\"5\" VALIGN=\"TOP\">\r\n";

  // Write logo bar
  HTML=HTML+"      <TD WIDTH=\"100%\">\r\n"; /* 770 */
  HTML=HTML+"        <TABLE CLASS=\"Logo\" WIDTH=\"100%\" ID=\"LogoTable\" CELLPADDING=0 CELLSPACING=0>\r\n";  /* 770 */
  HTML=HTML+"          <TR>\r\n";
  if (PMenu!=-1)
  { 
    HeaderLinkLow=productsArrayHeadLow[PMenu];
    HeaderLinkHigh=productsArrayHeadHigh[PMenu];
    
    if (productsArrayLink[PMenu]!="") HeaderText="Model "+productsArrayScreen[PMenu];
    else HeaderText=productsArrayScreen[PMenu];
  }
  else if (XMenu!=-1)
  { 
    if (YMenu!=-1)
    { 
      HeaderLinkLow=menuArrayHeadLow[XMenu][YMenu];
      HeaderLinkHigh=menuArrayHeadHigh[XMenu][YMenu];
      HeaderText=menuArrayScreen[XMenu][YMenu];
    }
    else
    {
      HeaderLinkLow=menuArrayHeadLow[XMenu][0];
      HeaderLinkHigh=menuArrayHeadHigh[XMenu][0];
      HeaderText=menuArrayScreen[XMenu][0]
    }
  }
  else
  { 
    HeaderLinkLow="";
    HeaderLinkHigh="";
    HeaderText="FLUIDWELL";
  }
  
  if (HeaderLinkLow!="")
  { //<TD><IMG class=LogoImageScreen id=LogoImageScreen src="head_fseries.gif" height=65 width=768><IMG class=LogoImagePrint id=LogoImagePrint src="head_fseries.jpg" width="19cm">
    // following lines may not be separated with spaces or carriage returns because then IE creates a small background-colored line (ap. 5px) at the bottom of our table...
    HTML=HTML+"            <TD>"
    HTML=HTML+"<IMG CLASS=\"LogoImageScreen\" ID=\"LogoImageScreen\" SRC=\""+FileBaseDir+CSSDir+HeaderLinkLow+"\" ALT=\""+HeaderText+"\" TITLE=\"\" HEIGHT=\"65\" WIDTH=\"768\">";
    HTML=HTML+"<IMG CLASS=\"LogoImagePrint\" ID=\"LogoImagePrint\" SRC=\""+FileBaseDir+CSSDir+HeaderLinkHigh+"\" ALT=\""+HeaderText+"\" TITLE=\"\" WIDTH=\"19cm\">\r\n";
  }
  else
  { // following lines may not be separated with spaces or carriage returns because then IE creates a small background-colored line (ap. 5px) at the bottom of our table...
    HTML=HTML+"            <TD CLASS=\"Logo\" ID=\"LogoCellImage\" WIDTH=\"130\" HEIGHT=\"65\">";
    HTML=HTML+"<IMG SRC=\""+FileBaseDir+LowResLogo+"\" CLASS=\"LogoImageScreen\" ID=\"LogoImageSingleScreen\" ALT=\"FLUIDWELL logo\" TITLE=\"FLUIDWELL logo\" HEIGHT=\"65\" WIDTH=\"130\" ALIGN=\"TOP\">";
    HTML=HTML+"<IMG SRC=\""+FileBaseDir+HighResLogo+"\" CLASS=\"LogoImagePrint\" ID=\"LogoImageSinglePrint\" ALT=\"FLUIDWELL logo\" TITLE=\"FLUIDWELL logo\" WIDTH=\"3.2cm\" ALIGN=\"TOP\">\r\n";
    HTML=HTML+"            <TD CLASS=\"Logo\" ID=\"LogoCellText\" VALIGN=\"MIDDLE\"><NOBR>"+HeaderText+"</NOBR>\r\n";
  }
  HTML=HTML+"        </TABLE>\r\n";

  // Write base menu items
  HTML=HTML+"    <TR VALIGN=\"TOP\" HEIGHT=\"33\" ID=\"MenuTableTop\">\r\n";
  HTML=HTML+"      <TD>\r\n";
  HTML=HTML+"        <TABLE CLASS=\"Menu\" WIDTH=\"100%\">\r\n";  /* 770 */
  HTML=HTML+"          <TR>\r\n";
  HTML=HTML+"            <TD CLASS=\"MenuLeft\"><TD CLASS=\"MenuEmpty\">\r\n";

  for (i=0;i<menuArrayName.length;i++)
  {
    LinkText=menuArrayLink[i][0];
    if (LinkText=="")
    {
      ClickText="\"ShowMenuNow('"+menuArrayName[i][0]+"')\"";
      LinkText="HREF=\"javascript:ShowMenuNow('"+menuArrayName[i][0]+"')\"";
    }
    else
    {
      if (window.navigate)
      { // IE
        ClickText="window.navigate('"+FileBaseDir+LinkText+"');";
      }
      else
      {
        ClickText="self.location='"+FileBaseDir+LinkText+"';";
      }
      LinkText="HREF=\""+FileBaseDir+LinkText+"\"";      
    }
    if (i==XMenu)
    {
      HTML=HTML+"            <TD CLASS=\"MenuSeparation\"><TD CLASS=\"MenuSelected\" ID=\"PopUp"+menuArrayName[i][0]+"Base\" onmouseout=\"StartMenuTimer('');\" onmouseover=\"StartMenuTimer('PopUp"+menuArrayName[i][0]+"')\" onclick=\""+ClickText+"\"><A "+LinkText+" CLASS=\"MenuSelected\" onmouseout=\"StartMenuTimer('');\" onmouseover=\"StartMenuTimer('PopUp"+menuArrayName[i][0]+"')\">"+menuArrayScreen[i][0]+"</A>\r\n";
    }
    else
    {
      HTML=HTML+"            <TD CLASS=\"MenuSeparation\"><TD CLASS=\"MenuUnselected\" ID=\"PopUp"+menuArrayName[i][0]+"Base\" onmouseout=\"StartMenuTimer('');\" onmouseover=\"StartMenuTimer('PopUp"+menuArrayName[i][0]+"')\" onclick=\""+ClickText+"\"><A "+LinkText+" CLASS=\"MenuUnselected\" onmouseout=\"StartMenuTimer('');\" onmouseover=\"StartMenuTimer('PopUp"+menuArrayName[i][0]+"')\">"+menuArrayScreen[i][0]+"</A>\r\n";
    }
  }
  HTML=HTML+"            <TD CLASS=\"MenuSeparation\"><TD CLASS=\"MenuEmpty\"><TD CLASS=\"MenuRight\">\r\n";
  HTML=HTML+"        </TABLE>\r\n";


    // Write navigation bar
  HTML=HTML+"    <TR VALIGN=\"TOP\" HEIGHT=\"33\">\r\n";
  HTML=HTML+"      <TD>\r\n";
  HTML=HTML+"        <TABLE CLASS=\"Navigate\" WIDTH=\"100%\" ID=\"NavigateTable\">\r\n"; /* 770 */
  HTML=HTML+"          <TR>\r\n";
  HTML=HTML+"            <TD CLASS=\"Navigate\"><SPAN CLASS=\"NavigateBlack\">You are here: </SPAN><A HREF=\"http://www.fluidwell.com/\" CLASS=\"Navigate\">Fluidwell.com</A>";
  if (XMenu!=-1)
  {
    if ((YMenu>0) || (PMenu!=-1))
    { // YMenu = 0 means top level, YMenu=-1 means no YMenu!
      LinkText=menuArrayLink[XMenu][0];
      if (LinkText=="") LinkText=menuArrayLink[XMenu][1]; // this happens when we have a popup menu -> top activates menu, not a page so we go to the first page in the list.
      HTML=HTML+NavigateAddition+"<A HREF=\""+FileBaseDir+LinkText+"\" CLASS=\"Navigate\">"+menuArrayScreen[XMenu][0]+"</A>";
    }
    else
    { // Giving a link to the currently shown page is not very usefull and looses the reference to the page that referenced it....
      HTML=HTML+NavigateAddition+"<SPAN CLASS=\"Navigate\">"+menuArrayScreen[XMenu][0]+"</SPAN>";
    }
    if (YMenu>0)
    { // YMenu = 0 means top level, YMenu=-1 means no YMenu!
      ScreenContent=menuArrayScreen[XMenu][YMenu];
      if (ScreenContent.charAt(0)==' ')
      { // We have a submenu with a submenu (indent) so we add an extra link to the original submenu.
        // Removal of the leading spaces from the sub-submenu is not required as all webbrowsers treat one or a milion spaces just as 1 space...
        ScreenContent="";
        fYMenu=YMenu-1;
        while (fYMenu)
        { if (menuArrayScreen[XMenu][fYMenu].length)
          { if (menuArrayScreen[XMenu][fYMenu].charAt(0)!=' ')
            { ScreenContent=menuArrayScreen[XMenu][fYMenu];
              break;
            }
            else fYMenu=fYMenu-1;
          }
          else fYMenu=fYMenu-1;
        }
        if (ScreenContent!="")
        { // found the submenu item, now insert the link!
          HTML=HTML+NavigateAddition+"<A HREF=\""+FileBaseDir+menuArrayLink[XMenu][fYMenu]+"\" CLASS=\"Navigate\">"+menuArrayScreen[XMenu][fYMenu]+"</A>";
        }
      }
    
      if (PMenu!=-1)
      { HTML=HTML+NavigateAddition+"<A HREF=\""+FileBaseDir+menuArrayLink[XMenu][YMenu]+"\" CLASS=\"Navigate\">"+menuArrayScreen[XMenu][YMenu]+"</A>";
      }
      else
      { // Giving a link to the currently shown page is not very usefull and looses the reference to the page that referenced it....
        HTML=HTML+NavigateAddition+"<SPAN CLASS=\"Navigate\">"+menuArrayScreen[XMenu][YMenu]+"</SPAN>";
      }
    }
  }
  if (PMenu!=-1)
  {
    // Giving a link to the currently shown page is not very usefull and looses the reference to the page that referenced it....
    HTML=HTML+NavigateAddition+"<SPAN CLASS=\"Navigate\">"+productsArrayScreen[PMenu]+"</SPAN>";
  }
  HTML=HTML+"\r\n";
  
  HTML=HTML+"        </TABLE>\r\n";
  HTML=HTML+"\r\n";

  HTML=HTML+"    <TR>\r\n";
  HTML=HTML+"      <TD ALIGN=\"LEFT\" VALIGN=\"TOP\" ID=\"MainContent\">\r\n";  /* 770 */
  HTML=HTML+"        <!-- Main user data insertion point -->\r\n";

  document.write(HTML);
}

//=============================================================================
// Create the lines to put into the HTML files
function CreateBottomMenu()
{ // Netscape gives the lastmodified string with day and month, eg. Tuesday, February 15, 2005 10:33:10
  // IE gives just numbers, eg. 02/15/2005 10:33:10
  // The last part is equal so we get the documents modification-year by counting back from the rear of the string
  // Sometimes Netscape also gives GMT at the end...
  // So we now decided to just use a fixed year number, set in variable CopyrightYear
  //fYear=document.lastModified;
  //fYear=fYear.substring(fYear.length-13,fYear.length-9);
  fYear=CopyrightYear;
  HTML=    "     <!-- Bottom Menu insertion -->\r\n";
  HTML=HTML+"    <TR VALIGN=\"BOTTOM\" HEIGHT=\"33\">";
  HTML=HTML+"      <TD>\r\n";
  HTML=HTML+"        <TABLE CLASS=\"MenuBottom\" WIDTH=\"100%\" ID=\"MenuTableBottom\">\r\n";  /* 770 */
  HTML=HTML+"          <TR>\r\n";
  HTML=HTML+"            <TD CLASS=\"MenuBottomLeft\" ID=\"MenuTableBottomLeft\">\r\n";
  HTML=HTML+"            <TD CLASS=\"MenuBottomEmpty\" ID=\"MenuTableBottomEmpty\"><DIV CLASS=\"Copyright\" ID=\"Copyright\">&copy; Copyright "+fYear+" Fluidwell bv | <A HREF=\"legal.html\" CLASS=\"Copyright\" ID=\"CopyrightLegal\">Legal Information</A> | All rights reserved - Specifications subject to change without notice.</DIV>\r\n";
  HTML=HTML+"            <TD CLASS=\"MenuBottomRight\" ID=\"MenuTableBottomRight\">\r\n";
  HTML=HTML+"        </TABLE>\r\n";
  HTML=HTML+"  </TABLE>\r\n";
  HTML=HTML+"  <TD>\r\n";
  HTML=HTML+"  </TABLE>\r\n";

  document.write(HTML);
  setpagebreak(); 
}

//=============================================================================
// Create the complete Group table, including model regerences and general 
// information, from the product-range .js file, eg. "flowrate.js".
// See also: CreateDescription, CreateGroupEntry
function CreateGroupTable()
{ CreateGroupTableTop();
  CreateGroupTableBottom(0);
}
  
function CreateGroupTableTop()
{ // General Information
  if (groupDescriptionText.length)
  {
    HTML="";
    HTML=HTML+"    <TABLE CLASS=\"GroupTable\" ID=\"GroupTable1\">\r\n";
    HTML=HTML+"      <TR>\r\n";
    HTML=HTML+"        <TD COLSPAN=\"3\" CLASS=\"GroupHeader\" ID=\"GroupTableHeader1\">";
    if (groupDatasheet!="")
    { 
      HTML=HTML+"<A HREF=\""+FileBaseDir+DownloadDir+groupDatasheet+"\" CLASS=\"DatasheetLink\" TARGET=\"_BLANK\"><IMG SRC=\""+FileBaseDir+DatasheetImage+"\" ID=\"DatasheetImage\" TITLE=\"Download "+groupScreen+" datasheet\" STYLE=\"margin-top:2px;\" ALIGN=\"RIGHT\" HEIGHT=\"16\" WIDTH=\"70\" BORDER=\"0\"></A>";
    }
    HTML=HTML+"General Information\r\n";
    document.write(HTML);
    
    CreateDescription();
    
    HTML="";
    HTML=HTML+"    </TABLE>\r\n";
    document.write(HTML);
  }
}

function CreateGroupTableBottom(separation)  
{ // Model entries
  HTML="";
  HTML=HTML+"    <TABLE CLASS=\"GroupTable\" ID=\"GroupTable2\">\r\n";
  document.write(HTML);
  
  for (i=0;i<groupEntryList.length;i++)
  { 
    // ModelEntryList name
    HTML="";
    HTML=HTML+"      <TR>\r\n";
    HTML=HTML+"        <TD CLASS=\"GroupHeader\" COLSPAN=\"3\" ID=\"GroupTableHeader"+(i+1)+"\"><A NAME=\""+groupEntryName[i]+"\">"+groupEntryScreen[i]+"</A>\r\n";
    HTML=HTML+"      <TR><TD HEIGHT=\"10\">\r\n";
    document.write(HTML);

    // ModelEntryList items
    CreateGroupEntries(groupEntryList[i],separation); //"F010,F011,F012,F014,F110,F111,F115","F016,F112,F118","F013,F113,F118"
    HTML="";
    if (!(separation))
    { // Create a spacer row that also ensures enough room for an extended model code, eg. F126-EL ==> _______
      HTML=HTML+"      <TR>\r\n";
      HTML=HTML+"        <TD CLASS=\"GroupModelNumber\">&nbsp;\r\n";
      HTML=HTML+"        <TD CLASS=\"GroupModelDatasheet\">\r\n";
      HTML=HTML+"        <TD CLASS=\"GroupModelName\">\r\n";
  }
    document.write(HTML);
  }

  HTML="";
  HTML=HTML+"    </TABLE>\r\n";
  document.write(HTML);
  
}

//=============================================================================
// Create the <DIV> with ID "DESCRIPTION" and fill in the data that is referenced
// from the group-range .js file, eg. "flowrate.js".
// Make the first paragraph visible with a "» more »" entry behind it so the user
// can show or hide the rest of the descriptive text.
// See also: ShowDescription, HideDescription, ToggleDescription
function CreateDescription()
{ 
  HTML="";
  // Add initialiser row so browsers can determine column widths - withoug any text, it does not show in the table!
  HTML=HTML+"      <TR><TD CLASS=GroupDescriptionBullit><TD CLASS=GroupDescription><TD CLASS=GroupDescriptionImage>\r\n";

  if (groupDescriptionText.length)
  { // Should always be there!
    // First pargraph always visible -> Set in productDescription0Text
    // Check to see we have a bullit column so we can include it. Otherwise our images are placed very strange...
    // Also check if we have an image column
    BullitCol=1; // Bullit column present - the initialiser row contains a cell!
    ImageCol=1; // Image column present - the initialiser row contains a cell!
  
    HTML=HTML+"      <TR>\r\n";
    HTML=HTML+"        <TD CLASS=\"GroupDescriptionB\" COLSPAN=\""+(1+BullitCol+ImageCol)+"\">"+groupDescriptionTitle[0]+"\r\n";
    if (groupDescriptionImageSmall[0]!="") ImageColCurrent=0;
    else ImageColCurrent=1;    
  
    if (groupDescriptionText[0])
    { // Should always be there!
      currentDescriptionArray=groupDescriptionText[0];
      for (i=0;i<groupDescription0Text.length;i++)
      {
        if (groupDescription0Text[i].charAt(0)=='-')
        { 
          HTML=HTML+"      <TR>\r\n";
          HTML=HTML+"        <TD CLASS=\"GroupDescriptionBullit\">&bull;\r\n";
          HTML=HTML+"        <TD CLASS=\"GroupDescription\">"+currentDescriptionArray[i].substring(1,currentDescriptionArray[i].length)+"\r\n";
        }
        else
        {
          HTML=HTML+"      <TR>\r\n";
          HTML=HTML+"        <TD CLASS=\"GroupDescription\" COLSPAN=\""+(1+BullitCol)+"\">"+currentDescriptionArray[i]+"\r\n";
        }
        
        if ((i==currentDescriptionArray.length-1) && (groupDescriptionText.length>1))
        { // Add more info button...
          //HTML=HTML+"          <A HREF=\"javascript:ShowDescription()\" ID=\"ToggleDescription\" CLASS=\"GroupDescriptionToggle\"><NOBR>&raquo; more &raquo;</NOBR></A>\r\n";
          HTML=HTML+"          <SPAN onclick=\"javascript:ShowDescription()\" ID=\"ToggleDescription\" CLASS=\"GroupDescriptionToggle\"><NOBR>&raquo; more &raquo;</NOBR></SPAN>\r\n";
        }
        if ((i==0) && (ImageColCurrent==0))
        { // Create image entry....
            ThumbLink=groupDescriptionImageSmall[0];
            PhotoLink=groupDescriptionImageLarge[0];
            if (ThumbLink=="") 
            { 
              ThumbLink="spacer.gif";
              PhotoLink="";
            }
          HTML=HTML+"        <TD CLASS=\"GroupDescriptionImage\" ROWSPAN=\""+(currentDescriptionArray.length)+"\">\r\n";
          //if (PhotoLink!="") HTML=HTML+"          <A CLASS=\"GroupDescriptionImage\" HREF=\"javascript:PopUpImg('"+PhotoLink+"')\">\r\n";
          //HTML=HTML+"            <IMG CLASS=\"GroupDescriptionImage\" SRC=\""+FileBaseDir+PhotoDir+ThumbLink+"\">\r\n";
          //if (PhotoLink!="") HTML=HTML+"          </A>\r\n";
          if (PhotoLink!="") HTML=HTML+"            <IMG CLASS=\"GroupDescriptionImage\" ID=\"IMG0000\" SRC=\""+FileBaseDir+PhotoDir+ThumbLink+"\" onclick=\"OpenImage('"+PhotoDir+PhotoLink+"')\" onmouseover=\"SetBorder(this)\" onmouseout=\"ClearBorder(this)\">\r\n";
          else HTML=HTML+"            <IMG CLASS=\"GroupDescriptionImage\" SRC=\""+FileBaseDir+PhotoDir+ThumbLink+"\">\r\n";
          
        }
      }
      // Start new table so we can hide and show the complete table
      // Use a dummy table to insert an empty line -always-
      HTML=HTML+"    </TABLE>\r\n";
      HTML=HTML+"    <TABLE CLASS=\"GroupTable\" ID=\"DescriptionVisible\"><TR><TD CLASS=\"GroupDescription\">&nbsp;\r\n";
      HTML=HTML+"    </TABLE>\r\n";
      HTML=HTML+"    <TABLE CLASS=\"GroupTableHidden\" ID=\"DescriptionHidden\">\r\n";
      // Add initialiser row so browsers can determine column widths - without any text, it does not show in the table!
      HTML=HTML+"      <TR><TD CLASS=GroupDescriptionBullit><TD CLASS=GroupDescription><TD CLASS=GroupDescriptionImage>\r\n";
    }

    // Extended information, visibility selectable
    // Check to see we have a bullit column so we can include it. Otherwise our images are placed very strange...
    // Also check if we have an image column
    BullitCol=1; // Bullit column present - the initialiser row contains a cell!
    ImageCol=1; // Image column present - the initialiser row contains a cell!
  
    for (i=1;i<groupDescriptionText.length;i++)
    { 
      if ((groupDescriptionTitle[i]) && (groupDescriptionTitle[i]!="") && (groupDescriptionText[i]))
      { // If the title is not empty, we assume the entry is filled!
        if (groupDescriptionImageSmall[i]!="") ImageColCurrent=0;
        else ImageColCurrent=1;    
        currentDescriptionArray=groupDescriptionText[i];
        if (i!=1) HTML=HTML+"      <TR><TD CLASS=\"GroupDescription\" COLSPAN=\""+(1+BullitCol+ImageCol)+"\">\r\n";
        HTML=HTML+"      <TR>\r\n";
        HTML=HTML+"        <TD CLASS=\"GroupDescriptionB\" COLSPAN=\""+(1+BullitCol+ImageCol)+"\">"+groupDescriptionTitle[i]+"\r\n";
        for (j=0;j<currentDescriptionArray.length;j++)
        { 
          if (currentDescriptionArray[j].charAt(0)=='-')
          { 
            HTML=HTML+"      <TR>\r\n";
            HTML=HTML+"        <TD CLASS=\"GroupDescriptionBullit\">&bull;\r\n";
            HTML=HTML+"        <TD CLASS=\"GroupDescription\" COLSPAN=\""+(1+ImageColCurrent)+"\">"+currentDescriptionArray[j].substring(1,currentDescriptionArray[j].length)+"\r\n";
          }
          else
          {
            HTML=HTML+"      <TR>\r\n";
            HTML=HTML+"        <TD CLASS=\"GroupDescription\" COLSPAN=\""+(1+BullitCol+ImageColCurrent)+"\">"+currentDescriptionArray[j]+"\r\n";
          }
          if ((j==0) && (ImageColCurrent==0))
          { // Create image entry....
            ThumbLink=groupDescriptionImageSmall[i];
            PhotoLink=groupDescriptionImageLarge[i];
            if (ThumbLink=="") 
            { 
              ThumbLink="spacer.gif";
              PhotoLink="";
            }
            HTML=HTML+"        <TD CLASS=\"GroupDescriptionImage\" ROWSPAN=\""+(currentDescriptionArray.length)+"\">\r\n";
            //if (PhotoLink!="") HTML=HTML+"          <A CLASS=\"GroupDescriptionImage\" HREF=\"javascript:PopUpImg('"+PhotoLink+"')\">\r\n";
            //HTML=HTML+"            <IMG CLASS=\"GroupDescriptionImage\" SRC=\""+FileBaseDir+PhotoDir+ThumbLink+"\">\r\n";
            //if (PhotoLink!="") HTML=HTML+"          </A>\r\n";
            if (PhotoLink!="") 
            { fText=i;
              while (fText.length<4) fText="0"+fText;
              HTML=HTML+"            <IMG CLASS=\"GroupDescriptionImage\" ID=\"IMG"+fText+"\" SRC=\""+FileBaseDir+PhotoDir+ThumbLink+"\" onclick=\"OpenImage('"+PhotoDir+PhotoLink+"')\" onmouseover=\"SetBorder(this)\" onmouseout=\"ClearBorder(this)\">\r\n";
            }
            else HTML=HTML+"            <IMG CLASS=\"GroupDescriptionImage\" SRC=\""+FileBaseDir+PhotoDir+ThumbLink+"\">\r\n";
          }
        }
      }
    }
    HTML=HTML+"      <TR>\r\n";
    HTML=HTML+"        <TD COLSPAN=\""+(1+BullitCol+ImageCol)+"\">&nbsp;\r\n";
  }
  else
  { 
    HTML=HTML+"      <TR>\r\n";
    HTML=HTML+"        <TD COLSPAN=\"3\">&nbsp;ABCD\r\n";
  }

  document.write(HTML);
}

//=============================================================================
// Find the <DIV> with ID "DESCRIPTION" and set its display property to "block".
// Then find the <A> with ID "TOGGLEDESCRIPTION" and set its text to "< less"
// and change the link to point to HideDescription.
function ShowDescription()
{
  DescElH = document.getElementById("DescriptionHidden");
  DescElV = document.getElementById("DescriptionVisible");
  ToggleEl = document.getElementById("ToggleDescription");
  if ((DescElH) && (DescElV) && (ToggleEl))
  { 
    DescElV.style.display="none";
    DescElH.style.display="block";
    //ToggleEl.innerHTML = "<NOBR>&lt; less</NOBR>";
    ToggleEl.innerHTML = "<NOBR>&laquo; less &laquo;</NOBR>";
    //ToggleEl.href="javascript:HideDescription()";
    ToggleEl.onclick=HideDescription;
  }
}

//=============================================================================
// Find the <DIV> with ID "DESCRIPTION" and set its display property to "none".
// Then find the <A> with ID "TOGGLEDESCRIPTION" and set its text to "more >"
// and change the link to point to ShowDescription.
function HideDescription()
{
  DescElH = document.getElementById("DescriptionHidden");
  DescElV = document.getElementById("DescriptionVisible");
  ToggleEl = document.getElementById("ToggleDescription");
  if ((DescElH) && (DescElV) && (ToggleEl))
  {
    DescElH.style.display="none";
    DescElV.style.display="block";
    //ToggleEl.innerHTML="<NOBR>more &gt;</NOBR>";
    ToggleEl.innerHTML="<NOBR>&raquo; more &raquo;</NOBR>";
    //ToggleEl.href="javascript:ShowDescription()";
    ToggleEl.onclick=ShowDescription;
    ResetFrameHeight();
  }
}

function ResetFrameHeight()
{
  // following construction forces netscape to recalculate its scrollbars on collapse!
  // firefox does not however...
  // IE automatically does it right!
  FrameHEl = document.getElementById("FrameH");
  FrameMasterEl = document.getElementById("FramesMaster");
  if ((FrameHEl) && (FrameMasterEl))
  {
    FrameHEl.style.height="auto";
    FrameMasterEl.style.height="auto";
    FrameHEl.style.height="100%";
    FrameMasterEl.style.height="99%";  
  }
}

//=============================================================================
// Create the entries for the products named in groupEntries
function CreateGroupEntries(groupEntries,separation)
{
  counter=0;
  HTML="";
  while (groupEntries!="")
  {
    counter++;
    if (counter>100)
    {
      alert("More than 100 entries were given to CreateGroupEntry. Function ended for security reasons.");
      break;
    }
    k=groupEntries.indexOf(",");
    if (k!=-1)
    {
      entryName=groupEntries.substring(0,k);
      groupEntries=groupEntries.substring(k+1,groupEntries.length);
    }
    else
    {
      entryName=groupEntries;
      groupEntries="";
    }
    j=GetPMenu(entryName);
    if (j!=-1)
    {
      HTML=HTML+"      <TR>\r\n";
      if (j<productsArrayGroupStart)
      { HTML=HTML+"        <TD CLASS=\"GroupModelNumber\"><A CLASS=\"GroupModelNumber\" HREF=\""+FileBaseDir+productsArrayLink[j]+"?"+groupName+"\"><NOBR>"+productsArrayScreen[j]+"</NOBR></A>\r\n";
      }
      else
      { HTML=HTML+"        <TD CLASS=\"GroupModelNumber\"><A CLASS=\"GroupModelNumber\" HREF=\""+FileBaseDir+productsArrayLink[j]+"?"+groupName+"\"><NOBR>"+productsArrayScreen[j]+"</NOBR></A>\r\n";
        //if (productsArrayImage[j]!="")
        //{ 
        //  fText=j;
        //  while (fText.length<4) fText="0"+fText;
        //  HTML=HTML+"                                    <BR><CENTER><IMG CLASS=\"GroupDescriptionImage\" ID=\"IMG"+fText+"\" SRC=\""+FileBaseDir+PhotoDir+productsArrayImage[j]+".gif\" VSPACE=\"10\" onclick=\"OpenImage('"+PhotoDir+productsArrayImage[j]+"_large.gif')\" onmouseover=\"SetBorder(this)\" onmouseout=\"ClearBorder(this)\"></CENTER>\r\n";          
        //  //HTML=HTML+"                                    <BR><IMG SRC=\""+FileBaseDir+PhotoDir+productsArrayImage[j]+".gif\" BORDER=\"0\" ALIGN=\"LEFT\">";
        //}
      }
      if (productsArrayDatasheet[j]!="")
      {
        HTML=HTML+"        <TD CLASS=\"GroupModelDatasheet\">&nbsp;<A HREF=\""+FileBaseDir+DownloadDir+productsArrayDatasheet[j]+"\" CLASS=\"DatasheetLink\" TARGET=\"_BLANK\"><IMG SRC=\""+FileBaseDir+SmallDatasheetImage+"\" TITLE=\"Download "+productsArrayScreen[j]+" datasheet\" ALT=\"\" HEIGHT=\"12\" WIDTH=\"10\" BORDER=\"0\" ALIGN=\"BASELINE\"></A>&nbsp;\r\n";
      }
      else
      {
        HTML=HTML+"        <TD CLASS=\"GroupModelDatasheet\">&nbsp;<IMG SRC=\""+FileBaseDir+SpacerImage+"\" TITLE=\"\" ALT=\"\" HEIGHT=\"12\" WIDTH=\"10\" BORDER=\"0\" ALIGN=\"BASELINE\">&nbsp;\r\n";
      }
      if (j<productsArrayGroupStart)
      { // Normal 'model' descriptions
        HTML=HTML+"        <TD CLASS=\"GroupModelName\">"+productsArrayTitle[j]+" "+productsArraySubtitle[j]+"\r\n";
      }
      else
      { // Product 'group' or 'function' descriptions don't have a title!
        HTML=HTML+"        <TD CLASS=\"GroupModelName\">";
        if (productsArrayImage[j]!="")
        { 
          fText=j;
          while (fText.length<4) fText="0"+fText;
          HTML=HTML+"                                    <IMG CLASS=\"GroupDescriptionImageInside\" ID=\"IMG"+fText+"\" SRC=\""+FileBaseDir+PhotoDir+productsArrayImage[j]+".gif\" ALIGN=\"RIGHT\" onclick=\"OpenImage('"+PhotoDir+productsArrayImage[j]+"_large.gif')\" onmouseover=\"SetBorder(this)\" onmouseout=\"ClearBorder(this)\">\r\n";
        }
        HTML=HTML+productsArraySubtitle[j]+"\r\n";
      }
    }
    else
    {
      HTML=HTML+"      <TR>\r\n";
      HTML=HTML+"        <TD CLASS=\"GroupModelNumber\">"+entryName+"\r\n";
      HTML=HTML+"        <TD CLASS=\"GroupModelDatasheet\">&nbsp;\r\n";
      HTML=HTML+"        <TD CLASS=\"GroupModelName\">"+"Unknown modelnumber referenced"+"\r\n";
    }
    if (separation) HTML=HTML+"      <TR><TD CLASS=\"GroupModelNumber\">&nbsp;<TD CLASS=\"GroupModelDatasheet\"><TD CLASS=CLASS=\"GroupModelName\">\r\n";
  }
  document.write(HTML);
}

//=============================================================================
// Create the top of the modeltable for the product named in productName
// Include the opening header with the title/description and the datasheet/print button
// Calling file should follow this function with a <TR> element and end the
// table with a call to CreateModelTableBottom
function CreateModelTable()
{ // this routine still has the images on bottom and schematic on top
  BoxIndex=1;
  HTML="";
  HTML=HTML+"  <TABLE CLASS=\"Model\" ID=\"ModelBoxTop\">\r\n";
  HTML=HTML+"    <TR>\r\n";
  HTML=HTML+"      <TD COLSPAN=\"3\" CLASS=\"ModelHeader\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
  if (productDatasheet!="")
  {
    HTML=HTML+"        <A HREF=\""+FileBaseDir+DownloadDir+productDatasheet+"\" CLASS=\"DatasheetLink\" TARGET=\"_BLANK\"><IMG SRC=\""+FileBaseDir+DatasheetImage+"\" ID=\"DatasheetImage\" TITLE=\"Download "+productScreen+" datasheet\" STYLE=\"margin-top:2px;\" ALIGN=\"RIGHT\" HEIGHT=\"16\" WIDTH=\"70\" BORDER=\"0\"></A>\r\n";
  }
  else
  {
    HTML=HTML+"        <IMG SRC=\""+FileBaseDir+NoDatasheetImage+"\" ID=\"DatasheetImage\" TITLE=\"No datasheet available\" STYLE=\"margin-top:2px;\" ALIGN=\"RIGHT\" HEIGHT=\"16\" WIDTH=\"70\" BORDER=\"0\"></A>\r\n";
  }
  HTML=HTML+"        "+productScreen.toUpperCase()+" - "+productTitle.toUpperCase()+"<BR CLEAR=\"ALL\">\r\n";
  HTML=HTML+"        <A HREF=\"javascript:print()\"><IMG SRC=\""+FileBaseDir+PrinterImage+"\" ID=\"PrintImage\" TITLE=\"Print current page\" STYLE=\"margin-top:2px;\" ALIGN=\"RIGHT\" HEIGHT=\"16\" WIDTH=\"70\" BORDER=\"0\"></A>\r\n";
  HTML=HTML+"        <SPAN CLASS=\"ModelHeaderSubtitle\">"+productSubtitle.toUpperCase()+"</SPAN>\r\n";
  HTML=HTML+"    <TR>\r\n";
  HTML=HTML+"      <TD COLSPAN=\"3\" CLASS=\"ModelSpacer\">\r\n";

  // next row contains description and schematic.
  // description left
  HTML=HTML+"    <TR>\r\n";
  HTML=HTML+"      <TD CLASS=\"ModelUnboxedB\">\r\n";
  for (i=0;i<productArrayDescription.length;i++)
  {
    if (i) 
    { HTML=HTML+"<BR>\r\n";
    }
    HTML=HTML+"        "+productArrayDescription[i];
  }
  HTML=HTML+"\r\n";
  // spacer
  HTML=HTML+"      <TD CLASS=\"ModelColumn\">&nbsp;\r\n";
  // schematic right
  HTML=HTML+"      <TD CLASS=\"ModelImage\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
  HTML=HTML+"        <CENTER><IMG CLASS=\"SchematicScreen\" ID=\"SchematicScreen\" ALT=\""+productScreen+" Schematic\" TITLE=\""+productScreen+" Schematic\" SRC=\""+FileBaseDir+SchematicsDir+productSchematicScreen+"\" ALIGN=\"CENTER\" HEIGHT=\"256\" WIDTH=\"350\" BORDER=\"0\">\r\n";
  HTML=HTML+"        <IMG CLASS=\"SchematicPrint\" ID=\"SchematicPrint\" ALT=\""+productScreen+" Schematic\" TITLE=\""+productScreen+" Schematic\" SRC=\""+FileBaseDir+SchematicsDir+productSchematicPrint+"\" ALIGN=\"CENTER\" BORDER=\"0\"></CENTER>\r\n";
  
  
  HTML=HTML+"    <TR><TD COLSPAN=\"3\" CLASS=\"ModelSpacer\">&nbsp;\r\n";

  
    
  // next row contains several small tables containing features on the left and inputs/outputs/supply/communication on the right.
  HTML=HTML+"    <TR>\r\n";
  // left column
  HTML=HTML+"      <TD CLASS=\"ModelBoxes\">\r\n";
  
  if (productArrayFeatures) 
  { if (productArrayFeatures.length)
    { // Features
      HTML=HTML+"        <TABLE CLASS=\"Features\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
      HTML=HTML+"          <TR>\r\n";
      HTML=HTML+"            <TD COLSPAN=\"2\" CLASS=\"FeaturesHeader\">"+productArrayFeatures[0]+"\r\n";
      for (i=1;i<productArrayFeatures.length;i++)
      { 
        HTML=HTML+"          <TR>\r\n";
        HTML=HTML+"            <TD CLASS=\"FeaturesBullit\">&bull;\r\n";
        HTML=HTML+"            <TD CLASS=\"FeaturesItem\">"+productArrayFeatures[i]+"\r\n";
      }
      HTML=HTML+"          </TABLE>\r\n";  
    }
  }
  
  // middle column (empty)
  HTML=HTML+"      <TD CLASS=\"ModelColumn\">\r\n";
  
  // right column
  HTML=HTML+"      <TD CLASS=\"ModelBoxes\">\r\n";

  // Create boxes for Signal Inputs, Signal Outputs and Communication arrays
  fTotal=0;
  if (productArrayInputs)
  { if (productArrayInputs.length)
    { // Create box for Signal Inputs -> productArrayInputs contains a list of arrays!
      for (j=0;j<productArrayInputs.length;j++) fTotal=fTotal+productArrayInputs[j].length;
      if (fTotal)
      { // There are entries inside the inputs list, so show them
        HTML=HTML+"        <TABLE CLASS=\"Features\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
        for (j=0;j<productArrayInputs.length;j++)
        { 
          CurrentArray=productArrayInputs[j];
          if (CurrentArray.length)
          {
            HTML=HTML+"          <TR>\r\n";
            HTML=HTML+"            <TD COLSPAN=\"2\" CLASS=\"FeaturesHeader\">"+CurrentArray[0]+"\r\n";
            for (i=1;i<CurrentArray.length;i++)
            { 
              HTML=HTML+"          <TR>\r\n";
              HTML=HTML+"            <TD CLASS=\"FeaturesBullit\">&bull;\r\n";
              HTML=HTML+"            <TD CLASS=\"FeaturesItem\">"+CurrentArray[i]+"\r\n";
            }
          }
        }
        HTML=HTML+"        </TABLE>\r\n";
      }
    }
  }
  
  if (productArrayOutputs)
  { if (productArrayOutputs.length)
    { // Create box for Signal Outputs -> productArrayOutputs contains a list of arrays!
      if (fTotal)
      { // insert spacer after every new table, if a new table is started after that...
        HTML=HTML+"        <TABLE CLASS=\"FeaturesSpacer\"><TR><TD CLASS=\"FeaturesSpacer\"></TABLE>\r\n";
      }
      fTotal=0;
      for (j=0;j<productArrayOutputs.length;j++) fTotal=fTotal+productArrayOutputs[j].length;
      if (fTotal)
      { // There are entries inside the inputs list, so show them
        HTML=HTML+"        <TABLE CLASS=\"Features\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
        for (j=0;j<productArrayOutputs.length;j++)
        { 
          CurrentArray=productArrayOutputs[j];
          if (CurrentArray.length)
          {
            HTML=HTML+"          <TR>\r\n";
            HTML=HTML+"            <TD COLSPAN=\"2\" CLASS=\"FeaturesHeader\">"+CurrentArray[0]+"\r\n";
            for (i=1;i<CurrentArray.length;i++)
            { 
              HTML=HTML+"          <TR>\r\n";
              HTML=HTML+"            <TD CLASS=\"FeaturesBullit\">&bull;\r\n";
              HTML=HTML+"            <TD CLASS=\"FeaturesItem\">"+CurrentArray[i]+"\r\n";
            }
          }
        }
        HTML=HTML+"        </TABLE>\r\n";
      }
    }
  }
  
  
  // next row with application information and hazardous-area information...
  // for printing, we want a page-break here...
  HTML=HTML+"    <TR><TD COLSPAN=\"3\" CLASS=\"ModelSpacer\" ID=\"PageBreak1\">&nbsp;\r\n";
  HTML=HTML+"    <TR>\r\n";
  
  // left column
  HTML=HTML+"      <TD CLASS=\"ModelBoxes\">\r\n";
  
  // applications left
  if (productArrayApplications)
  { if  (productArrayApplications.length)
    { // Applications
      HTML=HTML+"        <TABLE CLASS=\"Features\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
      HTML=HTML+"          <TR>\r\n";
      HTML=HTML+"            <TD CLASS=\"FeaturesHeader\">"+productArrayApplications[0]+"\r\n";
      HTML=HTML+"          <TR>\r\n";
      HTML=HTML+"            <TD CLASS=\"FeaturesItem\">\r\n";
      for (i=1;i<productArrayApplications.length;i++)
      {
        if (i>1) 
        { 
          HTML=HTML+"<BR>\r\n";
        }
        HTML=HTML+"              "+productArrayApplications[i];
      }
      HTML=HTML+"\r\n";
      HTML=HTML+"        </TABLE>\r\n";    
    }
  }
  
  if (productArraySupply)
  { if (productArraySupply.length)
    { // Create box for Supply -> productArraySupply contains a list of arrays!
      // insert spacer after every new table, if a new table is started after that...
      HTML=HTML+"        <TABLE CLASS=\"FeaturesSpacer\"><TR><TD CLASS=\"FeaturesSpacer\"></TABLE>\r\n";
      fTotal=0;
      for (j=0;j<productArraySupply.length;j++) fTotal=fTotal+productArraySupply[j].length;
      if (fTotal)
      { // There are entries inside the inputs list, so show them
        HTML=HTML+"        <TABLE CLASS=\"Features\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
        for (j=0;j<productArraySupply.length;j++)
        { 
          CurrentArray=productArraySupply[j];
          if (CurrentArray.length)
          {
            HTML=HTML+"          <TR>\r\n";
            HTML=HTML+"            <TD COLSPAN=\"2\" CLASS=\"FeaturesHeader\">"+CurrentArray[0]+"\r\n";
            for (i=1;i<CurrentArray.length;i++)
            { 
              HTML=HTML+"          <TR>\r\n";
              HTML=HTML+"            <TD CLASS=\"FeaturesBullit\">&bull;\r\n";
              HTML=HTML+"            <TD CLASS=\"FeaturesItem\">"+CurrentArray[i]+"\r\n";
            }
          }
        }
        HTML=HTML+"        </TABLE>\r\n";
      }
    }
  }
  
  
  // middle column
  HTML=HTML+"      <TD CLASS=\"ModelColumn\">&nbsp;\r\n";

    // right column
  HTML=HTML+"      <TD CLASS=\"ModelBoxes\">\r\n";
  if (productArrayHazardous)
  { if (productArrayHazardous.length)
    { // Create box for hazardous area applications -> productArrayHazardous contains a list of arrays!
      fTotal=0;
      for (j=0;j<productArrayHazardous.length;j++) fTotal=fTotal+productArrayHazardous[j].length;
      if (fTotal)
      { // There are entries inside the list, so show them
        HTML=HTML+"        <TABLE CLASS=\"Features\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
        for (j=0;j<productArrayHazardous.length;j++)
        { 
          CurrentArray=productArrayHazardous[j];
          if (CurrentArray.length)
          {
            HTML=HTML+"          <TR>\r\n";
            HTML=HTML+"            <TD COLSPAN=\"2\" CLASS=\"FeaturesHeader\">"+CurrentArray[0]+"\r\n";
            for (i=1;i<CurrentArray.length;i++)
            { 
              HTML=HTML+"          <TR>\r\n";
              HTML=HTML+"            <TD CLASS=\"FeaturesBullit\">&bull;\r\n";
              HTML=HTML+"            <TD CLASS=\"FeaturesItem\">"+CurrentArray[i]+"\r\n";
            }
          }
        }
        HTML=HTML+"        </TABLE>\r\n";
      }
    }
  }
  if (productArrayCommunication)
  { if (productArrayCommunication.length)
    { // Create box for Communication -> array contains strings to show!
      if (fTotal)
      { // insert spacer after every new table, if a new table is started after that...
        HTML=HTML+"        <TABLE CLASS=\"FeaturesSpacer\"><TR><TD CLASS=\"FeaturesSpacer\"></TABLE>\r\n";
      }
      fTotal=productArrayCommunication.length;
      CurrentArray=productArrayCommunication;
      HTML=HTML+"        <TABLE CLASS=\"Features\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
      HTML=HTML+"          <TR>\r\n";
      HTML=HTML+"            <TD COLSPAN=\"2\" CLASS=\"FeaturesHeader\">"+CurrentArray[0]+"\r\n";
      for (i=1;i<CurrentArray.length;i++)
      { 
        HTML=HTML+"          <TR>\r\n";
        HTML=HTML+"            <TD CLASS=\"FeaturesBullit\">&bull;\r\n";
        HTML=HTML+"            <TD CLASS=\"FeaturesItem\">"+CurrentArray[i]+"\r\n";
      }
      HTML=HTML+"        </TABLE>\r\n";
    }
  }
  
  
  HTML=HTML+"    <TR><TD COLSPAN=\"3\" CLASS=\"ModelSpacer\">&nbsp;\r\n";  
  
  // next row with lcd example and unit image
  HTML=HTML+"    <TR>\r\n";
  // left column
  //HTML=HTML+"      <TD CLASS=\"ModelFeatures\">\r\n";
  //HTML=HTML+"        <TABLE CLASS=\"FeaturesNoBox\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
  //HTML=HTML+"          <TR>\r\n";
  HTML=HTML+"      <TD CLASS=\"ModelImage\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
  HTML=HTML+"        <CENTER><IMG CLASS=\"LCDScreen\" ID=\"LCDScreen\" ALT=\""+productScreen+" Display Example\" TITLE=\""+productScreen+" Display Example\" SRC=\""+FileBaseDir+LCDDir+productLCDScreen+"\" ALIGN=\"CENTER\" VSPACE=\"10\" HEIGHT=\"156\" WIDTH=\"350\" BORDER=\"0\">\r\n";
  HTML=HTML+"        <IMG CLASS=\"LCDPrint\" ID=\"LCDPrint\" ALT=\""+productScreen+" Display Example\" TITLE=\""+productScreen+" Display Example\" SRC=\""+FileBaseDir+LCDDir+productLCDPrint+"\" ALIGN=\"CENTER\" VSPACE=\"5\" BORDER=\"0\"></CENTER>\r\n";
  //HTML=HTML+"        </TABLE>\r\n";
  
  // spacer
  HTML=HTML+"      <TD CLASS=\"ModelColumn\">&nbsp;\r\n";

    // right column
  //HTML=HTML+"      <TD CLASS=\"ModelBoxes\">\r\n";
  //HTML=HTML+"        <TABLE CLASS=\"Features\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
  //HTML=HTML+"          <TR>\r\n";
  HTML=HTML+"        <TD CLASS=\"ModelImage\" ID=\"ModelBox"+(BoxIndex++)+"\">\r\n";
  HTML=HTML+"          <CENTER><IMG CLASS=\"PhotoScreen\" ID=\"PhotoScreen\" ALT=\""+productScreen+" Photograph\" TITLE=\""+productScreen+" Photograph\" SRC=\""+FileBaseDir+PhotoDir+productPhotoScreen+"\" ALIGN=\"CENTER\" VSPACE=\"10\" HEIGHT=\"156\" WIDTH=\"350\" BORDER=\"0\">\r\n";
  HTML=HTML+"          <IMG CLASS=\"PhotoPrint\" ID=\"PhotoPrint\" ALT=\""+productScreen+" Photograph\" TITLE=\""+productScreen+" Photograph\" SRC=\""+FileBaseDir+PhotoDir+productPhotoPrint+"\" ALIGN=\"CENTER\" VSPACE=\"5\" BORDER=\"0\"></CENTER>\r\n";
  //HTML=HTML+"        </TABLE>\r\n";
  
  // Write end of ModelTable
  HTML=HTML+"  </TABLE>";

  document.write(HTML);
}

//=============================================================================
// Copy all HTML data into clipboard text property
// Include following code in html document: <SCRIPT>CopyBodyToClipboard();</SCRIPT>
function CopyBodyToClipboard()
{ 
  window.clipboardData.setData("Text",document.body.innerHTML);
}
//=============================================================================
function setpagebreak()
{ 
  //activate page break -> Taken from map24 printing routine
	//pb = getObject("line"+(i-1));
	//pb.getElement().style.pageBreakAfter = "always";
	//pb.update();					
	
	//
	if (IsIE())
	{ // in our setup, netscape / firefox do not support the pagebreakbefore property and remove the following text...
	  i=1;
	  el = document.getElementById("PageBreak"+(i));
	  while (el)
	  { el.style.pageBreakAfter = "always";
	    i++;
	    el = document.getElementById("PageBreak"+(i));
      
    }
  }
}

//=============================================================================
function emailadresVerbergen( gebruikersnaam, domeinnaam, afbeelden, classname)
{ m1="mai"; m2="lto:";
  if ((afbeelden.length == 0) || (afbeelden.indexOf('@')+1)) 
  { document.write("<a href=" + m1 + m2 + gebruikersnaam + "@" + domeinnaam + " CLASS=\"" + classname + "\">" + gebruikersnaam + "@" + domeinnaam + "</a>"); 
  }
  else 
  { document.write("<a href=" + m1 + m2+ gebruikersnaam + "@" + domeinnaam + " CLASS=\"" + classname +  "\">" + afbeelden + "</a>"); 
  }
}

function emailadresVerbergenSpan( gebruikersnaam, domeinnaam, afbeelden, spanstyle)
{ m1="mai"; m2="lto:";
  if ((afbeelden.length == 0) || (afbeelden.indexOf('@')+1)) 
  { document.write("<a href=" + m1 + m2 + gebruikersnaam + "@" + domeinnaam + "><SPAN STYLE=\"" + spanstyle + "\">" + gebruikersnaam + "@" + domeinnaam + "</SPAN></a>"); 
  }
  else 
  { document.write("<a href=" + m1 + m2+ gebruikersnaam + "@" + domeinnaam + "><SPAN STYLE=\"" + spanstyle +  "\">" + afbeelden + "</SPAN></a>"); 
  }
}

//=============================================================================
function SetBorderColor(ElID,ElColor)
{ 
  EL=document.getElementById(ElID);
  if (EL)
  { 
    if (EL.style)
    {
      EL.style.borderColor=ElColor;
    }
  }
}
  
function SetBorder(El)
{ 
  if (El)
  {
    SetBorderColor("IMG"+El.id.substring(3,El.id.length),"#FF7400");
  }
}

function ClearBorder(El)
{ 
  if (El)
  {
    SetBorderColor("IMG"+El.id.substring(3,El.id.length),"#1D6497");
  }
}

//=============================================================================
function SetFlag(El)
{ // Assume flags are displayed with hspace of 10, vspace of 6, width of 32 and height of 16
  // Leave 1 pixel of vspace for spacing to surrounding text, use the rest to enlarge flag
  // Make sure to reduce the vspace first and then to enlarge the height, so netscape and firefox don't enlarge the browser window (flickers!)
  ElID="IMG"+El.id.substring(3,El.id.length);
  El2=document.getElementById(ElID);
  if (El2)
  { El2.hspace=El2.hspace-10;
    El2.vspace=El2.vspace-5;
    El2.width=El2.width+2*10;
    El2.height=El2.height+2*5;
  }
  
  ElID="TXT"+El.id.substring(3,El.id.length);
  El2=document.getElementById(ElID);
  if (El2)
  { El2.style.fontSize="8pt";
    El2.style.textDecoration="underline";
  }
}

function ClearFlag(El)
{ // Assume flags are displayed with hspace of 10, vspace of 6, width of 32 and height of 16
  // Leave 1 pixel of vspace for spacing to surrounding text, use the rest to enlarge flag
  // Make sure to reduce the height first and then to enlarge the vspace, so netscape and firefox don't enlarge the browser window (flickers!)
  ElID="IMG"+El.id.substring(3,El.id.length);
  El2=document.getElementById(ElID);
  if (El2)
  { El2.height=El2.height-2*5;
    El2.width=El2.width-2*10;
    El2.vspace=El2.vspace+5;
    El2.hspace=El2.hspace+10;
  }
  
  ElID="TXT"+El.id.substring(3,El.id.length);
  El2=document.getElementById(ElID);
  if (El2)
  { El2.style.fontSize="7pt";
    El2.style.textDecoration="none";
  }
}

//=============================================================================
function SetPDF(El)
{ // Assume flags are displayed with hspace of 10, vspace of 6, width of 32 and height of 16
  // Leave 1 pixel of vspace for spacing to surrounding text, use the rest to enlarge flag
  // Make sure to reduce the vspace first and then to enlarge the height, so netscape and firefox don't enlarge the browser window (flickers!)
  ElID="PDF"+El.id.substring(3,El.id.length);
  El2=document.getElementById(ElID);
  if (El2)
  { El2.hspace=El2.hspace-8;
    El2.vspace=El2.vspace-8;
    El2.width=El2.width+16;
    El2.height=El2.height+16;
  }
}

function ClearPDF(El)
{ // Assume flags are displayed with hspace of 10, vspace of 6, width of 32 and height of 16
  // Leave 1 pixel of vspace for spacing to surrounding text, use the rest to enlarge flag
  // Make sure to reduce the height first and then to enlarge the vspace, so netscape and firefox don't enlarge the browser window (flickers!)
  ElID="PDF"+El.id.substring(3,El.id.length);
  El2=document.getElementById(ElID);
  if (El2)
  { El2.height=El2.height-16;
    El2.width=El2.width-16;
    El2.vspace=El2.vspace+8;
    El2.hspace=El2.hspace+8;
  }
}

//=============================================================================
function openbrowserwindow (newURL,windowname,features)
{
  var newwindow=window.open(newURL,windowname,features);
  newwindow.focus()
}

//=============================================================================
function openbrowserwindowImage (newIMG,windowname,features)
{
  var newwindow=window.open(FileBaseDir+"imagepopup.html?SRC="+newIMG,windowname,features);
  newwindow.focus()
}

function OpenImage(newIMG)
{
  var newwindow=window.open(FileBaseDir+"imagepopup.html?"+FileBaseDir+newIMG,"Image","location=no,scrollbars=yes,status=yes,toolbar=no,resizable=yes,width=200,height=200,top=0,left=0");
  newwindow.focus();
}

function OpenPressImage(newIMG)
{
  var newwindow=window.open(FileBaseDir+"../imagepopup.html?"+newIMG,"Image","location=no,scrollbars=yes,status=yes,toolbar=no,resizable=yes,width=200,height=200,top=0,left=0");
  newwindow.focus();
}

function OpenPressRelease(newURL)
{ 
  var newwindow=window.open(FileBaseDir+"press/"+newURL+".html","PRItem","location=no,scrollbars=yes,status=yes,toolbar=no,resizable=yes,width=800,height=560,top=0,left=0");
  newwindow.focus();
}

function WritePressLink(newLink,newText)
{ 
  HTML="<A CLASS=\"PressLink\" HREF=\"javascript:OpenPressRelease('"+newLink+"')\">"+newText+"</A>";
  document.write(HTML);
}
//=============================================================================
function ContainsModelEntry(fModelName,fEntryList)
{ // fEntryList contains a comma separated list.
  // return 1 if fModelName is found in the list
  // return 0 if not
  if (fEntryList)
  {
    while (fEntryList!="")
    {
      k=fEntryList.indexOf(",");
      if (k!=-1)
      {
        entryName=fEntryList.substring(0,k);
        fEntryList=fEntryList.substring(k+1,fEntryList.length);
      }
      else
      {
        entryName=fEntryList;
        fEntryList="";
      }
      if (entryName==fModelName) return 1;
    }
  }
  return 0;
}

//=============================================================================
function openmodel(fModelName)
{ // Search the modelentry in the arrays and open the page in the current view.
  // Give the grouplink reference if a model is selected (eg f010), otherwise just open the group (eg 0300-Series).
  if (self.location.search!="")
  { // check to see if the URL specifies a groupName...
    groupName=self.location.search;
    if (groupName.charAt(0)=='?')
    {
      groupName=groupName.substring(1,groupName.length);
    }
  }
  linkName="";
  entrynr=GetPMenu(fModelName); // specified a productsArrayName in products.js?
  if (entrynr==-1) entrynr=GetPMenuScreen(fModelName); // specified a productsArrayScreen in products.js?
  if (entrynr!=-1) // entry from products.js is specified
  { i=entrynr;
    fModelName=productsArrayName[i]; // routine probabely called with Screen name, but we need search the entry list with the internal name,
    linkName=FileBaseDir+productsArrayLink[i];
    if ((productsArrayGroupStart) && (productsArrayList))
    { 
      if (i<productsArrayGroupStart)
      { // not a group selected, now check if the modelname is entered in the current group.
        // if not, select the first group that does have it...
        i=productsArrayGroupStart;
        while (i<productsArrayName.length)
        { if (productsArrayName[i]==groupName) 
          { // found the selected group
            if (ContainsModelEntry(fModelName,productsArrayList[i]))
            { // yes, found this model in this group!
              break;
            }
            else i=productsArrayName.length;
          }
          else i++;
        }
        
        if (i==productsArrayName.length)
        { // no, find the main group of this product
          groupName="";
          i=productsArrayGroupStart;
          while (i<productsArrayName.length)
          { 
            if (ContainsModelEntry(fModelName,productsArrayList[i]))
            {
              groupName=productsArrayName[i];
              break;
            }
            i++;
          
          }
        }        
        if (groupName!="") linkName=linkName+"?"+groupName;
        
      }
    }
    else 
    { // no group start or productsarraylist specified, just use current groupname
      linkName=linkName+"?"+groupName;
    }
  }
  else
  { // entry from products.js is NOT specified so try to find it in menu.js array...
    i=0;
    while (i<menuArrayName.length)
    { j=0;
      while (j<menuArrayName[i].length)
      { if (menuArrayName[i][j]==fModelName)
        { // found a corresponding entry...
          linkName=FileBaseDir+menuArrayLink[i][j];
          entrynr=0;
          break;
        }
        else j++;
      }
      if (entrynr!=-1) break;
      else i++;
    }
  }
  if (entrynr!=-1)
  { if (window.navigate)
    { // IE
      window.navigate(linkName);
    }
    else
    { // FF / NS
      self.location=linkName;
    }
  }
}

//=============================================================================
