	function changeValue(nwElement, value , textarea) {
		element = document.getElementById(nwElement);
		if(value != "URL") {
			if(element.value == value) {
				nwValue = "/" + value;
				text    = "[" + value + "]";
			} else {
				nwValue = value;
				text    = "[/" + value + "]";
			}
		} else {
			if(element.value == value) {
				nwValue = "/" + value;
				text    = "[URL name=]";
			} else {
				nwValue = value;
				text    = "[/URL]";
			}
		}
		element.value = nwValue;
		insert(textarea, text);
	}
	function markSelection(txtObj) {
	  if(txtObj.createTextRange) {
 		txtObj.caretPos = document.selection.createRange().duplicate();
  		isSelected = true;
 	  }
 	}
 	function insert(txtName, string) {
	  if(checkBrowser()) {
	  	var txtObj = eval("document.forms[0]." + txtName);
	  	if(txtObj.createTextRange && txtObj.caretPos) {
  		  txtObj.caretPos.text = string;
 		  txtObj.focus();
 		}
 	  } else {
		textarea = document.getElementById(txtName);
		textarea.value = textarea.value.substring(0,textarea.selectionStart) + string + textarea.value.substring(textarea.selectionStart,textarea.value.length)
  	  }
  	} 

 	function checkBrowser() {
       var ua = window.navigator.userAgent
       var msie = ua.indexOf( "MSIE " )

       if(msie > 0) {
          return true;
       } else {
          return false;
       }
	}  