function  insertHTMLcode(openTag, closeTag, idField){
          var theField = document.getElementById(idField);
          if (!theField) {alert('Error field!'); return null;}

          if (document.selection && document.selection.createRange){// IE
             theField.focus();
             var sel=document.selection.createRange();
             sel.text=openTag+sel.text+closeTag;
          }
          else if (theField.selectionStart || theField.selectionStart == "0"){ // Moz
              var startPos=theField.selectionStart;
              var endPos=theField.selectionEnd;
              theField.focus();
              theField.value=theField.value.substring(0,startPos)+openTag+theField.value.substring(startPos,endPos)+closeTag+theField.value.substring(endPos,theField.value.length);
              theField.selectionStart=theField.selectionEnd=endPos+openTag.length+closeTag.length;
              theField.focus();
          }
          else {//all
                  theField.focus();
                  theField.value+=openTag+closeTag;
          }                                       
          return;
}