if (document.getElementById('selbt') != null) {
  if (document.getElementById('selbt_frm').value.toLowerCase() == 'true') {
    document.getElementById('selbt').checked = true;
  }
}

function StepHighLight(e) {
 e.className = 'PairingStepsHigh';
}

function StepLowLight(e) {
  e.className = 'PairingSteps';
}

function helpHighlight(e, iMode) {
  if (iMode == 1) {
    e.style.textDecoration = 'underline';
    e.style.cursor = 'pointer';
  }
  else {
    e.style.textDecoration = 'none';
    e.style.cursor = 'default';
  }
}

function StepHighLightHelp(e, iMode) {
  if (iMode == 1) {
    e.className = 'HelpStepHigh';
  }
  else {
    e.className = 'HelpStep';
  }
}



function onSelect(sItemID) {
  if (sItemID == 'selbt') {
    document.getElementById(sItemID + '_frm').value = document.getElementById(sItemID).checked;
  }
  else {
    document.getElementById(sItemID + '_frm').value = document.getElementById(sItemID).value;
  }
  document.getElementById('action').value = sItemID;
  //Submit if we have changed a list or have changed the the Bluetooth option and have selected a country
  //and thus have data that need updating
  if (sItemID != 'selbt') { //We have changed a list
    //alert(document.getElementById(sItemID + '_frm').value);
    document.forms.pairingguidedata.submit();
  }
  else {
    if (document.getElementById('selcountry_frm').value != '') { //We need to regenerate manufacturer and model lists
      //alert(document.getElementById(sItemID + '_frm').value);
      document.forms.pairingguidedata.submit();
    }
  }
}

function SetStepAndSubmit(iStep) {
  //alert('Go to ' + iStep);
  document.getElementById('action').value = iStep;
  document.forms.pairingguidedata.submit();
}

function NextPrevHighlight (sID, e) {
  document.getElementById(sID).style.textDecoration='underline';
  e.style.cursor='pointer';
}

function NextPrevLowlight (sID, e) {
  document.getElementById(sID).style.textDecoration='none';
  e.style.cursor='default';
}
