function dispatchThumbs() {
  var isChecked = false;
  var thumbnailTable = window.frames['iframeSharedImage'].document.getElementById('thumbnailTable');
  var inputChildren = thumbnailTable.getElementsByTagName("INPUT");
  for (var i = 0; i<inputChildren.length;i++)
  {
      //alert("inputChildren[i].type = "+inputChildren[i].type);
      if(inputChildren[i].type == 'checkbox')
      {
          checkboxElement = inputChildren[i];
          //alert(checkboxElement.checked);
          if(checkboxElement.checked == true) {
            isChecked = true;
          }
       }
  }
  if (isChecked) {
    window.frames['iframeSharedImage'].document.forms['SharedThumbnailForm'].submit();
  } else {
    alert("Select one or more photos.");
  }
}

function dispatchAlbum() {
  var isChecked = false;
  var albumTable = window.frames['iframeSharedImage'].document.getElementById('albumcontainer');
  var inputChildren = albumTable.getElementsByTagName("INPUT");
  for (var i = 0; i<inputChildren.length;i++)
  {
      //alert("inputChildren[i].type = "+inputChildren[i].type);
      if(inputChildren[i].type == 'checkbox')
      {
          checkboxElement = inputChildren[i];
          //alert(checkboxElement.checked);
          if(checkboxElement.checked == true) {
            isChecked = true;
          }
       }
  }
  if (isChecked) {
    window.frames['iframeSharedImage'].document.forms['SharedAlbumForm'].submit();
  } else {
    alert("Select one or more albums.");
  }
}

function dispatchImage() {
  var albumTable = window.frames['iframeSharedImage'].document.forms['SharedThumbnailInfoForm'].submit();
}

function selectThumbs(checkedState) {
  var thumbnailTable = window.frames['iframeSharedImage'].document.getElementById('thumbnailTable');
  var inputChildren = thumbnailTable.getElementsByTagName("INPUT");
  for (var i = 0; i<inputChildren.length;i++) {
    //alert("inputChildren[i].type = "+inputChildren[i].type);
    if(inputChildren[i].type == 'checkbox') {
      checkboxElement = inputChildren[i];
      //alert(checkboxElement.checked);
      checkboxElement.checked = checkedState;
    }
  }
}

function selectAlbum(checkedState) {
  var albumTable = window.frames['iframeSharedImage'].document.getElementById('albumcontainer');
  var inputChildren = albumTable.getElementsByTagName("INPUT");
  for (var i = 0; i<inputChildren.length;i++) {
    if(inputChildren[i].type == 'checkbox') {
      checkboxElement = inputChildren[i];
      //alert(checkboxElement.checked);
      checkboxElement.checked = checkedState;
    }
  }
}

