//===============================
var edButtons = new Array();
var edLinks = new Array();
var edOpenTags = new Array();
function edButton(id, display, tagStart, tagEnd, access, open) {
this.id = id; // used to name the toolbar button
this.display = display; // label on button
this.tagStart = tagStart; // open tag
this.tagEnd = tagEnd; // close tag
this.access = access; // access key
this.open = open; // set to -1 if tag does not need to be closed
}
edButtons[edButtons.length] =
new edButton('ed_strong'
,' b '
,''
,''
,'b'
);
edButtons[edButtons.length] =
new edButton('ed_em'
,' i '
,''
,''
,'i'
);
edButtons[edButtons.length] =
new edButton('ed_u'
,' u '
,''
,''
,'u'
);
edButtons[edButtons.length] =
new edButton('ed_strike'
,' strike '
,''
,''
,'s'
);
edButtons[edButtons.length] =
new edButton('ed_link'
,'link'
,''
,''
,'a'
); // special case
edButtons[edButtons.length] =
new edButton('ed_block'
,'quote'
,'\n\n
' ,'\n\n' ,'q' ); edButtons[edButtons.length] = new edButton('ed_code' ,'code' ,'
'
,''
,'c'
);
function edLink() {
this.display = '';
this.URL = '';
this.newWin = 0;
}
function edShowButton(button, i) {
if (button.id == 'ed_img') {
document.write('');
}
else if (button.id == 'ed_link') {
document.write('');
}
else {
document.write('');
}
}
function edShowLinks() {
var tempStr = '';
document.write(tempStr);
}
function edAddTag(button) {
if (edButtons[button].tagEnd != '') {
edOpenTags[edOpenTags.length] = button;
document.getElementById(edButtons[button].id).value = '/' + document.getElementById(edButtons[button].id).value;
}
}
function edRemoveTag(button) {
for (i = 0; i < edOpenTags.length; i++) {
if (edOpenTags[i] == button) {
edOpenTags.splice(i, 1);
document.getElementById(edButtons[button].id).value = document.getElementById(edButtons[button].id).value.replace('/', '');
}
}
}
function edCheckOpenTags(button) {
var tag = 0;
for (i = 0; i < edOpenTags.length; i++) {
if (edOpenTags[i] == button) {
tag++;
}
}
if (tag > 0) {
return true; // tag found
}
else {
return false; // tag not found
}
}
function edCloseAllTags() {
var count = edOpenTags.length;
for (o = 0; o < count; o++) {
edInsertTag(edCanvas, edOpenTags[edOpenTags.length - 1]);
}
}
function edQuickLink(i, thisSelect) {
if (i > -1) {
var newWin = '';
if (edLinks[i].newWin == 1) {
newWin = ' target="_blank"';
}
var tempStr = ''
+ edLinks[i].display
+ '';
thisSelect.selectedIndex = 0;
edInsertContent(edCanvas, tempStr);
}
else {
thisSelect.selectedIndex = 0;
}
}
function edToolbar() {
//document.write('