// JavaScript Document

var seltext = null;
var repltext = null;
function replaceit() {
	seltext = (document.all)? document.selection.createRange() : document.getSelection();
	var selit = (document.all)? document.selection.createRange().text : document.getSelection();
	if (selit.length>=1){
		if (seltext) {
			repltext= prompt('Please enter the word to replace:', ' '); 
			if ((repltext==' ')||(repltext==null)) repltext=seltext.text;
			seltext.text = repltext;
			window.focus()
		}
	}
}
