// Copyright 1999 Macromedia, Inc. All rights reserved.

//---------------   GLOBAL VARIABLES   ---------------

var helpDoc = MM.HELP_objInsertEntity;

//---------------     API FUNCTIONS    ---------------

function isDOMRequired() { 
	// Return false, indicating that this object is available in code view.
	return false;
}

function commandButtons(){
  return new Array(BTN_OK,    'insertChars()',
                   BTN_Cancel,'cleanupUI()',
                   BTN_Help,  'displayHelp()');
}

function canAcceptCommand() {
  return true;
}


//---------------    LOCAL FUNCTIONS   ---------------

// function: initUI
// description: initialize UI and other associated preferences
function initUI() {  
}

// function: cleanupUI
// description: 
function cleanupUI() {
  // Exit
  document.entityForm.Insert.childNodes[1].value = '';
  window.close();
}

// function: insertChars
// description: Insert selected character and cleanupUI
function insertChars(curChar) {
// As an Object this command uses the return value in Object tag to insert characters.
  window.close();
}

// function: objectTag
// description: Return inserted value for an Object
function objectTag() {
  // Return the html tag that should be inserted
  return document.entityForm.Insert.childNodes[1].value;
}

//--- Interface Support Functions

// Handles selection and display of choosen character in the form field.
function setChar(curChar) {
  // Add the character to the insertion field.
  document.entityForm.Insert.childNodes[1].value = '&' + curChar + ';';
}
