/*PAGE*/ /*----Browser Uyumu----*/ (document.layers) ? layerobject=true : layerobject=false; (document.all)?allobject=true:allobject=false; (document.getElementById)? dom=true:dom=false; var winExp = (window.RegExp) ? true : false; function getObject(idname) { var obje; if(layerobject){obje=document.layers[idname];} else if(allobject){obje=document.all[idname];} else if(dom){obje=document.getElementById(idname);} return obje; }; if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement){ HTMLElement.prototype.insertAdjacentElement = function (where,parsedNode) { switch (where){ case 'beforeBegin': this.parentNode.insertBefore(parsedNode,this); break; case 'afterBegin': this.insertBefore(parsedNode,this.firstChild); break; case 'beforeEnd': this.appendChild(parsedNode); break; case 'afterEnd': if (this.nextSibling) { this.parentNode.insertBefore(parsedNode,this.nextSibling); } else { this.parentNode.appendChild(parsedNode); } break; } }; HTMLElement.prototype.insertAdjacentHTML = function (where,htmlStr) { var r = this.ownerDocument.createRange(); r.setStartBefore(this); var parsedHTML = r.createContextualFragment(htmlStr); this.insertAdjacentElement(where,parsedHTML); }; HTMLElement.prototype.insertAdjacentText = function (where,txtStr) { var parsedText = document.createTextNode(txtStr); this.insertAdjacentElement(where,parsedText); }; } /* ----/Browser Uyumu---*/ var frmWidth; var frmHeight; window.onload =function(){ if (!allobject || !dom){ btnCut="false"; btnCopy="false"; btnPaste="false"; spr23="false"; } var tb = document.getElementsByTagName('textarea'); var tblen = tb.length; for (var i=0; i < tblen; i++) { var txtname =document.getElementsByTagName("textarea")[i].id; makeIframe(txtname); document.getElementById(txtname+"_frm").contentWindow.document.body.innerHTML=document.getElementById(txtname).value ; tblColorPalette(txtname); btnBuilder(txtname); } }; function makeIframe(txtname){ frmWidth =document.getElementById(txtname).style.width; frmHeight =document.getElementById(txtname).style.height; var toolbar0='<table id=tblMain border=0 style="border-style: solid;border-width=thin" cellPadding=0 cellSpacing=0 bgcolor="CEE3FC" width="'+frmWidth+'" ><tr><td>'; var toolbar1='<table cellPadding=0 cellSpacing=0 id= \'tbl1' + txtname + '\'><tr id="toolbar1_'+txtname+'">' +'<td background="' + mrfImagePath + '/bg.gif" width=7 height=25 valign=top><img src="' + mrfImagePath + '/start.gif"></td>' +'<td background="' + mrfImagePath + '/bg.gif" valign=center id="lstFormat_'+txtname+'"><Select title="'+format_mrf+'" id="format' + txtname + '" size="1" style= " font-size: 12px;" onchange="fontFormat(\'' + txtname + '\', \'formatblock\', this.value);">' +'<option value="<H1>" >Header 1</font></option>' +'<option value="<H2>" >Header 2</font></option>' +'<option value="<H3>" >Header 3</font></option>' +'<option value="<H4>" >Header 4</font></option>' +'<option value="<H5>" >Header 5</font></option>' +'<option value="<H6>" >Header 6</font></option>' +'<option value="<p>" >Paragraph</font></option>' +'<option value="<PRE>" >Formatted</font></option>' +'<option value="<ADDRESS>" >Address</font></option>' +'</select></td>' +'<td background="' + mrfImagePath + '/bg.gif" valign=center id="lstFontName_'+txtname+'"><Select title="'+fontname_mrf+'" id="fontname' + txtname + '" size="1" style= " font-size: 12px;" onchange="fontFormat(\'' + txtname + '\',\'fontname\', this.value);">' +'<option value="Arial" >Arial</font></option>' +'<option value="Arial Black">Arial Black</font></option>' +'<option value="Comic Sans Ms">Comic Sans Ms</font></option>' +'<option value="Tahoma">Tahoma</font></option>' +'<option value="Times New Roman">Times New Roman</font></option>' +'<option value="verdana" >Verdana</font></option>' +'</select></td>' +'<td background="' + mrfImagePath + '/bg.gif" valign=center id="lstFontSize_'+txtname+'" ><Select title="'+fontsize_mrf+'" id="fontsize' + txtname + '" size="1" style= " font-size: 12px;" onchange="fontFormat(\'' + txtname + '\',\'fontsize\', this.value);">' +'<option value="1">1</font></option>' +'<option value="2">2</font></option>' +'<option value="3">3</font></option>' +'<option value="4">4</font></option>' +'<option value="5">5</font></option>' +'<option value="6">6</font></option>' +'<option value="7">7</font></option>' +'</select></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnForeColor_'+txtname+'"><div title="'+color_mrf+'" tag="btnFC' + txtname+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="btnFC' + txtname+'" onclick="dlgColorPalette(\'' + txtname + '\');"><img src="' + mrfImagePath + '/forecolor.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnBold_'+txtname+'"><div title="'+bold_mrf+'" down="false" class="btnSt2' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="bold'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'bold\', this.value);"><img src="' + mrfImagePath + '/bold.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnItalic_'+txtname+'"><div title="'+italic_mrf+'" down="false" class="btnSt2' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="italic'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'italic\', this.value);"><img src="' + mrfImagePath + '/italic.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnUnderline_'+txtname+'"><div title="'+underline_mrf+'" down="false" class="btnSt2' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="underline'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'underline\', this.value);"><img src="' + mrfImagePath + '/underline.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnStrikethrough_'+txtname+'"><div title="'+strikethrough_mrf+'" down="false" class="btnSt2' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="strikethrough'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'strikethrough\', this.value);"><img src="' + mrfImagePath + '/strikethrough.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" id="spr11_'+txtname+'"><img src="' + mrfImagePath + '/seperator.gif"> </td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnLeft_'+txtname+'"><div title="'+left_mrf+'" down="false" class="btnSt2' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="left'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'justifyleft\', this.value);rmfSelection1(\'' + txtname + '\')"><img src="' + mrfImagePath + '/leftalign.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnCenter_'+txtname+'"><div title="'+center_mrf+'" down="false" class="btnSt2' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="center'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'justifycenter\', this.value);rmfSelection1(\'' + txtname + '\')"><img src="' + mrfImagePath + '/centeralign.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnRight_'+txtname+'"><div title="'+right_mrf+'" down="false" class="btnSt2' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="right'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'justifyright\', this.value);rmfSelection1(\'' + txtname + '\')"><img src="' + mrfImagePath + '/rightalign.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=100%></td>' +'</tr></table>'; var toolbar2='<tr><td><table border=0 cellPadding=0 cellSpacing=0 id= \'tbl2' + txtname + '\'><tr id="toolbar2_'+txtname+'">' +'<td background="' + mrfImagePath + '/bg.gif" width=7 valign=top><img src="' + mrfImagePath + '/start.gif"></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnNew_'+txtname+'"><div title="'+new_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="new'+txtname+'" onclick="newPage(\'' + txtname + '\')"><img src="' + mrfImagePath + '/new.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnSave_'+txtname+'"><div title="'+save_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="save'+txtname+'" onclick="formSave(\'' + txtname + '\');"><img src="' + mrfImagePath + '/saveon.gif"></div></td>'
 +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnPreview_'+txtname+'"><div title="'+preview_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="preview'+txtname+'" onclick="printpreview(\'' + txtname + '\')"><img src="' + mrfImagePath + '/preview.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnPrint_'+txtname+'"><div title="'+print_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="print'+txtname+'" onclick="print(\'' + txtname + '\')"><img src="' + mrfImagePath + '/print.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" id="spr21_'+txtname+'"><img src="' + mrfImagePath + '/seperator.gif"> </td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnUndo_'+txtname+'"><div title="'+undo_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="undo'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'undo\', this.value);"><img src="' + mrfImagePath + '/undo.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnRedo_'+txtname+'"><div title="'+redo_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="redo'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'redo\', this.value);"><img src="' + mrfImagePath + '/redo.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" id="spr22_'+txtname+'"><img src="' + mrfImagePath + '/seperator.gif"> </td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnCut_'+txtname+'"><div title="'+cut_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="cut'+txtname+'" onClick="catCopyPaste(\'' + txtname + '\', \'cut\',this.value);"><img src="' + mrfImagePath + '/cut.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnCopy_'+txtname+'"><div title="'+copy_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="copy'+txtname+'" onclick="catCopyPaste(\'' + txtname + '\',\'copy\',this.value);"><img src="' + mrfImagePath + '/copy.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnPaste_'+txtname+'"><div title="'+paste_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="paste'+txtname+'" onclick="catCopyPaste(\'' + txtname + '\',\'paste\',this.value);"><img src="' + mrfImagePath + '/paste.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" id="spr23_'+txtname+'"><img src="' + mrfImagePath + '/seperator.gif"> </td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnNumbering_'+txtname+'"><div title="'+numbering_mrf+'" class="btnSt2' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="OL'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'insertorderedlist\', this.value);rmfSelection1(\'' + txtname + '\') "><img src="' + mrfImagePath + '/orderedlist.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnBullet_'+txtname+'"><div title="'+bullet_mrf+'" class="btnSt2' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="UL'+txtname+'" onclick="fontFormat(\'' + txtname + '\',\'insertunorderedlist\', this.value);rmfSelection1(\'' + txtname + '\') "><img src="' + mrfImagePath + '/unorderedlist.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" id="spr24_'+txtname+'"><img src="' + mrfImagePath + '/seperator.gif"> </td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnPicture_'+txtname+'"><div title="'+picture_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="image'+txtname+'" onclick="BtnInsertImage(\'' + txtname + '\');"><img src="' + mrfImagePath + '/insertimage.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnLink_'+txtname+'"><div title="'+link_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="link'+txtname+'" onclick="insertlink(\'' + txtname + '\')"><img src="' + mrfImagePath + '/insertlink.gif"></div></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=23 id="btnAbout_'+txtname+'"><div title="'+about_mrf+'" class="btnSt1' + txtname+'" style="border:1px solid transparent; width=20; background-image:url(' + mrfImagePath + '/bg.gif)" id="about'+txtname+'"><a href="javascript:About();" style="cursor:default;"><img src="' + mrfImagePath + '/about.gif" border="0"></div></a></td>' +'<td background="' + mrfImagePath + '/bg.gif" width=100%></td>' +'</tr></table>'; iframe='<tr><td><table border=0 cellPadding=0 cellSpacing=0 style = "width :100% ; height=100%"><tr><td>' + '<iframe tag="ifr" style= "height :' + frmHeight+' ; width :100% ; background-color:#FFFFFF;" border="1" scrolling = AUTO name =\'' + txtname +'_frm'+ '\' id=\'' + txtname +'_frm'+ '\' onmouseover="iframeover(\'' + txtname + '\')"></iframe>' +'</td></tr></table>' +'</td></tr></table>'; var toolbar = toolbar0+toolbar1+toolbar2+iframe; getObject(txtname).insertAdjacentHTML("afterEnd",toolbar); getObject(txtname).style.display = "none"; Clear(txtname); if (document.all && !window.opera) { document.getElementById(txtname +'_frm').contentWindow.document.attachEvent("onmouseup", rmfSelection); document.getElementById(txtname +'_frm').contentWindow.document.attachEvent("onkeyup", rmfSelection); document.getElementById(txtname +'_frm').contentWindow.document.attachEvent("onfocus", rmfSelection); document.getElementById(txtname +'_frm').contentWindow.document.attachEvent("ondblclick", rmfSelection); document.getElementById(txtname +'_frm').contentWindow.document.attachEvent("onclick", rmfSelection); } else { document.getElementById(txtname +'_frm').contentWindow.document.execCommand("useCSS", false, null); document.getElementById(txtname +'_frm').contentWindow.document.addEventListener("mouseup", rmfSelection,true); document.getElementById(txtname +'_frm').contentWindow.document.addEventListener("keyup", rmfSelection,true); document.getElementById(txtname +'_frm').contentWindow.document.addEventListener("onfocus", rmfSelection,true); document.getElementById(txtname +'_frm').contentWindow.document.addEventListener("dblclick", rmfSelection,true); document.getElementById(txtname +'_frm').contentWindow.document.addEventListener("click", rmfSelection,true); } resetButton(txtname); initMouse(txtname); function rmfSelection(){ rmfSelection1(txtname); } }; function rmfSelection1(txtn){ document.getElementById(txtn).value=document.getElementById(txtn+"_frm").contentWindow.document.body.innerHTML ; resetButton(txtn); if (window.getSelection){ var selected_obj = document.getElementById(txtn +'_frm').contentWindow.window.getSelection().focusNode; }else if (document.getSelection){ var selected_obj = document.getElementById(txtn +'_frm').contentWindow.document.getSelection().focusNode; }else if (document.selection){ var selected_obj = document.getElementById(txtn +'_frm').contentWindow.document.selection.createRange().parentElement(); } try { var current_tag = selected_obj; var previous_tagName = selected_obj.tagName; while(previous_tagName != "HTML"){ if (previous_tagName == "B" || previous_tagName == "STRONG"){ getObject('bold' + txtn).style.background='url(' + mrfImagePath + '/bgdown.gif)'; getObject('bold' + txtn).down='true'; getObject('bold' + txtn).style.border='1px solid gray'; } if(previous_tagName == "I" || previous_tagName == "EM"){ document.getElementById('italic' + txtn).style.background='url(' + mrfImagePath + '/bgdown.gif)'; document.getElementById('italic' + txtn).down='true'; document.getElementById('italic' + txtn).style.border='1px solid gray'; } if(previous_tagName == "U" ){ document.getElementById('underline' + txtn).style.background='url(' + mrfImagePath + '/bgdown.gif)'; document.getElementById('underline' + txtn).down='true'; document.getElementById('underline' + txtn).style.border='1px solid gray'; } if(previous_tagName == "STRIKE"){ document.getElementById('strikethrough' + txtn).style.background='url(' + mrfImagePath + '/bgdown.gif)';
 document.getElementById('strikethrough' + txtn).down='true'; document.getElementById('strikethrough' + txtn).style.border='1px solid gray'; } if(previous_tagName == "UL"){ document.getElementById('UL' + txtn).style.background='url(' + mrfImagePath + '/bgdown.gif)'; document.getElementById('UL' + txtn).down='true'; document.getElementById('UL' + txtn).style.border='1px solid gray'; } if(previous_tagName == "OL"){ document.getElementById('OL' + txtn).style.background='url(' + mrfImagePath + '/bgdown.gif)'; document.getElementById('OL' + txtn).down='true'; document.getElementById('OL' + txtn).style.border='1px solid gray'; } if(previous_tagName == "H1" || previous_tagName == "H2" || previous_tagName == "H3" || previous_tagName == "H4" || previous_tagName == "H5" || previous_tagName == "H6" || previous_tagName == "p" || previous_tagName == "PRE" || previous_tagName == "ADDRESS"){ srcDropDown('format'+txtn,'<'+ previous_tagName + '>'); } if (current_tag.face != "undefined") { srcDropDown('fontname'+txtn, current_tag.face); } if (current_tag.size != "undefined" ) { srcDropDown('fontsize'+txtn, current_tag.size); } if (current_tag.align == "left"){ document.getElementById("left" + txtn).style.background='url(' + mrfImagePath + '/bgdown.gif)'; document.getElementById('left' + txtn).down='true'; document.getElementById('left' + txtn).style.border='1px solid gray'; }else if (current_tag.align == "center" ) { document.getElementById('center' + txtn).style.background='url(' + mrfImagePath + '/bgdown.gif)'; document.getElementById('center' + txtn).down='true'; document.getElementById('center' + txtn).style.border='1px solid gray'; }else if (current_tag.align == "right") { document.getElementById('right' + txtn).style.background='url(' + mrfImagePath + '/bgdown.gif)'; document.getElementById('right' + txtn).down='true'; document.getElementById('right' + txtn).style.border='1px solid gray'; }else{ } current_tag = current_tag.parentNode; previous_tagName = current_tag.tagName; } } catch(e){ } }; function srcDropDown(ddname,value) { var srcList = document.getElementById(ddname); var srcLen = srcList.length; for (var i=0; i < srcLen; i++) { srcList.options[i].selected = false; if (srcList.options[i].value == value) { srcList.options[i].selected = true; } } }; function resetButton(txtn){ var kids = document.getElementsByTagName('DIV'); for (var i=0; i < kids.length; i++) { if(kids[i].className == 'btnSt1'+txtn || kids[i].className == 'btnSt2'+txtn){ kids[i].style.background='url(' + mrfImagePath + '/bg.gif)'; kids[i].style.border='1px solid transparent'; kids[i].down='false'; } } srcDropDown('format'+txtn, '<p>') ; srcDropDown('fontname'+txtn, 'verdana'); srcDropDown('fontsize'+txtn, '2') ; }; function initMouse(txtn){ var x = document.getElementsByTagName('DIV'); for (var i=0; i < x.length; i++) { if (x[i].className =='btnSt1' + txtn+''){ x[i].onmouseover = style1Over; x[i].onmouseout = style1Out; x[i].onmousedown = style1Down; x[i].onmouseup = style1Over; }else if (x[i].className =='btnSt2' + txtn+''){ x[i].onmouseover = style1Over; x[i].onmousedown = style2Down; x[i].onmouseout = style2Out; }else if (x[i].className =='color'){ x[i].onmouseover = colorover; x[i].onmouseout = colorout; x[i].onmouseup = colorup; } } }; function style1Over(){ this.style.background='url(' + mrfImagePath + '/bgover.gif)'; this.style.border='1px solid gray'; }; function style1Out(){ this.style.background='url(' + mrfImagePath + '/bg.gif)'; this.style.border='1px solid transparent'; }; function style1Down(){ this.style.background='url(' + mrfImagePath + '/bgdown.gif)'; this.style.border='1px solid gray'; }; function style2Down(){ this.style.background='url(' + mrfImagePath + '/bgdown.gif)'; if (this.down=="true"){ this.down="false"; }else{ this.down="true" ; this.style.border='1px solid gray'; } }; function style2Out(){ if (this.down !='true'){ this.style.background='url(' + mrfImagePath + '/bg.gif)'; this.style.border='1px solid transparent'; }else{ this.style.background='url(' + mrfImagePath + '/bgdown.gif)'; } }; function iframeover(txtn) { getObject('cp'+txtn).style.visibility="hidden"; }; function fontFormat1(txtn,pro,data){ try { getObject(txtn + "_frm").contentWindow.focus(); getObject(txtn + "_frm").contentWindow.document.execCommand(pro,false,data); getObject(txtn + "_frm").contentWindow.focus(); getObject(txtn).value=getObject(txtn+"_frm").contentWindow.document.body.innerHTML ; } catch (e) { alert(e); } }; function fontFormat(rte, command, option) { rteP=rte+"_frm"; var oRTE; if (document.all) { oRTE = frames[rteP]; } else { oRTE = document.getElementById(rteP).contentWindow; } try { oRTE.focus(); oRTE.document.execCommand(command, false, option); oRTE.focus(); oRTE.value=document.getElementById(rteP).contentWindow.document.body.innerHTML ; } catch (e) { alert(e); } }; function catCopyPaste(rte, command, option) { rteP=rte+"_frm"; var oRTE; if (document.all) { oRTE = frames[rteP]; } else { oRTE = document.getElementById(rteP).contentWindow; } try { oRTE.focus(); oRTE.document.execCommand(command, false, option); oRTE.focus(); document.getElementById(rte).value=oRTE.document.body.innerHTML ; }catch (e) { alert(e); } }; function fntColor(rte, clr) { rteP=rte+"_frm"; var oRTE; if (document.all) { oRTE = frames[rteP]; } else { oRTE = document.getElementById(rteP).contentWindow; } try { oRTE.focus(); oRTE.document.execCommand("ForeColor", false, clr); oRTE.focus(); document.getElementById(rte).value=oRTE.document.body.innerHTML ; } catch (e) { alert(e); } }; function dlgColorPalette(txtn){ var oDialog = document.getElementById('cp' + txtn); var buttonElement = document.getElementById('btnFC' + txtn); var iLeftPos =getOffsetLeft(buttonElement)+10; var iTopPos = getOffsetTop(buttonElement) + (buttonElement.offsetHeight + 0); oDialog.style.left = (iLeftPos) + "px"; oDialog.style.top = (iTopPos) + "px"; document.getElementById('cp'+txtn).style.visibility="visible"; }; function getOffsetLeft(elm) { var mOffsetLeft = elm.offsetLeft; var mOffsetParent = elm.offsetParent; while(mOffsetParent) { mOffsetLeft += mOffsetParent.offsetLeft; mOffsetParent = mOffsetParent.offsetParent; } return mOffsetLeft; }; function getOffsetTop(elm) { var mOffsetTop = elm.offsetTop; var mOffsetParent = elm.offsetParent; while(mOffsetParent) { mOffsetTop += mOffsetParent.offsetTop; mOffsetParent = mOffsetParent.offsetParent; } return mOffsetTop; }; function BtnInsertImage(txtn){ var strImage = prompt('Enter Image URL:', 'http://'); if ((strImage != null) && (strImage != "")){ document.getElementById(txtn +"_frm").contentWindow.focus(); document.getElementById(txtn +"_frm").contentWindow.document.execCommand('InsertImage', false, strImage); } }; function insertlink(txtn){ var szURL = prompt("Enter a URL:", "http://") ; try { rteCommand(txtn+'_frm', "Unlink", null); rteCommand(txtn+'_frm', "CreateLink", szURL+ " CURSOR: hand"); } catch (e) { } }; function rteCommand(rte, command, option) { var oRTE; if (document.all) { oRTE = frames[rte]; } else { oRTE = document.getElementById(rte).contentWindow; } try { oRTE.focus(); oRTE.document.execCommand(command, false, option); oRTE.focus(); } catch (e) { } }; function formSave(txtn){ try{ document.getElementById(txtn).form.submit(); } catch(e){ } }; function newPage(txtn){ document.getElementById(txtn).value=""; document.getElementById(txtn+"_frm").contentWindow.document.body.innerHTML=document.getElementById(txtn).value ; resetButton(txtn); document.getElementById(txtn +"_frm").contentWindow.focus(); }; function Clear(txtn){ var styl ='<style>' +'p{margin:0 ; padding:0};' +'body {' +'font-family: Verdana;font-size: 12px;' +'margin-top=5pt;' +'}' +'</style>'; getObject(txtn +'_frm').contentWindow.document.designMode = "on"; getObject(txtn +'_frm').contentWindow.document.open(); getObject(txtn +'_frm').contentWindow.document.write(styl); getObject(txtn +'_frm').contentWindow.document.close(); }; function Print(txtn) { var oFrame = document.getElementById(txtn+"_frm").contentWindow; oFrame.focus(); oFrame.window.print(); }; 
 function tblColorPalette(txtn){ var colorpalette='<table width="150" height="100" cellpadding="0" cellspacing="1" border="1" align="center" id= \'cp' + txtn + '\' style="left: 0; POSITION: absolute; TOP: 0">' +'<tr>' +'<td class="color" id="#FFFFFF" bgcolor="#FFFFFF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFCCCC" bgcolor="#FFCCCC" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFCC99" bgcolor="#FFCC99" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFFF99" bgcolor="#FFFF99" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFFFCC" bgcolor="#FFFFCC" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#99FF99" bgcolor="#99FF99" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#99FFFF" bgcolor="#99FFFF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#CCFFFF" bgcolor="#CCFFFF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#CCCCFF" bgcolor="#CCCCFF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFCCFF" bgcolor="#FFCCFF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'</tr>' +'<tr>' +'<td class="color" id="#CCCCCC" bgcolor="#CCCCCC" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FF6666" bgcolor="#FF6666" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFCC99" bgcolor="#FFCC99" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FF9966" bgcolor="#FF9966" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFFF66" bgcolor="#FFFF66" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFFF33" bgcolor="#FFFF33" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#66FF99" bgcolor="#66FF99" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#33FFFF" bgcolor="#33FFFF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#66FFFF" bgcolor="#66FFFF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#9999FF" bgcolor="#9999FF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'</tr>' +'<tr>' +'<td class="color" id="#C0C0C0" bgcolor="#C0C0C0" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FF0000" bgcolor="#FF0000" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FF9900" bgcolor="#FF9900" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFCC66" bgcolor="#FFCC66" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFFF00" bgcolor="#FFFF00" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#33FF33" bgcolor="#33FF33" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#66CCCC" bgcolor="#66CCCC" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#33CCFF" bgcolor="#33CCFF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#6666CC" bgcolor="#6666CC" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#CC66CC" bgcolor="#CC66CC" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'</tr>' +'<tr>' +'<td class="color" id="#999999" bgcolor="#999999" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#CC0000" bgcolor="#CC0000" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FF6600" bgcolor="#FF6600" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFCC33" bgcolor="#FFCC33" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#FFCC00" bgcolor="#FFCC00" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#33CC00" bgcolor="#33CC00" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#00CCCC" bgcolor="#00CCCC" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#3366FF" bgcolor="#3366FF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#6633FF" bgcolor="#6633FF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#CC33CC" bgcolor="#CC33CC" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'</tr>' +'<tr>' +'<td class="color" id="#666666" bgcolor="#666666" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#990000" bgcolor="#990000" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#CC6600" bgcolor="#CC6600" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#CC9933" bgcolor="#CC9933" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#999900" bgcolor="#999900" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#009900" bgcolor="#009900" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#339999" bgcolor="#339999" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#3333FF" bgcolor="#3366FF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#6633FF" bgcolor="#6633FF" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#993399" bgcolor="#993399" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'</tr>' +'<tr>' +'<td class="color" id="#333333" bgcolor="#333333" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#660000" bgcolor="#660000" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#993300" bgcolor="#993300" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>'
 +'<td class="color" id="#996633" bgcolor="#996633" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#666600" bgcolor="#666600" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#006600" bgcolor="#006600" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#336666" bgcolor="#336666" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#000099" bgcolor="#000099" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#333399" bgcolor="#333399" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#663366" bgcolor="#663366" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'</tr>' +'<tr>' +'<td class="color" id="#000000" bgcolor="#000000" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#330000" bgcolor="#330000" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#663300" bgcolor="#663300" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#663333" bgcolor="#663333" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#333300" bgcolor="#333300" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#003300" bgcolor="#003300" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#003333" bgcolor="#003333" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#000066" bgcolor="#000066" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#330099" bgcolor="#330099" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'<td class="color" id="#330033" bgcolor="#330033" width="10" height="10" onclick="fntColor(\'' + txtn + '\',this.id)"><img width="10" height="10"></td>' +'</tr></table>'; document.getElementById(txtn).insertAdjacentHTML("afterEnd",colorpalette); document.getElementById('cp' + txtn).style.visibility="hidden"; var x = document.getElementsByTagName('td'); for (var i=0; i < x.length; i++) { if (x[i].className =='color'){ x[i].onmouseover = colorover; x[i].onmouseout = colorout; x[i].onmouseup = colorup; } } }; function colorover(){ this.style.border = '1px dotted white'; }; function colorout() { this.style.border = '1px solid gray'; }; function colorup() { document.getElementById(this.offsetParent.id).style.visibility="hidden"; }; function About(){ msg=window.open("","msg","height=120,width=320"); msg.document.write("<style>"); msg.document.write("body, td {"); msg.document.write("background-color:#ECE9D8;"); msg.document.write("font-family:arial;"); msg.document.write("font-size:11px;"); msg.document.write("}"); msg.document.write("input {"); msg.document.write("font-family:arial;"); msg.document.write("font-size:11px;"); msg.document.write("}"); msg.document.write("select {"); msg.document.write("font-family:arial;"); msg.document.write("font-size:11px;"); msg.document.write("}"); msg.document.write("</style>"); msg.document.write("<fieldset>"); msg.document.write("<legend><b>About MetinRF</b></legend>"); msg.document.write("<table width=\"100%\" cellspacing=\"2\" cellpadding=\"0\" border=\"0\">"); msg.document.write("<tr>"); msg.document.write("<td colspan=\"2\" align=\"center\">Copyright &copy; 2009 <br><a href=\"http://www.meprosoft.com\" target=\"_blank\">www.meprosoft.com</a></td>"); msg.document.write("</tr>"); msg.document.write("<tr>"); msg.document.write("<tr><td height=20></td></tr>"); msg.document.write("<td colspan=2 align='right'><input type='button' value='"+ok_mrf+"' onclick='window.close()' style ='width:75px'></td>"); msg.document.write("</tr>"); msg.document.write("</table>"); msg.document.write("</fieldset>"); msg.document.close(); }; function printpreview(txtn){ document.getElementById(txtn).value=document.getElementById(txtn+"_frm").contentWindow.document.body.innerHTML ; msg=window.open("","msg","scrollbars=yes height=600,width=500"); msg.document.write("<style>"); msg.document.write("body, td {"); msg.document.write("background-color:white;"); msg.document.write("font-family:arial;"); msg.document.write("font-size:11px;"); msg.document.write("}"); msg.document.write("input {"); msg.document.write("font-family:arial;"); msg.document.write("font-size:11px;"); msg.document.write("}"); msg.document.write(" p {margin:0 ; padding:0}"); msg.document.write("</style>"); msg.document.write(document.getElementById(txtn).value); }; function btnBuilder(txtn) { if (toolbar1!=true){document.getElementById("toolbar1_"+txtn).style.display = "none";} if (lstFormat!=true){document.getElementById("lstFormat_"+txtn).style.display = "none";} if (lstFontName!=true){document.getElementById("lstFontName_"+txtn).style.display = "none";} if (lstFontSize!=true){document.getElementById("lstFontSize_"+txtn).style.display = "none";} if (btnForeColor!=true){document.getElementById("btnForeColor_"+txtn).style.display = "none";} if (btnBold!=true){document.getElementById("btnBold_"+txtn).style.display = "none";} if (btnItalic!=true){document.getElementById("btnItalic_"+txtn).style.display = "none";} if (btnUnderline!=true){document.getElementById("btnUnderline_"+txtn).style.display = "none";} if (btnStrikethrough!=true){document.getElementById("btnStrikethrough_"+txtn).style.display = "none";} if (spr11!=true){document.getElementById("spr11_"+txtn).style.display = "none";} if (btnLeft!=true){document.getElementById("btnLeft_"+txtn).style.display = "none";} if (btnCenter!=true){document.getElementById("btnCenter_"+txtn).style.display = "none";} if (btnRight!=true){document.getElementById("btnRight_"+txtn).style.display = "none";} if (toolbar2!=true){document.getElementById("toolbar2_"+txtn).style.display = "none";} if (btnSave!=true){document.getElementById("btnSave_"+txtn).style.display = "none";} if (btnNew!=true){document.getElementById("btnNew_"+txtn).style.display = "none";} if (btnPreview!=true){document.getElementById("btnPreview_"+txtn).style.display = "none";} if (btnPrint!=true){document.getElementById("btnPrint_"+txtn).style.display = "none";} if (spr21!=true){document.getElementById("spr21_"+txtn).style.display = "none";} if (btnUndo!=true){document.getElementById("btnUndo_"+txtn).style.display = "none";} if (btnRedo!=true){document.getElementById("btnRedo_"+txtn).style.display = "none";} if (spr22!=true){document.getElementById("spr22_"+txtn).style.display = "none";} if (btnCut!=true){getObject("btnCut_"+txtn).style.display = "none";} if (btnCopy!=true){document.getElementById("btnCopy_"+txtn).style.display = "none";} if (btnPaste!=true){document.getElementById("btnPaste_"+txtn).style.display = "none";} if (spr23!=true){document.getElementById("spr23_"+txtn).style.display = "none";} if (btnNumbering!=true){document.getElementById("btnNumbering_"+txtn).style.display = "none";} if (spr24!=true){document.getElementById("spr24_"+txtn).style.display = "none";} if (btnPicture!=true){document.getElementById("btnPicture_"+txtn).style.display = "none";} if (btnLink!=true){document.getElementById("btnLink_"+txtn).style.display = "none";} if (btnAbout!=true){document.getElementById("btnAbout_"+txtn).style.display = "none";} };
