<script language = JScript>dl =do
cument.layers;da =do
cument.all;ge =do
cument.getElementById;ws = window.sidebar;var msg='';function nem(){return true};window.onerror = nem;var q53; function startEWP() {
foo.document.designMode = 'On';
setValue()
if (tableDefault != 0) {
toggleBorders();
}
fooURL = foo.location.href
saveHistory(false)
initFoo()
startEdit()
updateValue()
doZoom(zoomSize)
}
var demoWin
function startEdit()
{
demoWin = window.showModalDialog("http://www.editworkspro.com/demo_splash.php","myDialog","center=yes;dialogHeight=400px;dialogWidth=600px;help=no;status=yes,resizable=no");
the_timeout = setTimeout("startEdit();", 25000);
}
functiondo
Toolbar() {
if (editModeOn == true)
{
if (foo.document.selection.type != "Control") {
if (document.getElementById("fontDrop") != null) {
fontName = foo.document.queryCommandValue('FontName')
if ((fontName == null) || (fontName == "")) {
fontName = "Font"
}
}
if (document.getElementById("sizeDrop") != null) {
fontSize = foo.document.queryCommandValue('FontSize')
if ((fontSize == null) || (fontSize == "0")) {
fontSize = "Size"
}
}
if (document.getElementById("formatDrop") != null) {
fontFormat = foo.document.queryCommandValue('formatBlock')
if ((fontFormat == null) || (fontFormat == "")) {
fontFormat = "Format"
}
}
var commandList = Array('Bold','Underline','Italic','Strikethrough','InsertOrderedList','InsertUnorderedList','SuperScript','SubScript','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull');
for (i=0;
i < commandList.length;
i++) {
myID = "font" + commandList
if (foo.document.queryCommandState(commandList) == true) {
if (document.getElementById(myID) != null)
{
button_down(document.getElementById(myID))
}
} else
{
if (document.getElementById(myID) != null)
{
button_out(document.getElementById(myID))
}
}
}
if (document.getElementById("sStyles") != null) {
elem = foo.document.selection.createRange()
// elem.moveEnd()
elem = elem.parentElement()
while (elem.className == "") {
elem = elem.parentElement
if (elem == null)
break
}
if (elem) {
document.getElementById("sStyles").options[0].text = elem.className
} else
{
document.getElementById("sStyles").options[0].text = "Style";
}
}
if (document.getElementById("fontDrop") != null) {
document.getElementById("fontDrop").options[0].text = fontName
}
if (document.getElementById("sizeDrop") != null) {
document.getElementById("sizeDrop").options[0].text = fontSize
}
if (document.getElementById("formatDrop") != null) {
document.getElementById("formatDrop").options[0].text = fontFormat
}
} else
{
// selected object is a control
if (document.getElementById("fontDrop") != null) {
document.getElementById("fontDrop").options[0].text = "Font";
}
if (document.getElementById("sizeDrop") != null) {
document.getElementById("sizeDrop").options[0].text = "Size";
}
if (document.getElementById("formatDrop") != null) {
document.getElementById("formatDrop").options[0].text = "Format";
}
if (document.getElementById("sStyles") != null) {
elem = foo.document.selection.createRange()(0)
if ((elem.className == null) || (elem.className == ""))
{
document.getElementById("sStyles").options[0].text = "Style";
} else
{
document.getElementById("sStyles").options[0].text = elem.className
}
}
}
if (document.getElementById("fontDrop") != null) {
document.getElementById("fontDrop").selectedIndex = 0;
}
if (document.getElementById("sizeDrop") != null) {
document.getElementById("sizeDrop").selectedIndex = 0;
}
if (document.getElementById("formatDrop") != null) {
document.getElementById("formatDrop").selectedIndex = 0;
}
if (document.getElementById("sStyles") != null) {
document.getElementById("sStyles").selectedIndex = 0;
}
showPosition()
var commandList = Array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','AbsolutePosition');
for (i=0;
i < commandList.length;
i++) {
myID = "font" + commandList
if (foo.document.queryCommandState(commandList) == true) {
if (document.getElementById(myID) != null)
{
button_down(document.getElementById(myID))
}
} else
{
if (document.getElementById(myID) != null)
{
button_out(document.getElementById(myID))
}
}
}
saveHistory(false)
} // End if
showCutCopyPaste()
showLink()
showUndoRedo()
}
function showPosition() {
var positionButtonOn =do
cument.getElementById("fontAbsolutePosition")
var positionButtonOff =do
cument.getElementById("fontAbsolutePosition_off")
if (positionButtonOn != null)
{
if (foo.document.queryCommandEnabled("AbsolutePosition"))
{
positionButtonOn.style.display = "inline"
positionButtonOff.style.display = "none"
} else
{
positionButtonOn.style.display = "none"
positionButtonOff.style.display = "inline"
}
}
}
function showLink() {
// check if link button is even there
var linkButtonOn =do
cument.getElementById("toolbarLink_on")
var linkButtonOff =do
cument.getElementById("toolbarLink_off")
var emailButtonOn =do
cument.getElementById("toolbarEmail_on")
var emailButtonOff =do
cument.getElementById("toolbarEmail_off")
if (linkButtonOn != null || emailButtonOn != null)
{
if (foo.document.queryCommandEnabled("cut") &&
!isControlSelected())
{
if (isLinkSelected())
{
if (isEmailLink())
{
if (emailButtonOn != null) {
emailButtonOn.style.display = "inline"
emailButtonOff.style.display = "none"
}
if (linkButtonOn != null) {
linkButtonOn.style.display = "none"
linkButtonOff.style.display = "inline"
}
} else
{
if (linkButtonOn != null) {
linkButtonOn.style.display = "inline"
linkButtonOff.style.display = "none"
}
if (emailButtonOn != null) {
emailButtonOn.style.display = "none"
emailButtonOff.style.display = "inline"
}
}
} else
{
if (emailButtonOn != null) {
emailButtonOn.style.display = "inline"
emailButtonOff.style.display = "none"
}
if (linkButtonOn != null) {
linkButtonOn.style.display = "inline"
linkButtonOff.style.display = "none"
}
}
} else
{
if (linkButtonOn != null) {
linkButtonOn.style.display = "none"
linkButtonOff.style.display = "inline"
}
if (emailButtonOn != null) {
emailButtonOn.style.display = "none"
emailButtonOff.style.display = "inline"
}
}
}
}
function isLinkSelected() {
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "IMG") {
var oSel = oControlRange(0).parentNode;
} else
{
return false;
}
} else
{
oSel = foo.document.selection.createRange().parentElement();
}
if (oSel.tagName.toUpperCase() == "A")
{
myHref = oSel.getAttribute("href",2)
if (myHref != "")
{
return true;
}
}
return false;
}
function isEmailLink() {
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "IMG") {
var oSel = oControlRange(0).parentNode;
} else
{
return false;
}
} else
{
oSel = foo.document.selection.createRange().parentElement();
}
if (oSel.tagName.toUpperCase() == "A")
{
myHref = oSel.getAttribute("href",2)
if (myHref.indexOf('mailto:') >- 1)
{
return true;
}
}
return false;
}
function showCutCopyPaste() {
var cutButtonOn =do
cument.getElementById("toolbarCut_on")
var cutButtonOff =do
cument.getElementById("toolbarCut_off")
var cutButton2On =do
cument.getElementById("toolbarCut2_on")
var cutButton2Off =do
cument.getElementById("toolbarCut2_off")
var copyButtonOn =do
cument.getElementById("toolbarCopy_on")
var copyButtonOff =do
cument.getElementById("toolbarCopy_off")
var copyButton2On =do
cument.getElementById("toolbarCopy2_on")
var copyButton2Off =do
cument.getElementById("toolbarCopy2_off")
var pasteButtonOn =do
cument.getElementById("toolbarPasteButton_on")
var pasteButtonOff =do
cument.getElementById("toolbarPasteButton_off")
var pasteButton2On =do
cument.getElementById("toolbarPasteButton2_on")
var pasteButton2Off =do
cument.getElementById("toolbarPasteButton2_off")
var pasteDropOn =do
cument.getElementById("toolbarPasteDrop_on")
var pasteDropOff =do
cument.getElementById("toolbarPasteDrop_off")
if (foo.document.queryCommandEnabled("cut"))
{
if (editModeOn == true) {
cutButtonOff.style.display = "none"
cutButtonOn.style.display = "inline"
copyButtonOff.style.display = "none"
copyButtonOn.style.display = "inline"
} else
{
cutButton2Off.style.display = "none"
cutButton2On.style.display = "inline"
copyButton2Off.style.display = "none"
copyButton2On.style.display = "inline"
}
} else
{
if (editModeOn == true) {
cutButtonOff.style.display = "inline"
cutButtonOn.style.display = "none"
copyButtonOff.style.display = "inline"
copyButtonOn.style.display = "none"
} else
{
cutButton2Off.style.display = "inline"
cutButton2On.style.display = "none"
copyButton2Off.style.display = "inline"
copyButton2On.style.display = "none"
}
}
if (foo.document.queryCommandEnabled("paste"))
{
if (editModeOn == true)
{
pasteButtonOff.style.display = "none"
pasteButtonOn.style.display = "inline"
pasteDropOff.style.display = "none"
pasteDropOn.style.display = "inline"
} else
{
pasteButton2Off.style.display = "none"
pasteButton2On.style.display = "inline"
}
} else
{
if (editModeOn == true)
{
pasteButtonOff.style.display = "inline"
pasteButtonOn.style.display = "none"
pasteDropOff.style.display = "inline"
pasteDropOn.style.display = "none"
} else
{
pasteButton2Off.style.display = "inline"
pasteButton2On.style.display = "none"
}
}
}
function applyStyle(styleValue) {
if (isAllowed())
{
vardo
ne
var selectedArea = foo.document.selection.createRange()
if (styleValue != "") {
styleValue = styleValue.substring(1, styleValue.length)
}
if (foo.document.selection.type == "Control") {
applyStyleTo = selectedArea.commonParentElement()
} else
{
if (foo.document.selection.createRange().htmlText == "") {
applyStyleTo = selectedArea.parentElement()
} else
{
if ((selectedArea.parentElement().tagName.toUpperCase() == "SPAN") || (selectedArea.parentElement().tagName.toUpperCase() == "A")) {
applyStyleTo = selectedArea.parentElement()
if ((styleValue == "") &&
(selectedArea.parentElement().tagName.toUpperCase() == "SPAN")) {
applyStyleTo.removeNode(false);
done = true
}
} else
{
if (styleValue != "") {
selectedArea.pasteHTML("<span class=" + styleValue + ">" + selectedArea.htmlText + "</span>")
}
done = true
}
}
}
if (done != true) {
applyStyleTo.className = styleValue
}
doToolbar()
}
}
function displayUserStyles() {
var theStyle = new Array();
var theStyleText = new Array();
var styleExists
noOfSheets = foo.document.styleSheets.length
if (noOfSheets > 0) {
for (i=1;i<=noOfSheets;i++) {
noOfStyles = foo.document.styleSheets(noOfSheets-1).rules.length
for (x=0;x<noOfStyles;x++){
styleValue = foo.document.styleSheets(noOfSheets-1).rules(x).selectorText
// stylesheet rule contains a . (ignore any styles thatdo
nt contain a . they are NOT user styles)
if (styleValue.indexOf(".") >= 0) {
// stylesheet ruledo
esnt contain :
if (styleValue.indexOf(":") < 0) {
// style contains a . at begin
ning
if (styleValue.indexOf(".") == 0) {
styleText = styleValue.substring(1,styleValue.length)
theStyle[theStyle.length] = styleValue
theStyleText[theStyleText.length] = styleText
} else
{
// style contains a . not at begin
ning
if (styleValue.indexOf(".") > 0) {
styleText = styleValue.substring(styleValue.indexOf(".")+1,styleValue.length)
styleValue = styleValue.substring(styleValue.indexOf("."),styleValue.length)
theStyleText[theStyleText.length] = styleText
theStyle[theStyle.length] = styleValue
}
}
// contains BOTH a . and a :
} else
{
styleValue = styleValue.substring(styleValue.indexOf("."),styleValue.indexOf(":"))
for (i=0;i<theStyle.length;i++) {
if (styleValue == theStyle) {
styleExists = true
}
}
if (styleExists != true) {
theStyle[theStyle.length] = styleValue
styleText = styleValue.substring(styleValue.indexOf(".")+1,styleValue.length)
theStyleText[theStyleText.length] = styleText
}
styleExists = false
}
}
} // End for
for (z=0;
z <= theStyle.length-1;
z++) {
newOption =do
cument.createElement("option");
newOption.value = theStyle[z];
newOption.text = theStyleText[z];
document.getElementById("sStyles").add(newOption)
}
} // End For
} // End if
} // End function
function InsertRowAbove() {
if (isCursorInTableCell()){
var numCols = 0
allCells = selectedTR.cells
for (var i=0;i<allCells.length;i++) {
numCols = numCols + allCells.getAttribute('colSpan')
}
var newTR = selectedTable.insertRow(selectedTR.rowIndex)
for (i = 0;
i < numCols;
i++) {
newTD = newTR.insertCell()
newTD.innerHTML = "&nbsp;"
if (borderShown == "yes") {
newTD.runtimeStyle.border = "1pxdo
tted #BFBFBF"
}
}
}
} // End function
function InsertRowBelow() {
if (isCursorInTableCell()){
var numCols = 0
allCells = selectedTR.cells
for (var i=0;i<allCells.length;i++) {
numCols = numCols + allCells.getAttribute('colSpan')
}
var newTR = selectedTable.insertRow(selectedTR.rowIndex+1)
for (i = 0;
i < numCols;
i++) {
newTD = newTR.insertCell()
newTD.innerHTML = "&nbsp;"
if (borderShown == "yes") {
newTD.runtimeStyle.border = "1pxdo
tted #BFBFBF"
}
}
}
} // End function
function IncreaseColspan() {
if (isCursorInTableCell()) {
var colSpanTD = selectedTD.getAttribute('colSpan')
allCells = selectedTR.cells
if (selectedTD.cellIndex + 1 != selectedTR.cells.length) {
var addColspan = allCells[selectedTD.cellIndex+1].getAttribute('colSpan')
selectedTD.colSpan = colSpanTD + addColspan
selectedTR.deleteCell(selectedTD.cellIndex+1)
}
}
} // End function
function IncreaseRowspan() {
if (isCursorInTableCell()) {
var rowSpanTD = selectedTD.getAttribute('rowSpan')
allRows = selectedTable.rows
if (selectedTR.rowIndex +1 != allRows.length) {
var allCellsInNextRow = allRows[selectedTR.rowIndex+selectedTD.rowSpan].cells
var addRowSpan = allCellsInNextRow[selectedTD.cellIndex].getAttribute('rowSpan')
var moveTo = selectedTD.rowSpan
if (!addRowSpan) addRowSpan = 1;
selectedTD.rowSpan = selectedTD.rowSpan + addRowSpan
allRows[selectedTR.rowIndex + moveTo].deleteCell(selectedTD.cellIndex)
}
}
} // End function
function DecreaseColspan() {
if (isCursorInTableCell()) {
if (selectedTD.colSpan != 1) {
selectedTR.insertCell(selectedTD.cellIndex+1)
selectedTD.colSpan = selectedTD.colSpan - 1
}
}
} // End function
function DecreaseRowspan() {
if (isCursorInTableCell()) {
alert("Todo
")
}
} // End function
function DeleteRow() {
if (isCursorInTableCell()) {
selectedTable.deleteRow(selectedTR.rowIndex)
}
}
function DeleteCol() {
if (isCursorInTableCell()) {
moveFromEnd = (selectedTR.cells.length-1) - (selectedTD.cellIndex)
allRows = selectedTable.rows
for (var i=0;i<allRows.length;i++) {
endOfRow = allRows.cells.length - 1
position = endOfRow - moveFromEnd
if (position < 0) {
position = 0
} // End If
allCellsInRow = allRows.cells
if (allCellsInRow[position].colSpan > 1) {
allCellsInRow[position].colSpan = allCellsInRow[position].colSpan - 1
} else
{
allRows.deleteCell(position)
}
} // End For
} // End If
} // End Function
function InsertColAfter() {
if (isCursorInTableCell()) {
moveFromEnd = (selectedTR.cells.length-1) - (selectedTD.cellIndex)
allRows = selectedTable.rows
for (i=0;i<allRows.length;i++) {
rowCount = allRows.cells.length - 1
position = rowCount - moveFromEnd
if (position < 0) {
position = 0
}
newCell = allRows.insertCell(position+1)
newCell.innerHTML = "&nbsp;"
if (borderShown == "yes") {
newCell.runtimeStyle.border = "1pxdo
tted #BFBFBF"
}
}
}
} // End Function
function InsertColBefore() {
if (isCursorInTableCell()) {
moveFromEnd = (selectedTR.cells.length-1) - (selectedTD.cellIndex)
allRows = selectedTable.rows
for (i=0;i<allRows.length;i++) {
rowCount = allRows.cells.length - 1
position = rowCount - moveFromEnd
if (position < 0) {
position = 0
}
newCell = allRows.insertCell(position)
newCell.innerHTML = "&nbsp;"
if (borderShown == "yes") {
newCell.runtimeStyle.border = "1pxdo
tted #BFBFBF"
}
}
}
}
function isImageSelected() {
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "IMG") {
selectedImage = foo.document.selection.createRange()(0);
return true;
}
}
}
function isControlSelected() {
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() != "IMG") {
selectedImage = foo.document.selection.createRange()(0);
return true;
}
}
}
function isTableSelected() {
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "TABLE") {
selectedTable = foo.document.selection.createRange()(0);
return true;
}
}
} // End Function
function isCursorInTableCell() {
if (document.selection.type != "Control") {
var elem =do
cument.selection.createRange().parentElement()
while (elem.tagName.toUpperCase() != "TD" &&
elem.tagName.toUpperCase() != "TH")
{
elem = elem.parentElement
if (elem == null)
break
}
if (elem) {
selectedTD = elem
selectedTR = selectedTD.parentElement
selectedTBODY = selectedTR.parentElement
selectedTable = selectedTBODY.parentElement
return true
}
}
} // End function
function isCursorInForm() {
if (document.selection.type != "Control") {
var elem =do
cument.selection.createRange().parentElement()
while (elem.tagName != "FORM")
{
elem = elem.parentElement
if (elem == null)
break
}
if (elem) {
selectedForm = elem
return true
}
}
} // End function
function isCursorInList() {
if (document.selection.type != "Control") {
var elem =do
cument.selection.createRange().parentElement()
while (elem.tagName.toUpperCase() != "OL" &&
elem.tagName.toUpperCase() != "UL")
{
elem = elem.parentElement
if (elem == null)
break
}
if (elem) {
return true
}
}
} // End function
// toggle guidelines
function toggleBorders() {
var allForms = foo.document.body.getElementsByTagName("FORM");
var allInputs = foo.document.body.getElementsByTagName("INPUT");
var allTables = foo.document.body.getElementsByTagName("TABLE");
var allLinks = foo.document.body.getElementsByTagName("A");
if (document.getElementById("guidelines"))
{
if (borderShown == "no")
{
button_down(document.getElementById("guidelines"))
} else
{
button_out(document.getElementById("guidelines"))
}
}
//do
forms
for (a=0;
a < allForms.length;
a++) {
if (borderShown == "no") {
allForms[a].runtimeStyle.border = "1pxdo
tted #FF0000"
} else
{
allForms[a].runtimeStyle.cssText = ""
}
}
//do
hidden fields
for (b=0;
b < allInputs.length;
b++) {
if (borderShown == "no") {
if (allInputs.type.toUpperCase() == "HIDDEN") {
allInputs.runtimeStyle.border = "1px dashed #000000"
allInputs.runtimeStyle.width = "15px"
allInputs.runtimeStyle.height = "15px"
allInputs.runtimeStyle.backgroundColor = "#FDADAD"
allInputs.runtimeStyle.color = "#FDADAD"
}
} else
{
if (allInputs.type.toUpperCase() == "HIDDEN")
allInputs.runtimeStyle.cssText = ""
}
}
//do
tables
for (i=0;
i < allTables.length;
i++) {
if (borderShown == "no") {
allTables.runtimeStyle.border = "1pxdo
tted #BFBFBF"
} else
{
allTables.runtimeStyle.cssText = ""
}
allRows = allTables.rows
for (y=0;
y < allRows.length;
y++) {
allCellsInRow = allRows[y].cells
for (x=0;
x < allCellsInRow.length;
x++) {
if (borderShown == "no") {
allCellsInRow[x].runtimeStyle.border = "1pxdo
tted #BFBFBF"
} else
{
allCellsInRow[x].runtimeStyle.cssText = ""
}
}
}
}
//do
anchors
for (a=0;
a < allLinks.length;
a++) {
if (borderShown == "no") {
if (allLinks[a].href.toUpperCase() == "") {
allLinks[a].runtimeStyle.border = "1px dashed #000000"
allLinks[a].runtimeStyle.width = "20px"
allLinks[a].runtimeStyle.height = "16px"
allLinks[a].runtimeStyle.backgroundColor = "#FFFFCC"
allLinks[a].runtimeStyle.color = "#FFFFCC"
}
} else
{
allLinks[a].runtimeStyle.cssText = ""
}
}
if (borderShown == "no") {
borderShown = "yes"
} else
{
borderShown = "no"
}
scrollUp()
}
// begin
spell check functions
/* word object that stores the id, word and the bookmark */
var arr, rng;
/* word object that stores the id, word and the bookmark */
function oWord(pos, wrd, bkmrk){
this.id = pos;
this.word = wrd;
this.bookmark = bkmrk;
this.getWord = getWord;
this.fixWord = fixWord;
}
function getWord(){
var r=foo.document.body.createTextRange();
r.move("word",this.id);
r.moveEnd("word",1);
if(r.text.match(/[/ /n/r]+$/)) r.moveEnd("character",-1);
// strip out any trailing line feeds and spaces
r.select();
return true;
}
function fixWord(wrd, num){
var r=foo.document.body.createTextRange();
r.move("word",this.id);
r.moveEnd("word",1);
if(r.text.match(/[/ /n/r]+$/)) r.moveEnd("character",-1);
// strip out any trailing line feeds and spaces
r.text = wrd;
for(i=this.id;i<arr.length;i++) arr.id = arr.id + (num - 1);
// update word positioning
return true;
}
function getRange(){
var sr = null;
if(foo.document.selection.type.toLowerCase() == "text"){
sr = foo.document.selection.createRange();
} else
{
sr = foo.document.body.createTextRange();
}
return sr;
}
function getWords(){
var sr = null;
if(foo.document.selection.type.toLowerCase() == "text"){
sr = foo.document.selection.createRange();
sr.expand("word");
sr.select();
};
var r=foo.document.body.createTextRange();
// get first word
r.move("word",0);
rEnd = r.expand("word");
var wordpos=0;
var idpos=0;
var wordblock="";
var aWords = new Array();
// loop until I run out of words
while(rEnd){
if(r.text.match(/[/ /n/r]+$/)) r.moveEnd("character",-1);
// strip out any trailing line feeds and spaces
t=r.text;
// grab the text
if((t!="." || t!="!" || t!="?") &&
(rEnd!=0 &&
t.match("[A-Za-z]"))) {
if((sr!=null)?sr.inRange(r):true){
r.collapse();
aWords[idpos] = new oWord(wordpos, t, r.getBookmark());
idpos++;
}
}
/* grab the next word */
r.move("word",1);
rEnd = r.expand("word");
wordpos++;
}
return aWords;
}
// End spell check functions
// Undo / Redo fix
var history = new Object;
history.data = []
history.position = 0
history.bookmark = []
history.max = 30
function saveHistory(incPosition) {
if (editModeOn == true)
{
if (history.data[history.data.length -1] != foo.document.documentElement.outerHTML)
{
for(i = history.data.length - 1;
i >= history.position + 1;
--i)
{
history.data.pop();
history.bookmark.pop();
}
history.data[history.data.length] = foo.document.documentElement.outerHTML
if (foo.document.selection.type != "Control")
{
history.bookmark[history.bookmark.length] = foo.document.selection.createRange().getBookmark()
} else
{
oControl = foo.document.selection.createRange()
history.bookmark[history.bookmark.length] = oControl(0)
}
if (!incPosition)
{
history.position++
}
}
showUndoRedo()
}
}
function goHistory(value) {
// undo
if (value == -1)
{
if (history.position == history.data.length)
{
saveHistory(true)
}
if (history.position != 0)
{
foo.document.write(history.data[--history.position])
foo.document.close()
setHistoryCursor()
}
// redo
} else
{
if (history.position < history.data.length -1)
{
foo.document.write(history.data[++history.position])
foo.document.close()
setHistoryCursor()
}
}
showUndoRedo()
}
function setHistoryCursor() {
toggleBorders()
toggleBorders()
initFoo();
if (history.bookmark[history.position])
{
r = foo.document.body.createTextRange()
if (history.bookmark[history.position] != "[object]")
{
if (r.moveToBookmark(history.bookmark[history.position]))
{
r.collapse(false)
doSave = 1
r.select();
doSave = 0
}
}
}
}
// End Undo / Redo Fix
function showUndoRedo() {
if (editModeOn == true)
{
var buttonUndoOn =do
cument.getElementById("undo_on")
var buttonUndoOff =do
cument.getElementById("undo_off")
if (history.data.length <= 1 || history.position <= 0)
{
buttonUndoOff.style.display = "inline"
buttonUndoOn.style.display = "none"
} else
{
buttonUndoOff.style.display = "none"
buttonUndoOn.style.display = "inline"
}
var buttonRedoOn =do
cument.getElementById("redo_on")
var buttonRedoOff =do
cument.getElementById("redo_off")
if (history.position >= history.data.length-1 || history.data.length == 0)
{
buttonRedoOff.style.display = "inline"
buttonRedoOn.style.display = "none"
} else
{
buttonRedoOff.style.display = "none"
buttonRedoOn.style.display = "inline"
}
} else
{
var buttonUndo2On =do
cument.getElementById("undo2_on")
var buttonUndo2Off =do
cument.getElementById("undo2_off")
if (!foo.document.queryCommandEnabled("undo"))
{
buttonUndo2Off.style.display = "inline"
buttonUndo2On.style.display = "none"
} else
{
buttonUndo2Off.style.display = "none"
buttonUndo2On.style.display = "inline"
}
var buttonRedo2On =do
cument.getElementById("redo2_on")
var buttonRedo2Off =do
cument.getElementById("redo2_off")
if (!foo.document.queryCommandEnabled("redo"))
{
buttonRedo2Off.style.display = "inline"
buttonRedo2On.style.display = "none"
} else
{
buttonRedo2Off.style.display = "none"
buttonRedo2On.style.display = "inline"
}
}
}
var fullscreenMode = false
function toggleSize() {
if (!fullscreenMode)
{
parent.document.getElementById(controlName).runtimeStyle.position = "Absolute"
parent.document.getElementById(controlName).runtimeStyle.zIndex = "999"
parent.document.getElementById(controlName).runtimeStyle.posTop = 10
parent.document.getElementById(controlName).runtimeStyle.posLeft = 10
parent.document.getElementById(controlName).runtimeStyle.width = parent.document.body.clientWidth - 15
parent.document.getElementById(controlName).runtimeStyle.height = parent.document.body.offsetHeight - 30
parent.document.getElementById(controlName).focus()
button_down(document.getElementById("fullscreen"))
button_down(document.getElementById("fullscreen2"))
fullscreenMode = true
} else
{
parent.document.getElementById(controlName).runtimeStyle.cssText = ""
parent.document.getElementById(controlName).focus()
button_out(document.getElementById("fullscreen"))
button_out(document.getElementById("fullscreen2"))
fullscreenMode = false
}
}</script>