// -----------------------------------------------------------------------------
function sayit() {
  if (document.getSelection) { // older Mozilla versions
    var selectedString = document.getSelection();
  } else if (document.all) { // MSIE 4+
    var selectedString = document.selection.createRange().text;
  } else if (window.getSelection) { // recent Mozilla versions
    var selectedString = window.getSelection();
  }
  
  document.rs_form.rstext.value = selectedString;

  if (document.rs_form.url.value=='') {
    if (window.location.href) {
      document.rs_form.url.value = window.location.href;
    } else if (document.location.href) {
      document.rs_form.url.value = document.location.href;
    }
  }

}

// -----------------------------------------------------------------------------
function copyselected() {
  setTimeout("sayit()",50);
  return true;
}

// -----------------------------------------------------------------------------
function readspeaker() {

  var cText;

  if (document.getElementById('readspeaker')) { // is readspeaker div available?
    if (document.all) { //IE
      cText = document.getElementById('readspeaker').innerText;
    } else { //FF
    cText = document.getElementById('readspeaker').textContent;
    }   
  }

  if (window.location.href) { 
    //document.rs_form.url.value = window.location.href; 
    document.getElementById('url').value = window.location.href;
  } else if (document.location.href) { 
    //document.rs_form.url.value = document.location.href; 
    document.getElementById('url').value = document.location.href; 
  }
  //document.rs_form.rstext.value = cText;
  document.getElementById('rstext').value = cText;
  document.rs_form.submit();
}

// -----------------------------------------------------------------------------