var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opens = _____WB$wombat$assign$function_____("opens"); var sHref, oRule; var msg='?'; dl = document.layers; da = document.all; ge = document.getElementById; ws = window.sidebar; var selectedTD, selectedTR, selectedTBODY, selectedTable, selectedImage, sCoveredTD; var statusBorders = "" var borderShown = 0 var sToolbarMode = 'Page'; var loaded = 0; var Mode = 1; var sHilite = 0; onresize = sResize; onhelp = sHelpCenter; onload = function(){ loadIt(1); sHilite = GetCookie('sHighlite') ? GetCookie('sHighlite') : 0; sTabPage.style.visibility = 'visible'; sTabTable.style.position = sTabPage.style.position = sTabText.style.position = sTabImage.style.position = sTabCode.style.position = 'absolute'; foo.document.designMode = 'On'; sResize(); loaded = true; for(i in sPages){ sPageSwitch.options[sPageSwitch.length] = new Option(sPages[i], sPages[i]); if(sPages[i] == location.href.replace(/^(.)*=/ig, '')) sPageSwitch.options[sPageSwitch.length-1].selected = true; } } function sResize(){ document.all.foo.height = document.body.clientHeight-191 + "px"; document.all.foo.focus(); } function sChangeToolbar(sNewMode, sBlink){ if(sToolbarMode == sNewMode) return true; if(sNewMode == 'Code' || sToolbarMode == 'Code') SwitchMode(); if(sNewMode == 'Table' || sToolbarMode == 'Table') sBorders(); if(sToolbarMode){ eval('sTab' + sNewMode).style.visibility = 'visible'; eval('sTab' + sToolbarMode).style.visibility = 'hidden'; eval('s' + sNewMode).src = 'img//' + sNewMode + 's_up.gif'; eval('s' + sToolbarMode).src = 'img//' + sToolbarMode + 's.gif'; } sToolbarMode = sNewMode; foo.focus(); } function fooLoad(){ if(loaded){ foo.document.onhelp = sHelpCenter; loadIt(1); sZoom.style.display = sHiSwitch.style.display = sPageSwitch.style.display ='inline'; sCurPage.innerHTML = location.href.replace(/^.*file=/ig, ''); sCurTitle.innerHTML = foo.document.title; switch(location.href.replace(/^(.*)=/ig, '')){ case 'search.html': alert('This is the "Search Page Template". The actual results will be placed here.'); break; case 'guestbook.html': alert('This is the "Guestbook Template". The actual guestbook posts will be placed here.'); break; } if(GetCookie('sHighlite') == 1) sHiSwitch.options[1].selected = true; var iframes = document.all.tags("IFRAME"); el = iframes[0]; el.frameWindow = document.frames[el.id]; el.frameWindow.document.oncontextmenu = function(){ if (!el.frameWindow.event.ctrlKey){ goContext(); return false; } } foo.document.execCommand("2D-Position", false, true); borderShown = 0; sTip(1); foo.document.onclick = function(){ if(foo.document.selection.type == "Control"){ var oControlRange = foo.document.selection.createRange(); if(foo.event.srcElement.tagName.match(/^IMG$/i) && oControlRange(0).tagName.match(/^IMG$/i) && foo.event.srcElement.src != oControlRange(0).src){ sControlRange = foo.document.body.createControlRange(); sControlRange.add(foo.event.srcElement, 0); sControlRange.select(); } } sHighlite(); } } } function sHighlite(){ if(isCursorInTableCell() && sHilite == 1){ if(sCoveredTD) sCoveredTD.runtimeStyle.cssText = ''; sCoveredTD = selectedTD; sCoveredTD.runtimeStyle.border = 'red solid 1px'; }else if(sCoveredTD) sCoveredTD.runtimeStyle.cssText = ''; } function sChangeHighlite(sState){ sHilite = sState; SetCookie('sHighlite', sState); } function SwitchMode() { if (Mode == 1) { sSelRange = foo.document.selection.createRange(); sHtmlText = sSelRange.htmlText; foo.document.body.innerText = foo.document.documentElement.outerHTML.replace(/&/g, '&'); code = foo.document.body.innerHTML; code = code.replace(/(<([\s\S]*?)>)/gi, "$1") code = code.replace(/(<(table|tbody|th|tr|td|\/table|\/tbody|\/th|\/tr|\/td)([\s\S]*?)>)/gi, "$1") code = code.replace(/(<!--([\s\S]*?)>)/gi, "$1") code = code.replace(/(<img([\s\S]*?)>)/gi, "$1") code = code.replace(/(<(a|\/a)([\s\S]*?)>)/gi, "$1") code = code.replace(/(<(script|\/script)([\s\S]*?)>)/gi,"$1") foo.document.body.innerHTML = code; foo.document.body.runtimeStyle.fontFamily = "Verdana" foo.document.body.runtimeStyle.fontSize = "10pt" foo.document.body.runtimeStyle.bgColor = '#FFFFFF'; foo.document.body.runtimeStyle.text = '#000000'; foo.document.body.runtimeStyle.background = ''; foo.document.body.runtimeStyle.marginTop = '10px'; foo.document.body.runtimeStyle.marginLeft = '10px'; sNewRange = foo.document.selection.createRange(); r = foo.document.body.createTextRange(); if(sHtmlText && r.findText(sHtmlText)){ r.select(); r.scrollIntoView(); } foo.document.onkeypress = function(){ if(foo.event.shiftKey && foo.event.keyCode == 13){ sRange = foo.document.selection.createRange(); sRange.text = ''; } } Mode = 2; }else{ foo.document.body.innerHTML = foo.document.body.innerText; foo.document.body.runtimeStyle.cssText = ""; foo.document.onkeypress = ''; Mode = 1; } } function sTag(sTag){ foo.focus(); sRange = foo.document.selection.createRange(); if(sTag.match(/^br$/i)) sRange.text = sRange.text + '<' + sTag.toUpperCase() + '>'; else sRange.text = '<' + sTag.toUpperCase() + '>' + sRange.text + '' + sTag.toUpperCase() + '>'; } function sBorders(){ allTables = foo.document.body.getElementsByTagName("TABLE"); for(i=0; i < allTables.length; i++){ if(!borderShown) allTables[i].runtimeStyle.borderTop = allTables[i].runtimeStyle.borderLeft = "1px dotted #BFBFBF"; else allTables[i].runtimeStyle.cssText = ''; allRows = allTables[i].rows; for(y=0; y < allRows.length; y++){ allCells = allRows[y].cells; for(x=0; x < allCells.length; x++) if(!borderShown) allCells[x].runtimeStyle.borderRight = allCells[x].runtimeStyle.borderBottom = "1px dotted #BFBFBF"; else allCells[x].runtimeStyle.cssText = ''; } } borderShown = borderShown ? 0 : 1; if(!borderShown) foo.document.body.innerHTML = foo.document.body.innerHTML; foo.scrollBy(0,0); } function sPrepare(){ if(sToolbarMode.match(/Code/)) SwitchMode(); if(borderShown) sBorders(); document.sfPage.EditorHTML.value = foo.document.documentElement.outerHTML; } function ModifyProperties(){ open('inc/sPageProps.php','','width=540,height=320,scrollbars=no,toolbar=0'); } function ShowPreview() { if(location.href.replace(/.*=/ig, '') == 'guestbook.html'){ window.open('/guestbook.php', '_blank', 'width=780,height=580,scrollbars=yes,resizable=yes,titlebar=0,top=' + ((screen.availHeight-580)/2) + ',left=' + ((screen.availWidth-780)/2)); }else{ previewHTML = sToolbarMode.match(/Code/) ? foo.document.body.innerText : foo.document.documentElement.outerHTML; previewHTML = previewHTML.replace(/1px dotted/igm, '0px'); previewWin = window.open('', '_blank', 'width=780,height=580,scrollbars=yes,resizable=yes,titlebar=0,top=' + ((screen.availHeight-580)/2) + ',left=' + ((screen.availWidth-780)/2)); previewWin.document.write("") previewWin.document.write(previewHTML) previewWin.document.close() } } function sHelpCenter(){ open('help.php?cat=2', '_blank', ''); return false; } function sBlink(num){ sPlace.style.color = num%2 == 0 ? '#ffffff' : '#ff0000'; if(num-- > 0) setTimeout("sBlink(" + num + ")", 500); } function sTip(id){ i=0; sPlace.innerHTML = sTipArr[id]; sBlink(3); } function sImgDlg(){ res = showModalDialog('inc/sImg.php', null, 'dialogWidth: 330px; dialogHeight: 225px; center: yes; resizable: no; scroll: no; status: no;'); if(res == 'lib') res = showModalDialog('lib/lib.php', null, 'dialogWidth: 770px; dialogHeight: 450px; center: yes; resizable: no; scroll: no; status: no;'); if(res) return res; } function sNewImg(){ if(isImageSelected()) temp = selectedImage; else temp = 0; res = sImgDlg(); if(res){ document.forms.imgUpl.nSel.outerHTML = '' + document.forms.imgUpl.nSel.innerHTML + '' + res.replace(/^.*\//ig, '') + ''; uplTd.style.display = 'block'; // document.forms.fileUpl.nSel.outerHTML = '' + document.forms.fileUpl.nSel.innerHTML + '' + res.replace(/^.*\//ig, '') + ''; // upfTd.style.display = "block"; foo.focus(); foo.document.execCommand("InsertImage", false, res); if(isImageSelected() && temp){ selectedImage.style.position = temp.style.position; selectedImage.style.zIndex = temp.style.zIndex; selectedImage.style.top = temp.style.top; selectedImage.style.left = temp.style.left; selectedImage.style.borderColor = temp.style.borderColor; selectedImage.border = temp.border; selectedImage.style.alt = temp.alt; selectedImage.hspace = temp.hspace; selectedImage.vspace = temp.vspace; selectedImage.align = temp.align; } } } function sUplDlg(){ res = showModalDialog('inc/sUpl.php', null, 'dialogWidth: 330px; dialogHeight: 225px; center: yes; resizable: no; scroll: no; status: no;'); if(res){ // document.forms.fileUpl.nSel.outerHTML = "" + document.forms.fileUpl.nSel.innerHTML + "' + res + '"; // upfTd.style.display = "block"; } foo.focus(); } function sUplMng(){ res = showModalDialog('inc/sMgr.php', null, 'dialogWidth: 330px; dialogHeight: 225px; center: yes; resizable: no; scroll: yes; status: no;'); if(res){ } } function sHyperlink(){ if(foo.document.selection.type == 'None'){ alert('Please select text or image first.'); }else{ sSel = new Object(); sSel.defLinkColor = foo.document.body.link ? foo.document.body.link : '#0000ff'; if(foo.document.selection.type == "Control"){ var oControlRange = foo.document.selection.createRange(); if(oControlRange(0).tagName.toUpperCase() == "IMG") oSel = oControlRange(0).parentNode; }else{ oSel = foo.document.selection.createRange().parentElement(); } sRange = foo.document.selection.createRange(); if(sRange.queryCommandValue('ForeColor')){ sSel.linkcolor = sRange.queryCommandValue('ForeColor').toString(16); while(sSel.linkcolor.length < 6) sSel.linkcolor = '0' + sSel.linkcolor; sSel.linkcolor = sSel.linkcolor.substr(4) + sSel.linkcolor.substr(2, 2) + sSel.linkcolor.substr(0, 2); } if(sRange.queryCommandState('Underline', false, null)) sSel.linkDec = 'underline'; if(oSel.tagName != 'A'){ firedObj = oSel; while(firedObj.tagName != "BODY" && firedObj.tagName != "A") firedObj = firedObj.parentElement; if(firedObj.tagName == 'A') oSel = firedObj; } if(oSel.tagName == "A"){ if(oSel.childNodes[0] && oSel.childNodes[0].tagName){ tmpObj = oSel.childNodes[0]; while(!tmpObj.tagName == 'FONT' && typeof(tmpObj.childNodes[0]) != 'undefined') tmpObj = tmpObj.childNodes[0]; if(tmpObj.tagName == 'FONT' && tmpObj.outerHTML && tmpObj.outerHTML.match(/]*onmouseover/i)){ if(temp = tmpObj.outerHTML.match(/this\.color='#([0-9a-fA-F]*)/i)) sSel.hovercolor = temp[0].replace(/.*'#/, ''); if(temp = tmpObj.outerHTML.match(/textDecoration='([^']*)/i)) sSel.hoverDec = temp[0].replace(/.*'/, ''); } } sSel.popup = oSel.target == '_blank' ? true : false; if(oSel.outerHTML.match(/onclick=/ig) && oSel.onclick.match(/^open\(/)){ sHref = oSel.onclick.replace(/^.*\/|['|"].*$/g, ''); sSel.popup = true; sSel.res = oSel.onclick.replace(/^.*resizable=|;.*$/g, ''); sSel.status = oSel.onclick.replace(/^.*status=|;.*$/g, ''); sSel.tool = oSel.onclick.replace(/^.*toolbar=|;.*$/g, ''); sSel.width = oSel.onclick.replace(/^.*width=|;.*$/g, ''); sSel.height = oSel.onclick.replace(/^.*height=|;.*$/g, ''); }else{ sHref = unescape(oSel.href); } if(sHref.match(/@/)){ sSel.type = 3; sSel.url = sHref.replace(/^mailto:( )*/ig, ''); }else if(sHref.match(/^http:\/\/guestbook/i)){ sSel.type = 1; sSel.url = sHref; }else if(sHref.match(/usr/ig) || !sHref.match(/http:/ig)){ sHref = sHref.replace(/(.)*\//ig, ''); match = false; for(key in sUploadsList) match = sUploadsList[key] == sHref; if(match){ sSel.type = 4; sSel.url = sHref; }else{ sSel.type = 1; sSel.url = sHref ? sHref : 'index.html'; } }else{ sSel.type = 2; sSel.url = sHref; } } sSel.self = location.href.replace(/.*file=/ig, ''); sSel.pages = sPageSwitch.options; res = showModalDialog('inc/sHyperlink.php', sSel, 'dialogWidth: 280px; dialogHeight: 535px; center: yes; resizable: no; scroll: no; status: no;'); if(res && res.url){ oNewSelection = foo.document.selection.createRange(); if(foo.document.selection.type == "Control"){ selectedImage = foo.document.selection.createRange()(0); selectedImage.border = selectedImage.border ? selectedImage.border : 0; } oNewSelection.execCommand("CreateLink",false,res.url); if(res.linkcolor) oNewSelection.execCommand('ForeColor', false, res.linkcolor); if(res.linkDec && ((res.linkDec.match(/underline/i) && !oNewSelection.queryCommandState('Underline', false, null)) || (res.linkDec.match(/none/i) && oNewSelection.queryCommandState('Underline', false, null)))) oNewSelection.execCommand('Underline', false, null); if(foo.document.selection.type == "Control") oLink = oNewSelection(0).parentNode; else oLink = oNewSelection.parentElement(); if(oLink.tagName != 'A') while(oLink.tagName != "BODY" && oLink.tagName != "A") oLink = oLink.parentElement; if(oLink.tagName.match(/^A$/i)){ oLink.removeAttribute('onclick'); oLink.removeAttribute('target'); if(oNewSelection.htmlText){ if(res.hovercolor){ sOverText = "this.tempColor=this.color; this.color='" + res.hovercolor + "';"; sOutText = "this.color=this.tempColor;"; if(res.hoverDec != res.linkDec){ sOnState = res.linkDec.match(/underline/i) ? 'none' : 'underline'; sOverText += "this.style.textDecoration='" + sOnState + "';"; sOutText += "this.style.textDecoration='" + res.linkDec + "';"; } } sOterLink = oNewSelection.htmlText.replace(/]*>|<\/A>/ig, ''); if(res.hovercolor){ sOterLink = sOterLink.replace(/\sonmouseover=[^\s]*|\sonmouseout=[^\s]*/ig, ''); sOterLink = sOterLink.replace(/' + sOterLink + ''; oNewSelection.pasteHTML(sOterLink); } } foo.focus(); if(res.url == 'the_s2u_new_page.html') sNewPage(); } } } function sRemoveOption(){ if(document.forms.fileUpl.nSel.options.length){ document.all.sDelFrame.src = 'inc/sDelUpload.php?file=' + document.forms.fileUpl.nSel.options[document.forms.fileUpl.nSel.selectedIndex].value; document.forms.fileUpl.nSel.options[document.forms.fileUpl.nSel.selectedIndex]=null; document.forms.fileUpl.nSel.selectedIndex=0; }else{ upfTd.style.display = 'none'; } } function sStep3(param){ document.forms.sfPage.sAdmDoc.value = param; document.forms.sfPage.sAction.value = 6; sPrepare(); document.forms.sfPage.submit(); } function sAdmSave(){ document.forms.sfPage.sAction.value = 6; sPrepare(); document.forms.sfPage.submit(); } function sImgProps(){ if(isImageSelected()){ sPrePos = selectedImage.style.position; res = window.showModalDialog('inc/sImgProp.php', selectedImage, 'dialogWidth: 360px; dialogHeight: 320px; center: yes; resizable: no; scroll: no; status: no;'); if(res){ for(key in res) if(key == 'style'){ for(sub_key in res.style) selectedImage.style[sub_key] = res.style[sub_key]; }else{ selectedImage[key] = res[key]; } if(!res.align) selectedImage.removeAttribute('align'); if(sPrePos.match(/^absolute$/i) && !selectedImage.style.position.match(/^absolute$/i)){ sFired = selectedImage.parentElement; while(!sFired.tagName.match(/^table$|^body$/i)) sFired = sFired.parentElement; if(sFired.tagName.match(/^table$/i) && sFired.style.position.match(/absolute/i)); sFired.outerHTML = selectedImage.outerHTML; }else if(!sPrePos.match(/^absolute$/i) && selectedImage.style.position.match(/^absolute$/i)) selectedImage.outerHTML = '' + selectedImage.outerHTML + ''; } }else alert('Plese select an image you want to modify first.'); } function cntPhotoshop(){ if(isImageSelected()){ res = showModalDialog('gd/index.php', selectedImage.src.replace(/^.*\/builder\/|\?/ig, ''), 'dialogWidth: ' + (screen.width - 200) + 'px; dialogHeight: ' + (screen.height - 100) + 'px; center: yes; resizable: no; scroll: no; status: no;'); if(res != 7) selectedImage.src = res + '?'; }else alert('Plese select an image you want to modify first.'); } function sDelPage(sAction){ if(sAction == 3 && location.href.match(/index\.html$/ig)) alert('You can\'t delete the index page.\nThe index page is the first page of your site.\nWithout it your site will be unaccessible.'); else if(sAction == 3 && location.href.match(/search\.html$/ig)) alert('You can\'t delete the search page. Without it your site will be broken\nYou can just remove the search form from your pages in order to disable search.'); else{ document.forms.sfPage.sAction.value = sAction; document.forms.sfPage.submit(); } } function sGoTo(sNewUrl, sPublish){ document.forms.sfPage.sUserUrl.value = sNewUrl; document.forms.sfPage.sAction.value = sPublish ? 8 : 1; sPrepare(); document.forms.sfPage.submit(); } function sNewPage(param){ res = window.showModalDialog('inc/sNewPage.php', sPageSwitch.options, 'dialogWidth: 250px; dialogHeight: 310px; center: yes; resizable: no; scroll: no; status: no;'); if(res && res.title){ document.forms.sfPage.nfTitle.value = res.title; sPrepare(); document.forms.sfPage.nfSel.value = res.sel; document.forms.sfPage.nfClone.value = res.clone; document.forms.sfPage.sAction.value = 5; document.forms.sfPage.submit(); } } var sInitColor = null; function callColorDlg(colorType){ if(colorType == 1){ sRange = foo.document.selection.createRange(); if(sRange.queryCommandValue('ForeColor')){ sInitColor = sRange.queryCommandValue('ForeColor').toString(16); while(sInitColor.length < 6) sInitColor = '0' + sInitColor; sInitColor = sInitColor.substr(4) + sInitColor.substr(2, 2) + sInitColor.substr(0, 2); } } if(sInitColor == null) var sColor = dlgHelper.ChooseColorDlg(); else var sColor = dlgHelper.ChooseColorDlg(sInitColor); sColor = sColor.toString(16); if (sColor.length < 6) { var sTempString = "000000".substring(0,6-sColor.length); sColor = sTempString.concat(sColor); } myCommand = (colorType == 2) ? 'BackColor' : 'ForeColor'; foo.document.execCommand(myCommand, false, sColor); sInitColor = sColor; } function sWarning(sLink, sMessage){ sMessage = sMessage ? sMessage : ''; if(confirm(sMessage)) document.location.href = sLink; } function sCopy(){ sRange = foo.document.selection.createRange(); if(sRange.text){ sStyleBuffer = new Object(); sStyleBuffer.font = sRange.queryCommandValue('FontName'); sStyleBuffer.size = sRange.queryCommandValue('FontSize'); sStyleBuffer.color = sRange.queryCommandValue('ForeColor'); sStyleBuffer.bold = sRange.queryCommandValue('Bold'); sStyleBuffer.italic = sRange.queryCommandValue('Italic'); sStyleBuffer.underline = sRange.queryCommandValue('Underline'); }else alert('Please select a text fragment to copy style from.'); } function sPaste(){ if(typeof(sStyleBuffer) == 'undefined'){ alert('You need to copy style first'); }else{ sRange = foo.document.selection.createRange(); if(sRange.text){ sRange.execCommand('FontName', false, sStyleBuffer.font); sRange.execCommand('FontSize', false, sStyleBuffer.size); sRange.execCommand('ForeColor', false, sStyleBuffer.color); if(sStyleBuffer.bold && !sRange.queryCommandValue('Bold')) sRange.execCommand('Bold', false, null); if(sStyleBuffer.italic && !sRange.queryCommandValue('Italic')) sRange.execCommand('Italic', false, null); if(sStyleBuffer.underline && !sRange.queryCommandValue('Underline')) sRange.execCommand('Underline', false, null); }else alert('Please select a text fragment to copy style from.'); } } }