  function insertAtCursor(myField, myValue)
  { 
    //IE support 
    if (document.selection)
    { 
      myField.focus(); 
      
      //in effect we are creating a text range with zero 
      //length at the cursor location and replacing it 
      //with myValue 
      sel = document.selection.createRange(); 
      sel.text = myValue; 
    } 
    else if (myField.selectionStart || myField.selectionStart == '0')
    { 
      //Here we get the start and end points of the 
      //selection. Then we create substrings up to the 
      //start of the selection and from the end point 
      //of the selection to the end of the field value. 
      //Then we concatenate the first substring, myValue, 
      //and the second substring to get the new value. 
      var startPos = myField.selectionStart; 
      var endPos = myField.selectionEnd; 
      myField.value = myField.value.substring(0, startPos)+ myValue+ myField.value.substring(endPos, myField.value.length); 
    }
    else
    { 
      myField.value += myValue; 
    } 
  }
  
function bookmarksite(url, title){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, '');
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
function addFavorite(url, title)
{
  if (window.sidebar)
  { 
    window.sidebar.addPanel(title, url, 1); 
  }
  else if( document.all )
  {
    window.external.AddFavorite(url, title);
  }
  else if( window.opera && window.print )
  {
    return true;
  }
}
  