var browser = navigator.userAgent.toLowerCase();
var browserIE = ( browser.indexOf("msie") != -1 );
var today = new Date();
var thisYear = today.getFullYear();

function lineSpecs( p_pageId, p_URL, p_item, p_subMenu ) {
    this.pageId = p_pageId;
    this.URL = p_URL;
    this.item = p_item;
    this.subMenu = p_subMenu;
}

var allLines = new Array();
var nextLine = -1;
allLines[++nextLine] = new lineSpecs('', 'lines.html#agi', 'AGI', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#henkel', 'Ablestik', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#nordson', 'Asymtek', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#aven', 'Aven', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#cablescan', 'Cablescan', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#cavist', 'Cavist', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#cyberoptics', 'CyberOptics Corp.', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#henkel', 'Dexter', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#henkel', 'E&amp;C', false );
      /* allLines[++nextLine] = new lineSpecs('', 'lines.html#emc', 'EMC Global Technologies', false ); */
allLines[++nextLine] = new lineSpecs('', 'lines.html#eubanks', 'Eubanks', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#yxlon', 'FEINFOCUS', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#henkel', 'Henkel', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#gen3', 'Gen3', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#hover-davis', 'Hover-Davis', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#humiseal', 'HumiSeal', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#henkel', 'Hysol', false );
      /* allLines[++nextLine] = new lineSpecs('', 'lines.html#iet', 'IET', false ); */
allLines[++nextLine] = new lineSpecs('', 'lines.html#jbc', 'JBC', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#jnj', 'JNJ Consumable Supplies', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#jotautomation', 'JOT Automation', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#kic', 'KIC Thermal Profiling', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#henkel', 'Loctite', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#met', 'Metal Etching Technology', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#matr', 'Mid-America', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#henkel', 'Multicore-Solders', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#nordson', 'Nordson', false );
	    // removed on 16-Nov-2006 
      // allLines[++nextLine] = new lineSpecs('', 'lines.html#seica', 'Seica Test Solutions', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#universalInstruments', 'Universal Instruments', false );
      // added on 10-Mar-2008
allLines[++nextLine] = new lineSpecs('', 'lines.html#unovis', 'Unovis Solutions', false );
      // removed on 7-Mar-2008 
      // allLines[++nextLine] = new lineSpecs('', 'lines.html#utz', 'UTZ Technologies', false );
allLines[++nextLine] = new lineSpecs('', 'lines.html#yxlon', 'YXLON', false );

/*
 * --------------------------------------------------------------------------------
 * addLoadEvent will execute a JavaScript command/function when a page is
 * brought up in a browser.  Ordinarily only one such command/function can be
 * performed at that time, but addLoadEvent overrides that limitation.
 * --------------------------------------------------------------------------------
 */

function addLoadEvent(func) {
// Multiple onload function created by: Simon Willison
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

/*
********************************************************************************
 */

function displayItem(p_pageId, p_URL, p_item, p_subMenu ) {
  var aOpen = ( '<a href="' + p_URL + '">'  );
  var liOpen = '<li>';
  var aClose = '</a>'
  
  if ( filename == p_pageId )
    aOpen = '<a class="urhere" title="You are here">';
  if ( p_pageId == 'index' )
    liOpen = '<li class="leftItem">';
  if ( p_pageId == '' )
    liOpen = ( '\t' + liOpen )
  if ( !p_subMenu )
    aClose = ( aClose + '</li>' );

  document.write(liOpen + aOpen + p_item + aClose + '\n');
  return;
}

function displayMenu() {
  var subMenu;
  
  document.write('<table border="0" align="center" cellspacing="0" cellpadding="0"><tr><td>\n');
  document.write('<ul id="nav">\n');
  if ( devEnviron() == 'Production' )
	displayItem('index', 'http://www.ztechservices.com/', 'Home', false )
  else
	displayItem('index', 'index.html', 'Home', false );

  subMenu = ( filename != 'team' );
  displayItem('team', 'team.html', 'Team', subMenu );
  if ( subMenu ) {
    document.write('\t<ul>\n');
      displayItem('', 'team.html#DanCzyzewicz', 'Daniel J. Czyzewicz', false );
	  displayItem('', 'team.html#TomJura', 'Thomas T. Jura', false );
	  displayItem('', 'team.html#JonMoore', 'Jon A. Moore', false );
	  /* displayItem('', 'team.html#DavePolmanteer', 'David Polmanteer', false ); */
      displayItem('', 'team.html#DonnaCzyzewicz', 'Donna Czyzewicz', false );
    document.write('\t</ul>\n</li>\n');
  } 

  subMenu = ( filename != 'lines' );
  displayItem('lines', 'lines.html', 'Lines', subMenu );
  if ( subMenu ) {
    document.write('\t<ul>\n');
    for ( i in allLines )
      displayItem( allLines[i].pageId, allLines[i].URL, allLines[i].item, allLines[i].subMenu );
    document.write('\t</ul>\n</li>\n');
  } 
  displayItem('events', 'events.html', 'Events', false );
  document.write('</ul>\n');
  document.write('</td></tr></table>');
  return;
}

function displayFooter() {
  /* 
   * +++
   * 
   * Function Name: displayFooter
   *        Author: Alvin Orzechowski, MyFirstWebPage.net
   * Creation Date: 3-Nov-2004
   *      Abstract: To display the footer information
   *   Description: The footer information and layout is determined by which 
   *                page is being displayed and which browser is being used.
   *    Parameters: 
   *       History: 
   *
   * ---
   */

  // [ displayFooter Constants ]
    var isIndexPage = ( filename == 'index' );

  // [ displayFooter Variables ]

  // [ displayFooter Main Line ]
    if ( browserIE )
      document.write('<div id="cpyrt" class="browserIE">')
    else
      document.write('<div id="cpyrt">');  
      document.write('<p>');  
    if ( filename == 'index' ) {
      document.write('<a href="JavaScript:addToFavorites()">Click here<\/a> to bookmark this page');
      document.write('<br>');
    } // end if ( filename == 'index' )
    document.write('<span class="ztechfont">www.ztechservices.com</span> hosted by ');
    document.write('<span class="erampname"><a href="http://www.entranceramp.com/" target="_blank">');
    document.write('entrance ramp');
    document.write('<\/a><\/span>');
    document.write('<br>');
    document.write('Web page design and maintenance by ');
    document.write('<span class="MFWPNlogo"><a href="http://myfirstwebpage.net" target="_blank">');
    document.write(get_mfwpnLogo('tm'));
    document.write('<\/a></span>');
    document.write('<br>');
    document.write('Copyright &#169; ' + thisYear + ' by <span class="ztechname">');
    if ( isIndexPage )
      document.write('Z TECH SERVICES, INC.')
    else
	  document.write('Z TECH SERVICES, INC.');
      /* document.write('<a href="' + msg2BL(0,'Request for Binding Legacies Information') + '" class="BLlink">Z TECH SERVICES, INC.<\/a>'); */
    document.write('<\/span>');
    document.write('<\/div> <!-- end cpyrt -->');

  // [ displayFooter End of Job ]
  return;

} // end displayFooter function

function addToFavorites() {
  /* 
   * +++
   * 
   * Function Name: addToFavorites
   *        Author: Alvin Orzechowski, MyFirstWebPage.net
   * Creation Date: 3-Nov-2004
   *      Abstract: To put Z Tech Services in the browser's Favorites list
   *   Description: 
   *    Parameters: None
   *       History: 
   *
   * ---
   */

  // [ addToFavorites Constants ]
    var urlAddress = "http://www.ztechservices.com";
    var pageName = "Z Tech Services";

  // [ addToFavorites Variables ]

  // [ addToFavorites Main Line ]
    if (window.external) {
      window.external.AddFavorite(urlAddress,pageName);
    }
    else { !(window.external)
      alert("Sorry, your browser does not support this function.");
    } // end if (window.external)

  // [ addToFavorites End of Job ]
  return;

} // end addToFavorites function

/*
********************************************************************************
 */

function getElementsByClass(searchClass,tag) {
 // Source: http://www.dustindiaz.com/getelementsbyclass/
 var classElements = new Array();
 if ( tag == null )
   tag = '*';
 var els = document.getElementsByTagName(tag);
 var elsLen = els.length;
 var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)');
 
 for (i = 0, j = 0; i < elsLen; i++) {
   if ( pattern.test(els[i].className) ) {
     classElements[j] = els[i];
     j++;
     }
   }
 return classElements;
 }

/*
********************************************************************************
 */
 
function modifyImgLeftSide() {
 /* 
  * ++
  * Name: modifyImgLeftSide
  * Author: Alvin Orzechowski, MyFirstWebPage.net
  * Creation Date: 17-Feb-2010
  * Abstract: To change every other occurance of the leftSide class to 
  *           rightSide.
  * Description: 
  * Parameters:  None
  * History:
  * --
  */
 // [ modifyImgLeftSide Constants ]
 var allImgs = getElementsByClass('leftSide', 'img');

 // [ modifyImgLeftSide Main Line ]
 if ( allImgs.length >= 2 )
   for (i=1; i<allImgs.length; i++) {
     allImgs[i].className = "rightSide";
     i++;
     } // end for (i=0; i<allImgs.length; i++)

 return;
 } // end modifyImgLeftSide function

/*
 * MyFirstWebPage.net specific functions
 * Leave this section at the end
 */

function get_mfwpnLogo(pTM) {
  var mfwpnLogo = '<span class="MFWPNlogo">' +
  '<span style="color: #000000;">My</span>' +
  '<span style="color: #ff0000;">First</span>' +
  '<span style="color: #00ff00;">Web</span>' +
  '<span style="color: #0000ff;">Page</span>' +
  '<span style="color: #000000;">.net';

  if ( pTM == 'tm' )
    mfwpnLogo = ( mfwpnLogo + '&#153;' );
  mfwpnLogo = ( mfwpnLogo + '</span></span>' );

return mfwpnLogo;
} // end get_mfwpnLogo function