<!--
//OPEN WINDOW
function f_open_window(theURL,winName,features) {
  	window.open(theURL,winName,features);
}
//EMOTICONS
function f_emoticons(icon) {
	if(window.opener.document.getElementById("ctl00$ContentPlaceHolder$txtMessage"))
	{
		insertAtParentCursor(window.opener.document.aspnetForm.ctl00$ContentPlaceHolder$txtMessage,icon);
	}
	window.close();
}
//SMILING FACES
function f_smilie(smilie) {
txtMessage = document.form.txtMessage.value;
insertAtCursor(document.form.txtMessage,smilie)
}
//BOLD
function f_bold()
{
var textbold = prompt('Please enter the text', '');
if (textbold)
{
textbold = "[b]"+textbold+"[/b]";
f_addtext(textbold);
}
}
//ITALIC
function f_italic()
{
var textitalics = prompt('Please enter the text', '');
if (textitalics)
{
textitalics = "[i]"+textitalics+"[/i]";
f_addtext(textitalics);
}
}
//UNDERLINE
function f_underline()
{
var textunderline = prompt('Please enter the text', '');
if (textunderline)
{
textunderline = "[u]"+textunderline+"[/u]";
f_addtext(textunderline);
}
}
//QUOTE
function f_quote()
{
var textquote = prompt('Please enter the text', '');
if (textquote)
{
textquote = "[quote]"+textquote+"[/quote]";
f_addtext(textquote);
}
}
//URL
function f_url()
{
var texturl = prompt('Please enter the text (for the hyperlink)', '');
if (texturl)
{
var linkurl= prompt('Please enter the URL', '');
if (linkurl)
{
texturl="[url="+linkurl+"]"+texturl+"[/url]";
f_addtext(texturl);
}
}
}
//EMAIL
function f_email()
{
var texturl = prompt('Please enter the text (for the hyperlink)', '');
if (texturl)
{
var linkurl= prompt('Please enter the URL', '');
if (linkurl)
{
texturl="[email="+linkurl+"]"+texturl+"[/email]";
f_addtext(texturl);
}
}
}
//IMAGE
function f_image()
{
var textimage = prompt('Please enter the URL (500px Width Limit)', '');
if (textimage)
{
textimage = "[img]"+textimage+"[/img]";
f_addtext(textimage);
}
}
//GLOW
function f_glow()
{
var textglow = prompt('Please enter the text', '');
if (textglow)
{
var colorglow = prompt('Please enter the glow color', 'red');
if (colorglow)
{
var colortext = prompt('Please enter the text color', 'black');
if (colortext)
{
var textsize = prompt('Please enter the text size', '2');
if (textsize)
{
var glowsize = prompt('Please enter the Strength of the Glow [1-5]','1');
if (glowsize)
{
textglow = "[glow tcolor="+colorglow+", fcolor="+colortext+", size="+textsize+", strength="+glowsize+"]"+textglow+"[/glow]";
f_addtext(textglow);
}
}
}
}
}
}
//COLOR
function f_color(color2)
{
var textcolor= prompt('Please enter the text', '');
if (textcolor)
{
textcolorize = "[color="+color2+"]"+textcolor+"[/color]";
f_addtext(textcolorize);
}
}
//ADD TEXT
function f_addtext(text)
{
txtMessage = document.aspnetForm.ctl00$ContentPlaceHolder$txtMessage.value;
insertAtCursor(document.aspnetForm.ctl00$ContentPlaceHolder$txtMessage,text)
}
//CURSOR INSERT
function insertAtCursor(myField, myValue){
//IE support
if (document.selection){
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
}
//MOZILLA/NETSCAPE support
else if (myField.selectionStart || myField.selectionStart == '0'){
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
} 
else{
myField.value += myValue;
}
}

//CURSOR INSERT
function insertAtParentCursor(myField, myValue){
//IE support
if (window.opener.document.selection){
myField.focus();
sel = window.opener.document.selection.createRange();
sel.text = myValue;
}
//MOZILLA/NETSCAPE support
else if (myField.selectionStart || myField.selectionStart == '0'){
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
} 
else{
myField.value += myValue;
}
}
//-->


