var uagent=navigator.userAgent.toLowerCase(),is_safari=uagent.indexOf("safari")!=-1||navigator.vendor=="Apple Computer, Inc.",is_ie=uagent.indexOf("msie")!=-1&&!is_opera&&!is_safari&&!is_webtv,is_ie4=is_ie&&uagent.indexOf("msie 4.")!=-1,is_moz=navigator.product=="Gecko",is_ns=uagent.indexOf("compatible")==-1&&uagent.indexOf("mozilla")!=-1&&!is_opera&&!is_webtv&&!is_safari,is_ns4=is_ns&&parseInt(navigator.appVersion)==4,is_opera=uagent.indexOf("opera")!=-1,is_kon=uagent.indexOf("konqueror")!=-1,is_webtv=uagent.indexOf("webtv")!=-1,is_win=uagent.indexOf("win")!=-1||uagent.indexOf("16bit")!=-1,is_mac=uagent.indexOf("mac")!=-1||navigator.vendor=="Apple Computer, Inc.",ua_vers=parseInt(navigator.appVersion),b_open=0,i_open=0,u_open=0,s_open=0,quote_open=0,code_open=0,sql_open=0,html_open=0,left_open=0,center_open=0,right_open=0,hide_open=0,color_open=0,spoiler_open=0,ie_range_cache="",bbtags=[],rus_lr2="\u0415-\u0435-\u041e-\u043e-\u0401-\u0401-\u0401-\u0401-\u0416-\u0416-\u0427-\u0427-\u0428-\u0428-\u0429-\u0429-\u042a-\u042c-\u042d-\u042d-\u042e-\u042e-\u042f-\u042f-\u042f-\u042f-\u0451-\u0451-\u0436-\u0447-\u0448-\u0449-\u044d-\u044e-\u044f-\u044f".split("-"),lat_lr2=("/E-/e-/O-/o-\u042bO-\u042bo-\u0419O-\u0419o-\u0417H-\u0417h-\u0426H-\u0426h-\u0421H-\u0421h-\u0428H-\u0428h-\u044a"+String.fromCharCode(35)+"-\u044c"+String.fromCharCode(39)+"-\u0419E-\u0419e-\u0419U-\u0419u-\u0419A-\u0419a-\u042bA-\u042ba-\u044bo-\u0439o-\u0437h-\u0446h-\u0441h-\u0448h-\u0439e-\u0439u-\u0439a-\u044ba").split("-"),rus_lr1="\u0410-\u0411-\u0412-\u0413-\u0414-\u0415-\u0417-\u0418-\u0419-\u041a-\u041b-\u041c-\u041d-\u041e-\u041f-\u0420-\u0421-\u0422-\u0423-\u0424-\u0425-\u0425-\u0426-\u0429-\u042b-\u042f-\u0430-\u0431-\u0432-\u0433-\u0434-\u0435-\u0437-\u0438-\u0439-\u043a-\u043b-\u043c-\u043d-\u043e-\u043f-\u0440-\u0441-\u0442-\u0443-\u0444-\u0445-\u0445-\u0446-\u0449-\u044a-\u044b-\u044c-\u044c-\u044f".split("-"),lat_lr1=("A-B-V-G-D-E-Z-I-J-K-L-M-N-O-P-R-S-T-U-F-H-X-C-W-Y-Q-a-b-v-g-d-e-z-i-j-k-l-m-n-o-p-r-s-t-u-f-h-x-c-w-"+String.fromCharCode(35)+"-y-"+String.fromCharCode(39)+"-"+String.fromCharCode(96)+"-q").split("-");
function tag_url(){var a="",b="";(b=ua_vers>=4&&is_ie&&is_win?document.selection.createRange().text:"My Webpage")||(b="My Webpage");var c=prompt(text_enter_url,"http://");b=prompt(text_enter_url_name,b);c||(a+=" "+error_no_url);b||(a+=" "+error_no_title);a?alert("Error!"+a):doInsert("[url="+c+"]"+b+"[/url]","",false)}
function tag_image(){var a="",b="";(b=ua_vers>=4&&is_ie&&is_win?document.selection.createRange().text:"http://")||(b="http://");(b=prompt(text_enter_url,b))||(a+=" "+error_no_url);a?alert("Error!"+a):doInsert("[img]"+b+"","[/img]",false)}
function tag_email(){var a=prompt(text_enter_email,"");if(a){var b="";(b=ua_vers>=4&&is_ie&&is_win?document.selection.createRange().text:"")||(b="");(b=prompt(email_title,b))||(b=a);doInsert("[email="+a+"]"+b+"[/email]","",false)}else alert(error_no_email)}
function doInsert(a,b,c){var d=eval("fombj."+selField);if(ua_vers>=4&&is_ie&&is_win){if(d.isTextEdit){d.focus();var f=document.selection,e=ie_range_cache?ie_range_cache:f.createRange();if((f.type=="Text"||f.type=="None")&&e!=null){if(b!=""&&e.text.length>0)a+=e.text+b;else if(c)a+=e.text+b;e.text=a}}else d.value+=a+b;e.select();ie_range_cache=null}else if(d.selectionEnd){f=d.selectionStart;c=d.scrollTop;var g=d.selectionEnd;if(g<=2)g=d.textLength;e=d.value.substring(0,f);var h=d.value.substring(f,g);g=d.value.substring(g,d.textLength);h=a+h+b;d.value=e+h+g;a=f+h.length;d.selectionStart=a;d.selectionEnd=a;d.scrollTop=c}else d.value+=a+b;d.focus();return false}function getOffsetTop(a){for(var b=a.offsetTop;(a=a.offsetParent)!=null;)b+=a.offsetTop;return b}function getOffsetLeft(a){for(var b=a.offsetLeft;(a=a.offsetParent)!=null;)b+=a.offsetLeft;return b}





