<!--

  /************************************************************\
  *
  *	  PHP codeGen Copyright 2007 - Derek Harvey & Matthew Jaggard
  *	  www.lotsofcode.com
  *
  *	  This file is part of PHP codeGen.
  *
  *	  PHP codeGen is free software; you can redistribute it and/or modify
  *	  it under the terms of the GNU General Public License as published by
  *	  the Free Software Foundation; either version 2 of the License, or
  *	  (at your option) any later version.
  *
  *	  PHP codeGen is distributed in the hope that it will be useful,
  *	  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *	  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
  *	  GNU General Public License for more details.
  *
  *	  You should have received a copy of the GNU General Public License
  *	  along with PHP codeGen; if not, write to the Free Software
  *	  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA	02111-1307	USA
  *
  \************************************************************/

	function selectAll(formObj, nameSearch, masterElement, methodType)
	{
		var form = document.myform;
		for (var i = 0; i < formObj.length; i++)
		{		
      fldObj = formObj.elements[i];
      if (fldObj.type == 'checkbox')
      {
      	if (fldObj.getAttribute('class') == nameSearch)
      	{
          switch (methodType)
          {
            default: // Inverse
              fldObj.checked = (fldObj.checked) ? false : true;
              break;
              
            case 1: // Check
              fldObj.checked = true;
              masterElement.checked = false;
              break;

            case 1: // UnCheck
              fldObj.checked = false;
              masterElement.checked = false;
              break;
          }
      	}
			}
		}
	}

-->

