var isRichText = false; var rng; var currentRTE; var allRTEs = ""; var isIE; var isGecko; var isSafari; var isKonqueror; var imagesPath; var includesPath; var cssFile; var otags = new Array(); var otagslength = 0; var fonttags = 0; function afterload() { if(isIE) { document.frames("newmessage").document.onkeydown = function () { if(document.frames("newmessage").event.ctrlKey) { if(document.frames("newmessage").event.keyCode == 13) { var hely=document.frames("newmessage").document.selection.createRange(); hely.pasteHTML("<p>"); FormatText("newmessage", 'paste', ''); return false;}}
if(document.frames("newmessage").event.keyCode==13) { var hely=document.frames("newmessage").document.selection.createRange(); hely.pasteHTML("<br clear=left>"); FormatText("newmessage", 'paste', ''); return false;}}
document.frames("newmessage").document.oncontextmenu=function () { if (!document.frames("newmessage").event.ctrlKey) { showContextMenu(document.frames("newmessage").event); return false;}}}}
function initRTE(imgPath, incPath, css) { var ua = navigator.userAgent.toLowerCase(); isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)); isGecko = (ua.indexOf("gecko") != -1); isSafari = (ua.indexOf("safari") != -1); isKonqueror = (ua.indexOf("konqueror") != -1); if (document.getElementById && document.designMode && !isSafari && !isKonqueror) { isRichText = true;}
if (!isIE) document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT | Event.MOUSEDOWN | Event.MOUSEUP); document.onmouseover = raiseButton; document.onmouseout = normalButton; document.onmousedown = lowerButton; document.onmouseup = raiseButton; imagesPath = imgPath; includesPath = incPath; cssFile = css; if (isRichText) document.writeln('<style type="text/css">@import "' + includesPath + 'nfbstyle.css";</style>');}
function writeRichText(rte, html, width, height, buttons, readOnly) { if (isRichText) { if (allRTEs.length > 0) allRTEs += ";"; allRTEs += rte; writeRTE(rte, html, width, height, buttons, readOnly);} else { var html2=html.replace(/(<(br[^>]+)>)/ig, "\n"); writeDefault(rte, html2, width, height, buttons, readOnly);}}
function writeDefault(rte, html, width, height, buttons, readOnly) { if (!readOnly) { var NS4x = (document.layers) ? 1 : 0; if(!NS4x) { document.writeln('<table class="rteBack" cellpadding="0" cellspacing="0" id="Buttons2_' + rte + '">'); document.writeln('	<tr>'); document.writeln('		<td><div id="forecolor_' + rte + '"><img class="rteImage" src="' + imagesPath + 'textcolor.gif" width="19" height="18" alt="Betűszín" title="Betűszín" onClick="FormatText(\'' + rte + '\', \'forecolor\', \'\')"></div></td>'); document.writeln('		<td>'); document.writeln('			<select unselectable="on" id="fontsize_' + rte + '" onchange="Select(\'' + rte + '\', this.id);">'); document.writeln('				<option value="Size">[betűméret]</option>'); document.writeln('				<option value="1">kicsi</option>'); document.writeln('				<option value="2">normál</option>'); document.writeln('				<option value="3">nagy</option>'); document.writeln('			</select>'); document.writeln('		</td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'bold.gif" width="19" height="18" alt="Félkövér" title="Félkövér" onClick="FormatText(\'' + rte + '\', \'bold\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'italic.gif" width="19" height="18" alt="Dőlt" title="Dőlt" onClick="FormatText(\'' + rte + '\', \'italic\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'underline.gif" width="19" height="18" alt="Aláhúzott" title="Aláhúzott" onClick="FormatText(\'' + rte + '\', \'underline\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'sup.gif" width="19" height="18" alt="Felső index" title="Felső index" onClick="FormatText(\'' + rte + '\', \'superscript\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'sub.gif" width="19" height="18" alt="Alsó index" title="Alsó index" onClick="FormatText(\'' + rte + '\', \'subscript\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'hr.gif" width="19" height="18" alt="Vízszintes vonal" title="Vízszintes vonal" onClick="document.postformcx.newmessage.value=document.postformcx.newmessage.value+\'<hr noshade>\'"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'indent.gif" width="19" height="18" alt="Behúzás" title="Behúzás" onClick="FormatText(\'' + rte + '\', \'indent\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'hyperlink.gif" width="19" height="18" alt="Hivatkozás" title="Hivatkozás" onClick="FormatText(\'' + rte + '\', \'createlink\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'image.gif" width="19" height="18" alt="Kép beillesztése" title="Kép beillesztése" onClick="doImage2()"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'help.gif" width="19" height="18" alt="Súgó" title="Súgó" onClick="sugo()"></td>'); document.writeln('	</tr>'); document.writeln('</table>');}
document.writeln('<img src="/nfimages/spacer.gif" height=2><br><textarea rows="15" cols="39" name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;">' + html + '</textarea>');} else { document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;" readonly>' + html + '</textarea>');}
document.writeln('<iframe width="154" height="104" id="cp' + rte + '" src="' + includesPath + 'palette.htm" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; display: none; position: absolute;"></iframe>');}
function raiseButton(e) { if (isIE) { var el = window.event.srcElement;} else { var el= e.target;}
className = el.className; if (className == 'rteImage' || className == 'rteImageLowered') { el.className = 'rteImageRaised';}}
function normalButton(e) { if (isIE) { var el = window.event.srcElement;} else { var el= e.target;}
className = el.className; if (className == 'rteImageRaised' || className == 'rteImageLowered') { el.className = 'rteImage';}}
function lowerButton(e) { if (isIE) { var el = window.event.srcElement;} else { var el= e.target;}
className = el.className; if (className == 'rteImage' || className == 'rteImageRaised') { el.className = 'rteImageLowered';}}
function writeRTE(rte, html, width, height, buttons, readOnly) { if (readOnly) buttons = false; var tablewidth = width; if (buttons == true) { document.writeln('<table class="rteBack" cellpadding="0" cellspacing="0" id="Buttons2_' + rte + '" width="' + tablewidth + '">'); document.writeln('	<tr>'); if (isIE) { document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'cut.gif" width="19" height="18" alt="Kivágás" title="Kivágás" onClick="FormatText(\'' + rte + '\', \'cut\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'copy.gif" width="19" height="18" alt="Másolás" title="Másolás" onClick="FormatText(\'' + rte + '\', \'copy\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'paste.gif" width="19" height="18" alt="Beillesztés" title="Beillesztés" onClick="FormatText(\'' + rte + '\', \'paste\')"></td>');}
document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'undo.gif" width="19" height="18" alt="Visszavonás" title="Visszavonás" onClick="FormatText(\'' + rte + '\', \'undo\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'redo.gif" width="19" height="18" alt="Ismét" title="Ismét" onClick="FormatText(\'' + rte + '\', \'redo\')"></td>'); document.writeln('		<td><div id="forecolor_' + rte + '"><img class="rteImage" src="' + imagesPath + 'textcolor.gif" width="19" height="18" alt="Betűszín" title="Betűszín" onClick="FormatText(\'' + rte + '\', \'forecolor\', \'\')"></div></td>'); document.writeln('		<td>'); document.writeln('			<select unselectable="on" id="fontsize_' + rte + '" onchange="Select(\'' + rte + '\', this.id);">'); document.writeln('				<option value="Size">[betűméret]</option>'); document.writeln('				<option value="1">kicsi</option>'); document.writeln('				<option value="2">normál</option>'); document.writeln('				<option value="3">nagy</option>'); document.writeln('			</select>'); document.writeln('		</td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'bold.gif" width="19" height="18" alt="Félkövér" title="Félkövér" onClick="FormatText(\'' + rte + '\', \'bold\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'italic.gif" width="19" height="18" alt="Dőlt" title="Dőlt" onClick="FormatText(\'' + rte + '\', \'italic\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'underline.gif" width="19" height="18" alt="Aláhúzott" title="Aláhúzott" onClick="FormatText(\'' + rte + '\', \'underline\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'sup.gif" width="19" height="18" alt="Felső index" title="Felső index" onClick="FormatText(\'' + rte + '\', \'superscript\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'sub.gif" width="19" height="18" alt="Alsó index" title="Alsó index" onClick="FormatText(\'' + rte + '\', \'subscript\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'left_just.gif" width="19" height="18" alt="Balra igazítás" title="Balra igazítás" onClick="FormatText(\'' + rte + '\', \'justifyleft\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'centre.gif" width="19" height="18" alt="Középre igazítás" title="Középre igazítás" onClick="FormatText(\'' + rte + '\', \'justifycenter\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'right_just.gif" width="19" height="18" alt="Jobbra igazítás" title="Jobbra igazítás" onClick="FormatText(\'' + rte + '\', \'justifyright\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'justifyfull.gif" width="19" height="18" alt="Sorkizárt" title="Sorkizárt" onclick="FormatText(\'' + rte + '\', \'justifyfull\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'hr.gif" width="19" height="18" alt="Vízszintes vonal" title="Vízszintes vonal" onClick="FormatText(\'' + rte + '\', \'inserthorizontalrule\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'outdent.gif" width="19" height="18" alt="Behúzás csökkentése" title="Behúzás csökkentése" onClick="FormatText(\'' + rte + '\', \'outdent\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'indent.gif" width="19" height="18" alt="Behúzás növelése" title="Behúzás növelése" onClick="FormatText(\'' + rte + '\', \'indent\', \'\')"></td>'); document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'hyperlink.gif" width="19" height="18" alt="Hivatkozás" title="Hivatkozás" onClick="FormatText(\'' + rte + '\', \'createlink\')"></td>'); if (isIE) { document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'image.gif" width="19" height="18" alt="Kép beillesztése" title="Kép beillesztése" onClick="doImage()"></td>');} else { document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'image.gif" width="19" height="18" alt="Kép beillesztése" title="Kép beillesztése" onClick="doImage2()"></td>');}
document.writeln('		<td><img class="rteImage" src="' + imagesPath + 'help.gif" width="19" height="18" alt="Súgó" title="Súgó" onClick="sugo()"></td>'); document.writeln('	</tr>'); document.writeln('</table><img src="/nfimages/spacer.gif" height=2><br>');}
document.writeln('<iframe id="' + rte + '" name="' + rte + '" width="' + width + 'px" height="' + height + 'px; margin: 0px; padding: 3px;"></iframe>'); document.writeln('<iframe width="154" height="104" id="cp' + rte + '" src="' + includesPath + 'palette.htm" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; display: none; position: absolute;"></iframe>'); document.writeln('<input type="hidden" id="hdn' + rte + '" name="' + rte + '" value="">'); document.getElementById('hdn' + rte).value = html; enableDesignMode(rte, html, readOnly);}
function enableDesignMode(rte, html, readOnly) { var frameHtml = "<html id=\"" + rte + "\">\n"; frameHtml += "<head>\n"; if (cssFile.length > 0) { frameHtml += "<link media=\"all\" type=\"text/css\" href=\"" + cssFile + "\" rel=\"stylesheet\">\n";} else { frameHtml += "<style>\n"; frameHtml += "body {\n"; frameHtml += "	background: #FFFFFF;\n"; frameHtml += "	margin: 0px;\n"; frameHtml += "	padding: 0px;\n"; frameHtml += "	font-family: Tahoma, Verdana;\n"; frameHtml += "	font-size: 12px;\n"; frameHtml += "}\n"; frameHtml += "</style>\n";}
frameHtml += "</head>\n"; frameHtml += "<body bgcolor=\"#FFFFFF\" topmargin=3 leftmargin=3 marginheight=3 marginwidth=3>\n"; frameHtml += html + "\n"; frameHtml += "</body>\n"; frameHtml += "</html>"; if (document.all) { var oRTE = frames[rte].document; oRTE.open(); oRTE.write(frameHtml); oRTE.close(); if (!readOnly) oRTE.designMode = "On";} else { try { if (!readOnly) document.getElementById(rte).contentDocument.designMode = "on"; try { var oRTE = document.getElementById(rte).contentWindow.document; oRTE.open(); oRTE.write(frameHtml); oRTE.close(); if (isGecko && !readOnly) { oRTE.addEventListener("keypress", kb_handler, true);}
} catch (e) { alert("Hiba a betöltéskor!");}
} catch (e) { if (isGecko) { setTimeout("enableDesignMode('" + rte + "', '" + html + "', " + readOnly + ");", 10);} else { return false;}}}}
function updateRTEs() { var vRTEs = allRTEs.split(";"); for (var i = 0; i < vRTEs.length; i++) { updateRTE(vRTEs[i]);}}
function updateRTE(rte) { if (!isRichText) return; var oHdnMessage = document.getElementById('hdn' + rte); var oRTE = document.getElementById(rte); var readOnly = false; if (document.all) { if (frames[rte].document.designMode != "On") readOnly = true;} else { if (document.getElementById(rte).contentDocument.designMode != "on") readOnly = true;}
if (isRichText) { if (oHdnMessage.value == null) oHdnMessage.value = ""; if (document.all) { oHdnMessage.value = frames[rte].document.body.innerHTML;} else { oHdnMessage.value = oRTE.contentWindow.document.body.innerHTML;}
if (stripHTML(oHdnMessage.value.replace("&nbsp;", " ")) == ""
&& oHdnMessage.value.toLowerCase().search("<hr") == -1
&& oHdnMessage.value.toLowerCase().search("<img") == -1) oHdnMessage.value = ""; if (escape(oHdnMessage.value) == "%3Cbr%3E%0D%0A%0D%0A%0D%0A") oHdnMessage.value = "";}}
function FormatText(rte, command, option) { if(isRichText) { var oRTE; if (document.all) { oRTE = frames[rte]; var selection = oRTE.document.selection; if (selection != null) { rng = selection.createRange();}} else { oRTE = document.getElementById(rte).contentWindow; var selection = oRTE.getSelection(); rng = selection.getRangeAt(selection.rangeCount - 1).cloneRange();}
try { if(command == "forecolor") { parent.command = command; currentRTE = rte; buttonElement = document.getElementById(command + '_' + rte); document.getElementById('cp' + rte).style.left = (getOffsetLeft(buttonElement, 6)) + "px"; document.getElementById('cp' + rte).style.top = (getOffsetTop(buttonElement, 6) + buttonElement.offsetHeight + 100) + "px"; if (document.getElementById('cp' + rte).style.visibility == "hidden") { document.getElementById('cp' + rte).style.visibility = "visible"; document.getElementById('cp' + rte).style.display = "inline";} else { document.getElementById('cp' + rte).style.visibility = "hidden"; document.getElementById('cp' + rte).style.display = "none";}
} else if (command == "createlink") { var presurl = 'http://'; if(isIE) { oSel = document.frames("newmessage").document.selection.createRange().parentElement(); if(oSel.href) presurl = oSel.href;}
var szURL = prompt("Hivatkozás címe(URL) [&res mező esetén hivatkozás törlése]: ", presurl); if(szURL) if(szURL.search("://") == -1) szURL = 'http://' + szURL; try { oRTE.document.execCommand("Unlink", false, null); oRTE.document.execCommand("CreateLink", false, szURL);} catch (e) { }} else { oRTE.focus(); oRTE.document.execCommand(command, false, option); oRTE.focus();}
} catch (e) { alert(e);}} else { if(command == "forecolor") { currentRTE = rte; buttonElement = document.getElementById(command + '_' + rte); document.getElementById('cp' + rte).style.left = (getOffsetLeft(buttonElement, 6)) + "px"; document.getElementById('cp' + rte).style.top = (getOffsetTop(buttonElement, 6) + buttonElement.offsetHeight + 100) + "px"; if (document.getElementById('cp' + rte).style.visibility == "hidden") { document.getElementById('cp' + rte).style.visibility = "visible"; document.getElementById('cp' + rte).style.display = "inline";} else { document.getElementById('cp' + rte).style.visibility = "hidden"; document.getElementById('cp' + rte).style.display = "none";}} else if (command == "createlink") { var presurl = 'http://'; var szURL = prompt("Hivatkozás címe(URL): ", presurl); var szURLTEXT = prompt("Hivatkozás szövege: ", 'link'); if(szURL) if(szURL.search("://") == -1) szURL = 'http://' + szURL; try { eval('document.postformcx.'+rte+'.value=document.postformcx.'+rte+'.value+\'<a href="'+szURL+'" target="_blank">'+szURLTEXT+'</a>\'');} catch (e) { }
} else if (command == "bold") { tagopenclose(rte, 'B');} else if (command == "italic") { tagopenclose(rte, 'I');} else if (command == "underline") { tagopenclose(rte, 'U');} else if (command == "superscript") { tagopenclose(rte, 'SUP');} else if (command == "subscript") { tagopenclose(rte, 'SUB');} else if (command == "indent") { tagopenclose(rte, 'BLOCKQUOTE');}}}
function tagopenclose(rte, tagid) { if(otags[otagslength-1]==tagid) { otags[otagslength-1]=null; otagslength--; eval('document.postformcx.'+rte+'.value=document.postformcx.'+rte+'.value+\'</'+tagid+'>\'');} else { insertone=1; if(otagslength>0) { for(oti=otagslength; oti>0; oti--) { if(otags[oti-1]==tagid) { otagslengthx=otagslength; otix=oti; for(oti2=otagslengthx-1; oti2>otix-2; oti2--) { eval('document.postformcx.'+rte+'.value=document.postformcx.'+rte+'.value+\'</'+otags[oti2]+'>\''); otags[oti2]=null; otagslength--; insertone=0; oti=0;}}}}
if(insertone) { otags[otagslength]=tagid; otagslength++; eval('document.postformcx.'+rte+'.value=document.postformcx.'+rte+'.value+\'<'+tagid+'>\'');}}}
function setColor(color) { var rte = currentRTE; var oRTE; if (document.all) { oRTE = frames[rte];} else { oRTE = document.getElementById(rte).contentWindow;}
if(isRichText) { var parentCommand = parent.command; if (document.all) { var sel = oRTE.document.selection; if (sel != null) { var newRng = sel.createRange(); newRng = rng; newRng.select();}}
oRTE.focus(); oRTE.document.execCommand(parentCommand, false, color); oRTE.focus();} else { eval('document.postformcx.'+rte+'.value=document.postformcx.'+rte+'.value+\'<font color="'+color+'">\''); fonttags++;}
document.getElementById('cp' + rte).style.visibility = "hidden"; document.getElementById('cp' + rte).style.display = "none";}
function getOffsetTop(elm, parents_up) { var mOffsetTop = elm.offsetTop; var mOffsetParent = elm.offsetParent; if(!parents_up) { parents_up = 10000;}
while(parents_up>0 && mOffsetParent) { mOffsetTop += mOffsetParent.offsetTop; mOffsetParent = mOffsetParent.offsetParent; parents_up--;}
return mOffsetTop;}
function getOffsetLeft(elm, parents_up) { var mOffsetLeft = elm.offsetLeft; var mOffsetParent = elm.offsetParent; if(!parents_up) { parents_up = 10000;}
while(parents_up>0 && mOffsetParent) { mOffsetLeft += mOffsetParent.offsetLeft; mOffsetParent = mOffsetParent.offsetParent; parents_up--;}
return mOffsetLeft;}
function Select(rte, selectname) { if(isRichText) { var oRTE; if (document.all) { oRTE = frames[rte]; var selection = oRTE.document.selection; if (selection != null) { rng = selection.createRange();}} else { oRTE = document.getElementById(rte).contentWindow; var selection = oRTE.getSelection(); rng = selection.getRangeAt(selection.rangeCount - 1).cloneRange();}
var idx = document.getElementById(selectname).selectedIndex; if (idx != 0) { var selected = document.getElementById(selectname).options[idx].value; var cmd = selectname.replace('_' + rte, ''); oRTE.focus(); oRTE.document.execCommand(cmd, false, selected); oRTE.focus(); document.getElementById(selectname).selectedIndex = 0;}} else { var idx = eval('document.postformcx.'+selectname+'.selectedIndex'); if (idx != 0) { var selected = eval('document.postformcx.'+selectname+'.options[idx].value'); eval('document.postformcx.newmessage.value=document.postformcx.newmessage.value+\'<font size="'+selected+'">\''); fonttags++;}}}
function kb_handler(evt) { var rte = evt.target.id; if (evt.ctrlKey) { var key = String.fromCharCode(evt.charCode).toLowerCase(); var cmd = ''; switch (key) { case 'b': cmd = "bold"; break; case 'i': cmd = "italic"; break; case 'u': cmd = "underline"; break;}; if (cmd) { FormatText(rte, cmd, true); evt.preventDefault(); evt.stopPropagation();}}}
function docChanged (evt) { alert('changed');}
function stripHTML(oldString) { var newString = oldString.replace(/(<([^>]+)>)/ig,""); newString = newString.replace(/\r\n/g," "); newString = newString.replace(/\n/g," "); newString = newString.replace(/\r/g," "); newString = trim(newString); return newString;}
function trim(inputString) { if (typeof inputString != "string") return inputString; var retValue = inputString; var ch = retValue.substring(0, 1); while (ch == " ") { retValue = retValue.substring(1, retValue.length); ch = retValue.substring(0, 1);}
ch = retValue.substring(retValue.length-1, retValue.length); while (ch == " ") { retValue = retValue.substring(0, retValue.length-1); ch = retValue.substring(retValue.length-1, retValue.length);}
while (retValue.indexOf("  ") != -1) { retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length);}
return retValue;}
var oPopup2 = window.createPopup(); function showContextMenu(event) { var foo=document.frames("newmessage"); menu="contextMenu"; width="162"; height="67"; var lefter=event.clientX; var topper=event.clientY; var oPopBody=oPopup2.document.body; height=parseInt(height); var HTMLContent="<table style='BORDER-LEFT: threedface 1px solid; BORDER-TOP: threedface 1px solid; BORDER-RIGHT: #404040 1px solid; BORDER-BOTTOM: #404040 1px solid;' cellpadding=0 cellspacing=0><tr><td>"; HTMLContent=HTMLContent+eval(menu).innerHTML; if(isImageSelected()) { HTMLContent=HTMLContent+eval("cmImageMenu").innerHTML; height=height+86;}
HTMLContent=HTMLContent+"</td></tr></table>"; oPopBody.innerHTML=HTMLContent; oPopup2.show(lefter+2, topper+2, width, height, foo.document.body);}
function isSelection() { var foo=document.frames("newmessage"); if ((foo.document.selection.type == "Text") || (foo.document.selection.type == "Control")) { return true;} else { return false;}}
function isImageSelected() { var foo=document.frames("newmessage"); 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 isAllowed() { var foo=document.frames("newmessage"); var sel; var obj; sel = foo.document.selection; if (sel.type != "Control") { obj = sel.createRange().parentElement();} else { obj = sel.createRange()(0);}
if (obj.isContentEditable) { return true;} else { return false;}}
function doImage() { if(isAllowed()) { if(!isImageSelected()) { var leftPos = (screen.availWidth-545) / 2; var topPos = (screen.availHeight-450) / 2; imageWin = window.open('/inc/editor-insertimg.php', '', 'width=545, height=450, scrollbars=yes, resizable=yes, titlebar=0, status=0, top='+topPos+', left='+leftPos);}} else { alert('A képbeillesztéshez előbb kattints az szerkesztődobozba!');}}
function sugo() { suwin=window.open("/linkhelp.php","Help","toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=1, width=545, height=450"); }
function doImage2() { var leftPos = (screen.availWidth-545) / 2; var topPos = (screen.availHeight-450) / 2; imageWin = window.open('/inc/editor-insertimg.php', '', 'width=545, height=450, scrollbars=yes, resizable=yes, titlebar=0, top='+topPos+', left='+leftPos);}
function selectImage(imageurl) { var rte='newmessage'; if(isRichText) { var oRTE; if (document.all) { oRTE = frames[rte]; var selection = oRTE.document.selection; if (selection != null) { rng = selection.createRange();}
} else { oRTE = document.getElementById(rte).contentWindow; var selection = oRTE.getSelection(); rng = selection.getRangeAt(selection.rangeCount - 1).cloneRange();}
imagePath = imageurl; if ((imagePath != null) && (imagePath != "")) { imagePath = '/inc/thumbnail.inc.php?fntype=4&maxw=300&maxh=300&pfn=' + imagePath; if(isIE) { var hely=document.frames("newmessage").document.selection.createRange(); hely.pasteHTML('<img src="'+imagePath+'" align=left>');} else { oRTE.focus(); oRTE.document.execCommand('InsertImage', false, imagePath); oRTE.focus();}}
} else { if(imageurl) { if(imageurl.search("://") == -1) imageurl = '/forum/userimgs/' + imageurl; eval('document.postformcx.'+rte+'.value=document.postformcx.'+rte+'.value+\'<img src="'+imageurl+'" border=0>\'');}}}
function doPborder() { if(isImageSelected()) { var imageBorder=selectedImage.border; if(imageBorder=="1") { imageBorder="0";} else { imageBorder="1";}
selectedImage.removeAttribute("style"); selectedImage.border=imageBorder;}}
function doPalign(picalign) { if(isImageSelected()) { if(picalign!="none") { selectedImage.align=picalign;} else { selectedImage.removeAttribute('align',0)}}}