﻿// JScript File
<!--//
/*
toggleField()
Param: obj object - This is the form field that calls this function
Param: val string - This is the string that is matched against the contents of the form field.
This function clears a targeted form field.
*/
    function toggleLayer( whichLayer )
    {
        deactivateTab('lnkProductSpec-Features');
        deactivateTab('lnkProductSpec-Specification');
        deactivateTab('lnkProductSpec-Guides');
        deactivateTab('lnkProductSpec-Options');
        activateTab('lnk'+whichLayer);

        hideLayer('ProductSpec-Features');
        hideLayer('ProductSpec-Specification');
        hideLayer('ProductSpec-Guides');
        hideLayer('ProductSpec-Options');
        showLayer(whichLayer);
    }

    function activateTab( whichLayer )
    {
      var elem, vis;
      if( document.getElementById ) // this is the way the standards work
        elem = document.getElementById( whichLayer );
      else if( document.all ) // this is the way old msie versions work
        elem = document.all[whichLayer];
      else if( document.layers ) // this is the way nn4 works
        elem = document.layers[whichLayer];
      elem.className = "navlistitemcurrent";
    }

    function deactivateTab( whichLayer )
    {
      var elem, vis;
      if( document.getElementById ) // this is the way the standards work
        elem = document.getElementById( whichLayer );
      else if( document.all ) // this is the way old msie versions work
        elem = document.all[whichLayer];
      else if( document.layers ) // this is the way nn4 works
        elem = document.layers[whichLayer];
      elem.className = "navlistitem";
    }


    function hideLayer( whichLayer )
    {
      var elem, vis;
      if( document.getElementById ) // this is the way the standards work
        elem = document.getElementById( whichLayer );
      else if( document.all ) // this is the way old msie versions work
        elem = document.all[whichLayer];
      else if( document.layers ) // this is the way nn4 works
        elem = document.layers[whichLayer];
      vis = elem.style;
      vis.display = 'none';
    }

    function showLayer( whichLayer )
    {
      var elem, vis;
      if( document.getElementById ) // this is the way the standards work
        elem = document.getElementById( whichLayer );
      else if( document.all ) // this is the way old msie versions work
        elem = document.all[whichLayer];
      else if( document.layers ) // this is the way nn4 works
        elem = document.layers[whichLayer];
      vis = elem.style;
      if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
        vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
      vis.display = (vis.display==''||vis.display=='block')?'none':'block';
    }
//-->
