function addBookmark(url,title)
{
	//Gecko
	if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) 
		window.sidebar.addPanel (title, url, "");
  //IE4+
  else if (typeof window.external == "object") 
  	window.external.AddFavorite(url, title);
  //Opera7+
  else if (window.opera && document.createElement){
  	var a = document.createElement('A');
    if (!a) return false; //IF Opera 6
    a.setAttribute('rel','sidebar');
    a.setAttribute('href',url);
    a.setAttribute('title',title);
    a.click();
  }
  else 
  	return false;

  return true;
}

function cursorTo(obj, pos)
{
    if(obj.createTextRange) { 
        var range = obj.createTextRange(); 
        range.move("character", pos); 
        range.select(); 
    } else if(obj.selectionStart) { 
        obj.focus(); 
        obj.setSelectionRange(pos, pos); 
    }	
}