รายละเอียด
function insertAtCursor(Field, tag) { //IE support if (document.selection) { Field.focus(); var sel = document.selection.createRange(); if(sel.text == "") { sel.text = "["+tag+"] [/"+tag+"]"; } else { sel.text = "["+tag+"]"+sel.text+"[/"+tag+"]"; } } //MOZILLA/NETSCAPE support else if (Field.selectionStart || Field.selectionStart == '0') { var startPos = Field.selectionStart; var endPos = Field.selectionEnd; if (typeof Field.selectionStart != 'undefined') //ͷӡ select text textarea { var xxx = Field.value.substring(Field.selectionStart, Field.selectionEnd); Field.value = Field.value.substring(0, startPos)+ "["+tag+"]" + xxx + "[/"+tag+"]" + Field.value.substring(endPos, Field.value.length); } else { Field.value += "["+tag+"] [/"+tag+"]"; } } } function insertEmo(Field, tag) { //IE support if (document.selection) { Field.focus(); var sel = document.selection.createRange(); sel.text = tag; } //MOZILLA/NETSCAPE support else if (Field.selectionStart || Field.selectionStart == '0') { Field.value += tag; } } function check() { var v2 = document.addcomment.name.value; var v25 = document.addcomment.password.value; var v3 = document.addcomment.comment.value; if (v2.length==0) { alert("سʹ¤Ѻ"); document.addcomment.name.focus(); return false; } else if (v25.length==0) { alert("سʼҹ¤Ѻ"); document.addcomment.password.focus(); return false; } else if (v3.length==0) { alert("س´¤Ѻ"); document.addcomment.comment.focus(); return false; } else return true; } function emoticon(what) { document.addcomment.comment.value = document.addcomment.elements.comment.value+" "+what; document.addcomment.comment.focus(); } function open_windows(theURL,winName,features) { window.open(theURL,winName,features); }