function popWin(h,w,url,attr) {
   var openstr = "width=" + w + ",height=" + h + attr;
   window.open(url,"twin",openstr);

   return false;
}

function helpWin(aff) {
   window.open("/perl/pia?stype=aff&step=help&js=1&aff=" + aff ,"help","scrollbars=1,width=557,height=500");
}


function set_step(d,step) {

   return;
}

function check_easy(d) {
   var check=0;
  
   // Verify that a broad category has been selected
   for (i=1, n=d.bcat.length; i<n; i++) {
      if (d.bcat[i].selected) {
          check=1;
          break;
      } 
   }
   if (!check) {
      alert('Please Select a Category');
      return false;
   }

   // Verify that at least one sub-category has been selected
   check=0;
   for (i=0, n=d.subcat.length; i<n; i++) {
      if (d.subcat[i].selected) {
          check=1;
          break;
      }  
   }
   if (!check) {
      alert('Please Select One or More Sub-categories');
      return false;
   }

   return true;
}

function check_company(d) {
   if (d.company.value == "") {
      alert('Please Enter a Company Name');
      d.company.focus();
      return false;
   }

   return true;
}

function check_keyword(d) {
   if (d.keyword.value == "") {
      alert('Please Enter One or More Keywords');
      d.keyword.focus();
      return false;
   }

   return true;
}

function check_equip(d) {
   if (d.equip.value == "") {
      alert('Please Enter a Piece of Equipment');
      d.equip.focus();
      return false;
   }

   return true;
}

function loadEquip(t) {
    var str='';
    
    // Look at each checked box to see if it's checked 
    for (var c = 0; c < t.elements.length; c++) {
        if (t.elements[c].type == 'checkbox' && t.elements[c].checked) {
            // Add the text string to the list
            str = str + '"'  + t.elements[c].value + '" ';
        }    
    }
    
   // Put the text string in the equipment field in the main page
   if (window.opener && !window.opener.closed) {
       window.opener.document.equip_form.equip.value = str;
       window.opener.document.equip_form.equip.focus();
   }
    self.close();
    
    return false;
}
