﻿var imgSelectedRadio = undefined;
var txtSelectedRadio = undefined;

function CheckRadio(hook1, hook2)
 {
  hook1.src   = 'images/radioChecked.gif';
  hook2.value = 1;
 }

function CheckUncheckCheckbox(hook1, hook2)
 {
  if (hook1.src.substring(hook1.src.length-28, hook1.src.length) == 'images/checkboxUnchecked.gif')
     {
      hook1.src   = 'images/checkboxChecked.gif';
      hook2.value = 1;
     }
  else
     {
      hook1.src   = 'images/checkboxUnchecked.gif'
      hook2.value = 0;
     }
 }

function CheckUncheckRadio(hook1, hook2)
 {
  if (hook1.src.substring(hook1.src.length-25, hook1.src.length) == 'images/radioUnchecked.gif')
     {
      hook1.src   = 'images/radioChecked.gif';
      hook2.value = 1;

      if (txtSelectedRadio != undefined)
         {
          imgSelectedRadio.src   = 'images/radioUnchecked.gif'
          txtSelectedRadio.value = 0;
         }

      imgSelectedRadio = hook1;
      txtSelectedRadio = hook2;
     }
  else
     {
      hook1.src   = 'images/radioUnchecked.gif'
      hook2.value = 0;

      imgSelectedRadio = undefined;
      txtSelectedRadio = undefined;
     }
 }