function TP_Format(tag,action) {
 var insertText=prompt('Enter text to set '+ action,'');
 if ((insertText != '')&&(insertText != null)){
    document.article.manageBodyText.value+=('<'+tag+'>'+insertText+'</'+tag+'>');
  }
}

function TP_wiki(tag,action) {
 
 var startPos = manageBodyText.selectionStart; 
 var endPos = manageBodyText.selectionEnd;
 var selectedText=manageBodyText.value.substring(startPos,endPos)
 var insertText=prompt('Enter text to set '+ action,selectedText);
 if ((insertText != '')&&(insertText != null)){
	insertText=(tag+insertText+tag);
	manageBodyText.value = manageBodyText.value.substring(0, startPos)+ insertText+ manageBodyText.value.substring(endPos, manageBodyText.value.length); 
  }
}

function TP_Link(tag,action) {
 var startPos = manageBodyText.selectionStart; 
 var endPos = manageBodyText.selectionEnd;
 var selectedText=manageBodyText.value.substring(startPos,endPos)
 var address=prompt('Enter web address for link','http://');
 if (address != null) {
  var linkedtext = prompt('Enter text for the link',selectedText);
 
  if ((linkedtext != "")&&(linkedtext != null)){
	insertText=('\[Link:'+address+'\|'+linkedtext+'\]');
	manageBodyText.value = manageBodyText.value.substring(0, startPos)+ insertText+ manageBodyText.value.substring(endPos, manageBodyText.value.length); 
   }
   }
}

function TP_wikifile() {
 var startPos = manageBodyText.selectionStart;
 var _len = manageBodyText.value.length;
 var theURL = '/intranet/uploadnewsfile.lasso?pos=' + String(startPos) + '&len=' + String(_len);
 window.open(theURL,'filepost','scrollbars=yes,resizable=yes,width=400,height=400');
 
}

function TP_wikiImage() {
var startPos = manageBodyText.selectionStart;
var _len = manageBodyText.value.length;
var theURL = '/intranet/uploadnewspic.lasso?pos=' + String(startPos) + '&len=' + String(_len);
window.open(theURL,'imagepost','scrollbars=yes,resizable=yes,width=400,height=440');

}

function TP_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
