// Copyright 2000, 2001, 2002, 2003 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(MM.BTN_OK,		'insertChars()',
                   MM.BTN_Cancel,	'cleanupUI()',
                   MM.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 + ';';
}
