//list of fields to be vaildated
var fieldsToVal = new Array("Name","Email");
//names to display for error message
var fieldsToValName = new Array("Name","Email Address");
function validateForm(theForm)
{
   var output = '';
   var found;

   for(var i = 0; i < fieldsToVal.length; i++)
   {
      found = false;
      //if element is a text field
      if(theForm.elements[fieldsToVal[i]].type == 'text')
     {
         if(theForm.elements[fieldsToVal[i]].value != '')
         {
            found = true;
         }
      }
      //if element is a select 
      else if(theForm.elements[fieldsToVal[i]].type == 'select-one')
      {
        if(theForm.elements[fieldsToVal[i]].selectedIndex != 0)
        {
           found = true;
         }
      }
 // ***IMPORTANT check for radio buttons and checkboxs last
      //if element is a checkbox or radio button
      else if(theForm.elements[fieldsToVal[i]][0])
      {
         for(var j=0; j>theForm.elements[fieldsToVal[i]].length; j++)
         {
            if(theForm.elements[fieldsToVal[i]][j].checked)
            {
               found = true;
            }
         }
      }
      if(found != true)
      {
         output += fieldsToValName[i]+'\n';
      }
   }
   if(output.length != 0)
   {
      output = 'Please complete the following fields:\n' + output;
      alert (output);
      return false;
   }
   else
   {
   return true;
   }

}


function newPage()
{
	newWin = window.open('contact.html', 'newWin', 'width=350,height=350,location=no,scrollbars=no,resizable=no')
}


if(document.images)
{
	home0 = new Image
	home1 = new Image
	home0.src = "images/home0.gif"
	home1.src = "images/home1.gif"
	
	services0 = new Image
	services1 = new Image
	services0.src = "images/services0.gif"
	services1.src = "images/services1.gif"
	
	contact0 = new Image
	contact1 = new Image
	contact0.src = "images/contact0.gif"
	contact1.src = "images/contact1.gif"
	
	products0 = new Image
	products1 = new Image
	products0.src = "images/products0.gif"
	products1.src = "images/products1.gif"
	
	networks0 = new Image
	networks1 = new Image
	networks0.src = "images/networks0.gif"
	networks1.src = "images/networks1.gif"
}

function HiLite(imgName)
{
  if (document.images) 
  	 {
	    document.images[imgName].src = eval(imgName + "1.src");
     }
}

function LoLite(imgName) 
{
  if (document.images) 
  	 {
        document.images[imgName].src = eval(imgName + "0.src");
  	 }
}

function chngeLoc(anchor)
{	
	anchr = anchor.options[anchor.selectedIndex].value;
	top.location.href = "products.html#" + anchr;
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
