 function chckBox(el) {
  var thisGroup=el.getAttribute('groupId');
  if (thisGroup<=0) return;
  var chboxes=document.forms[0]['r_eventArr'];
  for (var i=0; i<chboxes.length; i++) {
    if (chboxes[i]!= el &&  chboxes[i].getAttribute('groupId')==thisGroup) {
     chboxes[i].checked=false;
    }
  }
 }

 function setReviewed() {
  var f= document.forms[0];
  for (var i=0; i<f.length; i++) {
   if (f[i].name.indexOf('cat')==0 && f[i].value=='') {
     f['formCompleted'].value='0';
     return true;
   }
  }
  f['formCompleted'].value='1';
  return true;
 }

 function setUcFirst(s) {
   if (s.value != '') {
    if (s.value.charAt(0)==s.value.charAt(0).toUpperCase()) return;
    s.value=s.value.charAt(0).toUpperCase() + s.value.substring(1,s.value.length);
   }
 }

 function setUcAll(s) {
  s.value=s.value.toUpperCase();
 }

 function gotoForm(n) {
   document.location='index.do?action=create&formId=' + n;
 }

 function showForgotten() {
  popup_left=(window.screen.width/2)-(450/2+10);
  popup_top=(window.screen.height/2)-(400/2+50);
  window1 = window.open('/popup.html','pwd','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=450,height=400,left='+popup_left+',top='+popup_top+',screenX='+popup_left+',screenY='+popup_top);
  window1.blur();
  window1.focus();
 }

 function selectAllAbstracts() {
   var checkboxes = document.getElementsByName("abstractId");
   for (var i = 0; i < checkboxes.length; i++) {
     checkboxes[i].checked = true;
   }
 }

 function deselectAllAbstracts() {
   var checkboxes = document.getElementsByName("abstractId");
   for (var i = 0; i < checkboxes.length; i++) {
     checkboxes[i].checked = false;
   }
 }
 
 function switchDoubleButtons() {
   if (useRegistrationIndex == 'false') {
     var doubleButtons = YAHOO.util.Dom.getElementsByClassName('double-button', 'span');
     if (doubleButtons.length == 2) {
       var first = doubleButtons[0];
       var firstParent = first.parentNode;
       var second = doubleButtons[1];
       var secondParent = second.parentNode;
       // switch children
       firstParent.removeChild(first);
       secondParent.removeChild(second);
       firstParent.appendChild(second);
       secondParent.appendChild(first);
     }
   }
 }
