function sizeTEXT()
{
//	var isIE = (document.all) ? true:false;
//	if ( isIE )
//	{	var scrnX = document.body.clientWidth;
//		var scrnY = document.body.clientHeight;
//		document.all['message'].cols = (scrnX / 10);
//		document.all['message'].rows = (scrnY / 20);
//	}
}
// end sizetext function ###########################################
function smiley(smcode) {
	document.postpage.message.value += smcode;
	document.postpage.message.focus();
}
// end smiley function ###########################################

function insertAtCursor(myField, myValue) {
  //IE support
  if (document.selection) {
    myField.focus();
    sel = document.selection.createRange();
    sel.text = myValue;
    myField.focus();
  }
  //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);
    var cursorPos = endPos + myValue.length;
    myField.focus();
    myField.selectionStart = cursorPos;
    myField.selectionEnd = cursorPos;
  } else {
    myField.value += myValue;
    myField.focus();
  }
}

// end insertAtCursor function ###########################################




tags = new Array();

// *******************************************************
// replacements for unsupported array functions (because arrayname.push(var)
// and arrayname.pop() are not implemented in IE until version 5.5)

function getarraysize(thearray) {
// replacement for arrayname.length property
	for (i = 0; i < thearray.length; i++) {
		if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
			return i;
		}
	return thearray.length;
}

function arraypush(thearray,value) {
// replacement for arrayname.push(value)
	thearraysize = getarraysize(thearray);
	thearray[thearraysize] = value;
}

function arraypop(thearray) {
// replacement for arrayname.pop()
	thearraysize = getarraysize(thearray);
	retval = thearray[thearraysize - 1];
	delete thearray[thearraysize - 1];
	return retval;
}

// *******************************************************
function fformat(theform,vbcode,prompttext) {
// insert [x]yyy[/x] style markup
	if ((normalmode(theform)) || (vbcode=="IMG")) {
		inserttext = prompt(tag_prompt+"\n["+vbcode+"]xxx[/"+vbcode+"]",prompttext);
		if ((inserttext != null) && (inserttext != ""))
			theform.message.value += "["+vbcode+"]"+inserttext+"[/"+vbcode+"] ";
		}
	else {
		donotinsert = false;
		for (i = 0; i < tags.length; i++) {
			if (tags[i] == vbcode)
				donotinsert = true;
			}
		if (donotinsert)
			stat("already_open");
		else {
			theform.message.value += "["+vbcode+"]";
			arraypush(tags,vbcode);
			}
		}
	theform.message.focus();
}

// *******************************************************