//copyright 2007, Lajos.nl

// quick replace string
function replaceText() {

  searchon = "("+document.textForm.searchfor.value+")";
    if(document.textForm['casesensitive'].checked==true){
		par = "gi";
	}
	else{
		par = "g";
	}
if(document.textForm.replacewith.value!=""){

  var re = new RegExp(searchon, par);
  document.textForm.case_output.value = 
  document.textForm.case_input.value.replace(re, document.textForm.replacewith.value);
  }
    countArray = new Array;
	countArray = document.textForm.case_input.value.match(searchon,par);
	if(countArray){
		report += "'" + document.textForm.searchfor.value+ "' found = " +countArray.length+ "<br />";
	}
}
