
<!--

function submitEnter(myfield,e){
  var keycode;
  if (window.event) keycode = window.event.keyCode;
  else if (e) keycode = e.which;
  else return true;

  if (keycode == 13){
    return true;
  }
  else
	return false;

}

// GET RID OF GOOGLE YELLOW BOXES
 if(window.attachEvent)
    window.attachEvent("onload",setListeners);

  function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++){
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "")
      event.srcElement.style.backgroundColor = "";
  }

// END OF GOOGLE FIX

String.prototype.trim=function(){
	return this.replace(/^\s*|\s*$/g,'');
}

String.prototype.ltrim=function(){
	return this.replace(/^\s*/g,'');
}

String.prototype.rtrim=function(){
	return this.replace(/\s*$/g,'');
}
function onlyNum(input){

	var num = input.value.replace(/\,/g,'');

	if(num != 'N' && num != 'N/' && num != 'N/A'){
	
		if(isNaN(num))
			input.value = input.value.substring(0,input.value.length-1);
			
		num	= input.value;
		
		if(num.length > 0)
			num	= num.trim();
			
		input.value	= num;
	}

}


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

SELECT LIST CONTROLS

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


function getSelected(opt) {
      var selected = new Array();
      var index = 0;
      for (var intLoop=0; intLoop < opt.length; intLoop++) {
         if (opt[intLoop].selected) {
            index = selected.length;
            selected[index] = new Object;
            selected[index].value = opt[intLoop].value;
            selected[index].index = intLoop;
         }
      }
      return selected;
   }
   
function outputSelected(opt) {
            var sel = getSelected(opt);
            var strSel = "";
            for (var item in sel)       
               strSel += sel[item].value + "\n";
            alert("Selected Items:\n" + strSel);
         }
		 
var arrOldValues;

function SelectAllList(CONTROL){
	for(var i = 0;i < CONTROL.length;i++){
		CONTROL.options[i].selected = true;
	}
}

function DeselectAllList(CONTROL){
	for(var i = 0;i < CONTROL.length;i++){
		CONTROL.options[i].selected = false;
	}
}


function FillListValues(CONTROL){
	var arrNewValues;
	var intNewPos;
	var strTemp = GetSelectValues(CONTROL);
	arrNewValues = strTemp.split(",");
	for(var i=0;i<arrNewValues.length-1;i++){
		if(arrNewValues[i]==1){
			intNewPos = i;
		}
	}

	for(var i=0;i<arrOldValues.length-1;i++){
		if(arrOldValues[i]==1 && i != intNewPos){
			CONTROL.options[i].selected= true;
		}
		else if(arrOldValues[i]==0 && i != intNewPos){
			CONTROL.options[i].selected= false;
		}

		if(arrOldValues[intNewPos]== 1){
			CONTROL.options[intNewPos].selected = false;
		}
		else{
			CONTROL.options[intNewPos].selected = true;
		}
	}
}


function GetSelectValues(CONTROL){
	var strTemp = "";
	for(var i = 0;i < CONTROL.length;i++){
		if(CONTROL.options[i].selected == true){
			strTemp += "1,";
		}
		else{
			strTemp += "0,";
		}
	}
	return strTemp;
}

function GetCurrentListValues(CONTROL){
	var strValues = "";
	strValues = GetSelectValues(CONTROL);
	arrOldValues = strValues.split(",")
}


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

END SELECT LIST CONTROLS

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

function phonemask(objFormField){
    intFieldLength = objFormField.value.length;
    if(intFieldLength == 3){
         objFormField.value = "(" + objFormField.value + ") ";
         return false;
         }
   if(intFieldLength >= 9 && intFieldLength <= 10){
       objFormField.value = objFormField.value + "-";
       return false;
       }
}


var OkToGo;

OkToGo = true;

function getLogoutPerm1() {
	OkToGo = false;
	return true;
}
function getLogoutPerm2() {
	OkToGo = false;
	msgWindow=window.open('','window2','resizable=no,scrollbars=yes,height=570,width=690');
	return true;
}


function getLogoutPerm() {
	OkToGo = false;
	lResult = window.confirm("Are you sure that you want to Delete this Item?");
	
	if(lResult == true){
		var valInput	= prompt('Please type DELETE in all caps to delete this item', '');
		if(valInput == "DELETE")
			return true;
		else
			return false;
	}
	else
		return false;
}
function ClearToProceed(toURL) {
	if (OkToGo == true) {
		location.href=toURL;
	} else {
		OkToGo = true;
	}	
}	



function toggleIMGLayer(layerName, imageName){
	if (document.getElementById) {
    	var targetElement = document.getElementById(layerName);
		if(targetElement.style.display == "")
			hideIMGLayer(layerName, imageName);
		else
			showIMGLayer(layerName, layerName, imageName);
			
	}
}
function showIMGLayer(layerName, shadowLayerName, imageName){
	if (document.getElementById){
    	var targetElement = document.getElementById(layerName);
        var shadowElement = document.getElementById(shadowLayerName);
        targetElement.style.top = shadowElement.style.top;
        targetElement.style.display = '';
		document[imageName].src	= 'images/arrow_on.gif';
    }
}

function hideIMGLayer(layerName, imageName){
	if (document.getElementById) {
    	var targetElement = document.getElementById(layerName);
		targetElement.style.display = 'none';
		document[imageName].src	= 'images/arrow_off.gif';
    }
}


function toggleLayer(layerName){
	if (document.getElementById) {
    	var targetElement = document.getElementById(layerName);
		if(targetElement.style.display == "")
			hideLayer(layerName);
		else
			showLayer(layerName, layerName);
			
	}
}
function showLayer(layerName, shadowLayerName){
	if (document.getElementById){
    	var targetElement = document.getElementById(layerName);
        var shadowElement = document.getElementById(shadowLayerName);
        targetElement.style.top = shadowElement.style.top;
        targetElement.style.display = '';
    }
}

function hideLayer(layerName){
	if (document.getElementById) {
    	var targetElement = document.getElementById(layerName);
		targetElement.style.display = 'none';
    }
}


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

COPY SHIPPING

*******************************/
function copyShippingInfo(f){
	
	if(f.sameshipbill.checked == true){
		f.b_fname.value 	= f.fname.value;
		f.b_lname.value 	= f.lname.value;
		f.b_address1.value 	= f.address1.value;
		f.b_city.value 		= f.city.value;
		f.b_state.value 	= f.state.value;
		f.b_phone.value 	= f.phone.value;
		f.b_zip.value		= f.zip.value;
	}
	else{
		f.b_fname.value 	= '';
		f.b_lname.value 	= '';
		f.b_address1.value 	= '';
		f.b_city.value 		= '';
		f.b_state.value 	= '';
		f.b_zip.value 		= '';
		f.b_phone.value 	= '';
	}
}
function checkList(begNum, EndNum, check, frmName){
  for (var i = begNum; i <= EndNum; i++) {
	var fld	= "check_"+ i;

	if(check==1)
	  document.forms[frmName].elements[fld].checked = true;
	else
	  document.forms[frmName].elements[fld].checked = false;
  }
}

function handleOnChange(dd1, frmName, selList, popList, appName, selTxt1, selTxt2, selOn, popOn){
  ddl = document.forms[frmName];

  var idx	= document.forms[frmName].elements[selList].options.selectedIndex ;
  var val	= document.forms[frmName].elements[selList][idx].text;
  //var idx = dd1.selectedIndex;
  //var val 	= dd1[idx].text;


  var par = document.forms[frmName];
  var parelmts = par.elements;
  var usersel = parelmts[popList];
  var option = val;

  if (option != selTxt1)
  {
  	var getURL	= appName + ddl.elements[selList].value;
	
 	Http.get({
		url: getURL,
		callback: fillList,
		cache: Http.Cache.Get
	}, [usersel, popOn, selTxt2, frmName, popList]);
	
	Http.clear_cache();
  }
  
  // Clear values from select box if nothing is selected
  else{

	usersel[0].text = selTxt2;
	usersel[0].value = 0;
    for (o=1; o < usersel.length; o++)
    {
      usersel[o].text = '';
	  usersel[o].value = '';
    }
	usersel.length	= 1;
  }
  
  
}


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

CATEGORY

********************************/
function fillList(xmlreply, userlmt, popOn, selTxt2, frmName, popList){

  if (xmlreply.status == Http.Status.OK)
  {
    var userresponse = xmlreply.responseText;
    var userar 		= userresponse.split("|");
	var length 		= 0;
	var selIndex	= 0;
    userlmt.length 	= 1;
    userlmt.length 	= (userar.length / 2) + 1;
	
	userlmt[0].text = selTxt2;
		
	for (i=1,t=1, v=2;  i < userlmt.length; i++, t+=2, v+=2){	
	
		
      	userlmt[i].text 	= userar[t];		
	  	userlmt[i].value 	= userar[v];
		
		if(userar[v] == popOn && popOn != '')
			selIndex	= i;
		
			
    }
	if(selIndex!=0 && selIndex!=''){
		//alert(popOn);
		document.forms[frmName].elements[popList].options[selIndex].selected = true;
	}
	
	
  }
  else
  {
	document.forms[frmName].elements[popList][0].text	= '';
    //alert("Cannot handle the AJAX call.");

  }
}


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

SCENT

********************************/
function updateScent(dd1, frmName, selList, appName, selTxt1, fld1){
  ddl = document.forms[frmName];

  var idx	= document.forms[frmName].elements[selList].options.selectedIndex ;
  var val	= document.forms[frmName].elements[selList].options.selectedIndex.value;

  var par = document.forms[frmName];
  var parelmts = par.elements;
  //var usersel = parelmts[popList];
  var option = val;
  if (option != selTxt1)
  {
  	var getURL	= appName + ddl.elements[selList].value;
	
 	Http.get({
		url: getURL,
		callback: fillFieldsScent,
		cache: Http.Cache.Get
	}, [frmName, fld1]);
  }
  else{
  	document.forms[frmName].elements[fld1].value = '';
  }

}
/*******************************

TITLE

********************************/
function fillFieldsScent(xmlreply, frmName, fld1){

  if (xmlreply.status == Http.Status.OK)
  {
    var userresponse = xmlreply.responseText;
    var userar 		= userresponse.split("|");

	if(userar[1] != ''){
		document.forms[frmName].elements[fld1].value = userar[1];
	}
	else{
		document.forms[frmName].elements[fld1].value = '';
	}
  }
  else
  {
    //alert("Cannot handle the AJAX call.");
  }
}





function phonemask(t){
	var patt1 = /(\d{3}).*(\d{3}).*(\d{4})/;
	var patt2 = /^\((\d{3})\).(\d{3})-(\d{4})$/;
	var str = t.value;
	var result;
	if (!str.match(patt2)){
		result = str.match(patt1);
		if (result!= null){
			t.value = t.value.replace(/[^\d]/gi,'');
			str = '(' + result[1] + ') ' + result[2] + '-' + result[3];
			t.value = str;
		}
		else{
			if (t.value.match(/[^\d]/gi))
				t.value = t.value.replace(/[^\d]/gi,'');
		}
	}	
}



String.prototype.trim=function(){
	return this.replace(/^\s*|\s*$/g,'');
}

String.prototype.ltrim=function(){
	return this.replace(/^\s*/g,'');
}

String.prototype.rtrim=function(){
	return this.replace(/\s*$/g,'');
}
function onlyNum(input){

	var num = input.value.replace(/\,/g,'');
	
	if(isNaN(num))
		input.value = input.value.substring(0,input.value.length-1);
		
	num	= input.value;
	
	if(num.length > 0)
		num	= num.trim();
		
	input.value	= num;

}
function submitRTEForm(name) {
  updateRTE(name);
  return true;
}
function getLogoutPerm() {
		OkToGo = false;
		lResult = window.confirm("Are you sure that you want to Delete this Item?");
		return lResult;
	}
	
function ClearToProceed(toURL) {
	if (OkToGo == true) {
		location.href=toURL;
	} else {
		OkToGo = true;
	}
	
}

function submitTxnOpt(url, txnID, form, complete, mm, yyyy){
  val= document.forms[form].txnOpt.value;
  loc	= url + "&txn_id=" + txnID + "&txnIDaction=" + val + "&complete=" + complete + "&mm_from=" + mm + "&yyyy_from=" + yyyy;
  location.href=loc;
}
function submitStructure(type){

  if (type=='SECTION'){
	for (i=0; i<document.formSectList.sectID.length; i++) { 
      document.formSectList.sectID.options[i].selected = true; 
	  document.formSectList.sectIDValue.value	+= document.formSectList.sectID.options[i].value;
	  document.formSectList.sectIDValue.value += '\n';
	   //alert(2);
    }
  }
  else{
    for (i=0; i<document.formCatgList.catgID.length; i++) { 
      document.formCatgList.catgID.options[i].selected = true; 	
	  document.formCatgList.catgIDValue.value	+= document.formCatgList.catgID.options[i].value;
	  document.formCatgList.catgIDValue.value += '\n';
	   //alert(2);
    }
	
	var txtSelectedValuesObj = document.getElementById('categoryValues');
  	var selectedArray = new Array();
  	var selObj = document.getElementById('category');
  	var i;
  	var count = 0;
  	for (i=0; i<selObj.options.length; i++) {
    	selObj.options[i].selected = true;
      	selectedArray[count] = selObj.options[i].value;
      	count++;
    	
  	}
  	txtSelectedValuesObj.value = selectedArray;
	/*
	 for (i=0; i<document.formCatgList.category.length; i++) { 
	  document.formCatgList.category.options[i].selected = true;
	  document.formCatgList.category.value	+= document.formCatgList.category.options[i].value;
	  document.formCatgList.category.value += '\n';
	   //alert(2);
    }
	*/
  }

}



function editList(listField, indexField){
  if ( listField.length == -1) {  // If the list is empty
      alert("There are no values which can be moved!");
  } 
  else {
    var selected 		= listField.selectedIndex;
    if (selected == -1) {
         alert("You must select an entry to edit!");
    } 
	else {      	
      var oldcategory	= listField[selected].value;
      var newcategory	= window.prompt("Edit \""+ oldcategory + "\": \nPlease enter a new section name:", "");
	  if(newcategory){
	    listField[selected].value	= newcategory;
	    listField[selected].text	= newcategory;
	  }
   	}
  }
}

function moveUpList(listField, indexField, type) {
   if ( listField.length == -1) {  // If the list is empty
      alert("There are no values which can be moved!");
   } else {
      var selected = listField.selectedIndex;
      if (selected == -1) {
         alert("You must select an entry to be moved!");
      } else {  // Something is selected 
         if ( listField.length == 0 ) {  // If there's only one in the list
            alert("There is only one entry!\nThe one entry will remain in place.");
         } else {  // There's more than one in the list, rearrange the list order
            if ( selected == 0 ) {
               alert("The first entry in the list cannot be moved up.");
            } else {
               // Get the text/value of the one directly above the hightlighted entry as
               // well as the highlighted entry; then flip them
			   
			   indexField.options[selected].selected = true;
			   if(type == "SECTION"){
			     var indexVal	=  document.formSectList.sectID.selectedIndex;
			     var num		= document.formSectList.sectID[indexVal].value;
			   }
			   else{
				 var indexVal	=  document.formCatgList.catgID.selectedIndex;
			     var num		= document.formCatgList.catgID[indexVal].value;
			   }
						
			   // move name   
               var moveText1 = listField[selected-1].text;
               var moveText2 = listField[selected].text;
               var moveValue1 = listField[selected-1].value;
               var moveValue2 = listField[selected].value;
               listField[selected].text = moveText1;
               listField[selected].value = moveValue1;
               listField[selected-1].text = moveText2;
               listField[selected-1].value = moveValue2;
               listField.selectedIndex = selected-1; // Select the one that was selected before
			   
			   // move id
			   var moveText1 = indexField[selected-1].text;
               var moveText2 = indexField[selected].text;
               var moveValue1 = indexField[selected-1].value;
               var moveValue2 = indexField[selected].value;
               indexField[selected].text = moveText1;
               indexField[selected].value = moveValue1;
               indexField[selected-1].text = moveText2;
               indexField[selected-1].value = moveValue2;
               indexField.selectedIndex = selected-1;
			   
			   
            }  // Ends the check for selecting one which can be moved
         }  // Ends the check for there only being one in the list to begin with
      }  // Ends the check for there being something selected
   }  // Ends the check for there being none in the list
}

function moveDownList(listField, indexField) {
   if ( listField.length == -1) {  // If the list is empty
      alert("There are no values which can be moved!");
   } else {
      var selected = listField.selectedIndex;
      if (selected == -1) {
         alert("You must select an entry to be moved!");
      } else {  // Something is selected 
         if ( listField.length == 0 ) {  // If there's only one in the list
            alert("There is only one entry!\nThe one entry will remain in place.");
         } else {  // There's more than one in the list, rearrange the list order
            if ( selected == listField.length-1 ) {
               alert("The last entry in the list cannot be moved down.");
            } else {
               // Get the text/value of the one directly below the hightlighted entry as
               // well as the highlighted entry; then flip them
			   
			   // move name
               var moveText1 = listField[selected+1].text;
               var moveText2 = listField[selected].text;
               var moveValue1 = listField[selected+1].value;
               var moveValue2 = listField[selected].value;
               listField[selected].text = moveText1;
               listField[selected].value = moveValue1;
               listField[selected+1].text = moveText2;
               listField[selected+1].value = moveValue2;
               listField.selectedIndex = selected+1; // Select the one that was selected before
			   
			   // move id
			   var moveText1 = indexField[selected+1].text;
               var moveText2 = indexField[selected].text;
               var moveValue1 = indexField[selected+1].value;
               var moveValue2 = indexField[selected].value;
               indexField[selected].text = moveText1;
               indexField[selected].value = moveValue1;
               indexField[selected+1].text = moveText2;
               indexField[selected+1].value = moveValue2;
               indexField.selectedIndex = selected+1;
            }  // Ends the check for selecting one which can be moved
         }  // Ends the check for there only being one in the list to begin with
      }  // Ends the check for there being something selected
   }  // Ends the check for there being none in the list
}


function addToList(listField, indexField, newText, newValue, type) {
   if ( ( newValue == "" ) || ( newText == "" ) ) {
      alert("You cannot add blank values!");
   } else {
      // name
      var len = listField.length++; // Increase the size of list and return the size
      listField.options[len].value = newValue;
      listField.options[len].text = newText;
      listField.selectedIndex = len; // Highlight the one just entered (shows the user that it was entered)
	  
	  // id
	  var len = indexField.length++; // Increase the size of list and return the size
      indexField.options[len].value = newValue;
      indexField.options[len].text = newText;
      indexField.selectedIndex = len;
   } // Ends the check to see if the value entered on the form is empty

   if(type=="SECTION"){
     document.formSectList.addSectID.value		= '';
   }
   else
     document.formCatgList.addCatgID.value	= '';
}


function removeFromList(listField, indexField, type) {
   if ( listField.length == -1) {  // If the list is empty
      alert("There are no values which can be removed!");
   } else {
      var selected = listField.selectedIndex;
      if (selected == -1) {
         alert("You must select an entry to be removed!");
      } else {  // Build arrays with the text and values to remain
	  
	    deleteconfirm	= prompt("Are you sure you want to remove this subcategory?", "Type YES or NO in ALL CAPS");
	  if(deleteconfirm=="YES"){
	    if(type=="SECTION"){		  
		  document.formSectList.removeSectID.value	= document.formSectList.removeSectID.value + '\n' + indexField.options[selected].value;
		}
		else{
		  document.formCatgList.removeCatgID.value	= document.formCatgList.removeCatgID.value + '\n' + indexField.options[selected].value;

		}
		  
		 // remove name and resort
         var replaceTextArray = new Array(listField.length-1);
         var replaceValueArray = new Array(listField.length-1);
         for (var i = 0; i < listField.length; i++) {
            // Put everything except the selected one into the array
            if ( i < selected) { replaceTextArray[i] = listField.options[i].text; }
            if ( i > selected ) { replaceTextArray[i-1] = listField.options[i].text; }
            if ( i < selected) { replaceValueArray[i] = listField.options[i].value; }
            if ( i > selected ) { replaceValueArray[i-1] = listField.options[i].value; }
         }
         listField.length = replaceTextArray.length;  // Shorten the input list
         for (i = 0; i < replaceTextArray.length; i++) { // Put the array back into the list
            listField.options[i].value = replaceValueArray[i];
            listField.options[i].text = replaceTextArray[i];
         }
		 
		 // remove id and resort
		 var replaceTextArray = new Array(indexField.length-1);
         var replaceValueArray = new Array(indexField.length-1);
         for (var i = 0; i < indexField.length; i++) {
            // Put everything except the selected one into the array
            if ( i < selected) { replaceTextArray[i] = indexField.options[i].text; }
            if ( i > selected ) { replaceTextArray[i-1] = indexField.options[i].text; }
            if ( i < selected) { replaceValueArray[i] = indexField.options[i].value; }
            if ( i > selected ) { replaceValueArray[i-1] = indexField.options[i].value; }
         }
         indexField.length = replaceTextArray.length;  // Shorten the input list
         for (i = 0; i < replaceTextArray.length; i++) { // Put the array back into the list
            indexField.options[i].value = replaceValueArray[i];
            indexField.options[i].text = replaceTextArray[i];
         }
      } // Ends the check to make sure something was selected
   } // Ends the check for there being none in the list
   }
   
}

function HandleSubmit(listBox){
var SelectedIdList = "";
for(var i = 0; i < listBox.length; i++) {
SelectedIdList += (listBox.options[i].value + ","); 
}
SelectedIdList = SelectedIdList.substring(0, SelectedIdList.length-1);
document.forms[0].StudentsIdList.value = SelectedIdList;
document.forms[0].submit();
}

function popUp(URL, width, height){
  props		= window.open(URL, '','menubar=0, scrollbars=1, resizable=1, location=0, status=0, width=' + width + ', height=' + height + '');
}

function popUpSize(URL, item, width, height){
  width		= 615;
  height	= 565;
  page		= '/blank.php?file=' + URL + '&itemID=' + item;
  props		= window.open(page, item,'menubar=0, scrollbars=0, resizable=1, location=0, status=0, width=' + width + ', height=' + height + '');
}

function updateSearchSelect(){
  if (document.formSearch.search_category.value!="All") { 
	document.formSearch.submitForm.value=0;
    document.formSearch.submit();
  }
  else 
    return;
}

function updateProdSelect(){
  if (document.formInv.catgID.value!="") { 
	document.formInv.submitForm.value=0;
    document.formInv.submit();
  }
  else 
    return;
}

function changeContent(d) {
  var dTitle = d + 'Title';
 
  if(d!="file"){
    document.getElementById(d).style.display = "";
    document.getElementById(dTitle).style.display = "";
  }

  if(d=="single"){
    document.getElementById('box').style.display = "none";
	document.getElementById('boxTitle').style.display = "none";
	document.getElementById('file').style.display = "none";

  }
  else if(d=="box"){
    document.getElementById('single').style.display = "none";
	document.getElementById('singleTitle').style.display = "none";
	document.getElementById('file').style.display = "none";
  } 
  else if(d=="file"){
	document.getElementById('file').style.display = "";
  } 
 
}


function allCheckbox(begNum, EndNum, check){
  for (var i = begNum; i <= EndNum; i++) {
	var fld	= "chkItem_"+ i;

	if(check==1)
	  document.formInv.elements[fld].checked = true;
	else
	  document.formInv.elements[fld].checked = false;
  }
}

function x () {
return;
}

function storeCaret (textEl) {
	if (textEl.createTextRange)
		textEl.caretPos = document.selection.createRange().duplicate();
} // end fn

function insertAtCaret (textEl, text) {
	if (textEl.createTextRange && textEl.caretPos) {
		var caretPos = textEl.caretPos;
		caretPos.text =
			caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
			text + ' ' : text;
	} else {
		textEl.value  = textEl.value + text; // for non MSIE browsers just append it
	}

	return true;
}// fn




function DoSmilie(addSmilie) {
	var revisedMessage;
	var currentMessage = document.replier.message.value;
	revisedMessage = currentMessage+addSmilie;
	document.replier.message.value=revisedMessage;
	document.replier.message.focus();
	return;
}

	function DoPrompt(action) {
		var currentMessage = document.replier.message.value;

		if (action == "url") {
			var thisURL = prompt("Enter the complete URL for the link you wish to add.", "http://");
			if (thisURL == null){return;}

			var thisTitle = prompt("Now enter the title of the web page you wish to reference.  For instance, if you are linking to the URL for Infopop, you might use the title Infopop Homepage.", "web page");
			if (thisTitle == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[URL]" + thisURL + "[/URL][URL_TITLE]" + thisTitle + "[/URL_TITLE]" + ' ');
			document.replier.message.focus();
			return;
		}

		if (action == "email") {
			var thisEmail = prompt("Enter the complete email address that you wish to add.", "");
			if (thisEmail == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[A_EMAIL]" + thisEmail + "[/A_EMAIL][EMAIL]" + thisEmail + "[/EMAIL]" + ' ');
			document.replier.message.focus();
			return;
		}

		if (action == "bold") {
			var thisBold = prompt("Enter the text that you wish to make bold.", "");
			if (thisBold == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[B]" + thisBold + "[/B]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "italics") {
			var thisItal = prompt("Enter the text that you wish to italicize.", "");
			if (thisItal == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[I]" + thisItal + "[/I]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "image") {
			var thisImage = prompt("Enter the complete URL for the image you wish to display.", "http://");
			if (thisImage == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[IMG]" + thisImage + "[/IMG]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "quote") {
			insertAtCaret(document.replier.message, ' ' + "[QUOTE]  [/QUOTE]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "code") {
			insertAtCaret(document.replier.message, ' ' + "[CODE]  [/CODE]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "liststart") {
			insertAtCaret(document.replier.message, ' ' + "[LIST]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "listend") {
			insertAtCaret(document.replier.message, ' ' + "[/LIST]" + ' ' );
			document.replier.message.focus();
			return;
		}

		if (action == "listitem") {
			var thisItem = prompt("Enter the new list item.  Note that each list group must be preceded by a List Start and the entire list group must end with a List End (in order to display properly).", "");
			if (thisItem == null){return;}

			insertAtCaret(document.replier.message, ' ' + "[*]" + thisItem + ' ' );
			document.replier.message.focus();
			return;
		}

	}

function checkListDelete(){
   var answer	= confirm("Are you sure you want to remove the select item(s)?")
	if(answer)
	   return true;
	else
	  return false;
}

//-->