var rs={
	popup:false,
	popupplayer:true,
	usersicon:false,
	postcontent:false,
	appserverhost:"app.readspeaker.com",
	flashlink:document.location.protocol+"//media.readspeaker.com/flash/readspeaker20.swf",
	allowScriptAccess:null,
	protocol:document.location.protocol||"http:",
	version:"098g-embhl",
	rsent:"rsent",
	wordColor:"#FFF59B",
	sentColor:"#E5E5E5",
	textColor:"#000000",
	defaultspeed:100,
	defaultvalue:"wordsent",
	thesync:"none",
	STATES:[
		"NO_ACTION",
		"USER_SELECTION",
		"PLAYING_USER_SELECTION",
		"PLAYING_NO_SELECTION",
		"USER_SELECTION_WHILE_PLAYING_USER_SELECTION",
		"USER_SELECTION_WHILE_PLAYING_NO_SELECTION",
		"SETTINGS_CHANGED_PLAYING_USER_SELECTION",
		"SETTINGS_CHANGED_PLAYING_NO_SELECTION",
		"CLOSE"
	],
	phrases:{
		closeplayer:"Speler afsluiten",
		fast:"Hoog",
		hide:"Verberg",
		highlightingoptions:"Highlighting optie",
		listentoselectedtext:"Luister naar de geselecteerde tekst",
		medium:"Gemiddeld",
		nohighlighting:"Geen highlighting",
		nosound:"Geen geluid?",
		pause:"Pauze",
		playerwidth:"330",
		play:"Afspelen",
		popupbutton:"Popup-knop",
		sentonly:"Alleen zin",
		settings:"Instellingen",
		show:"Toon",
		slow:"Laag",
		//speechenabled:"Speech-enabled by <a href='http://www.readspeaker.com/nl'>ReadSpeaker</a>",
		speechenabled:"",
		speed:"Snelheid",
		stop:"Stop",
		volume:"Volume",
		wordonly:"Alleen woord",
		wordsent:"Woord en zin"
	},
	state:"NO_ACTION",
	defaultsurvive:360000000,
	bmindex:1,
	sentbmindex:0,
	seltexttimes:0,
	seltextcleanuptimes:0,
	startofsentence:1,
	inc:0,
	start:null,
	stop:null,
	newhtml:"",
	startOffset:null,
	endOffset:null,
	selectedString:"",
	selhtml:"",
	selectedWordsRange:[],
	firstrun:1,
	selectedRange:null,
	mouse_x_startpos:null,
	mouse_y_startpos:null,
	mouse_x_pos:null,
	mouse_y_pos:null,
	popup_x_pos:null,
	popup_y_pos:null,
	viewportwidth:null,
	viewportheight:null,
	rs_time:null,
	globalcount:null,
	listenButtonExists:false,
	oldwordhl_FF:[],
	oldwordhlclass_FF:[],
	oldsenthl_FF:[],
	oldsenthlclass_FF:[],
	oldwordhlrange_IE:[],
	oldwordhlbackcol_IE:[],
	oldwordhlforecol_IE:[],
	oldwordhl_IE:[],
	oldwordhlclass_IE:[],
	oldsenthlrange_IE:[],
	oldsenthlbackcol_IE:[],
	oldsenthlforecol_IE:[],
	oldsenthl_IE:[],
	oldsenthlclass_IE:[],
	exludednodes:[
		"table",
		"tr",
		"select",
		"option",
		"textarea",
		"ul",
		"ol",
		"dl",
		"thead",
		"tbody",
		"tfoot",
		"colgroup",
		"script",
		"map",
		"optgroup"
	],
	data:{
		restorehtml:[],
		readid:[],
		current:{
			restorehtml:null,
			readid:null,
			playerid:null
		},
		previous:{
			playerid:null,
			sync:null
		}
	},
	convertSpeed:function(a){
	
	switch(a){
	
	case"slow":return rs.defaultspeed-25;
		case"medium":return rs.defaultspeed;
		case"fast":return rs.defaultspeed+25;
		default:return rs.defaultspeed}},
			issuePOST:function(a,
			c){
	
	rs.globalcount++;
		if(!document.getElementById("postiframe1")||!document.getElementById("postiframe2")){
	
	var g=null;
		if(document.selection){
	
	g=document.createElement('<iframe name="postiframe'+rs.globalcount+'">')}else{
	
	g=document.createElement("iframe");
		g.name="postiframe"+rs.globalcount}g.setAttribute("id",
			"postiframe"+rs.globalcount);
		g.setAttribute("style", "display: none; position: absolute;");
		g.style.display="none";
		var d=document.getElementsByTagName("body");
		var n=null;
		if(d.length>0){
	
	var n=d.item(0)}if(n){
	
	n.appendChild(g)}else{
	
	return}}a=a+"&output=audiolink";
		var f=document.createElement("form");
		f.target="postiframe"+rs.globalcount;
		f.method="post";
		var m=a.split("?");
		var l=Math.random();
		f.action=rs.protocol+"//"+rs.appserverhost+"/enterprise/iframeproxy.php?rsent="+rs.rsent+"&randid="+l;
		var k=m[1].split("&");
		var h;
		for(h=0;
		h<k.length;
		h++){
	
	var e=k[h].split("=");
		var o=document.createElement("input");
		o.setAttribute("name",
			unescape(e[0]));
		o.setAttribute("value",
			unescape(e[1]));
		f.appendChild(o)}var o=document.createElement("input");
		if(rs.state=="PLAYING_NO_SELECTION"&&rs.postcontent){
	
	o.setAttribute("name",
			"html_base64")}else{
	
	o.setAttribute("name",
			"selectedhtml_base64")}o.setAttribute("value",
			rs.base64Encode(c));
		f.appendChild(o);
		document.body.appendChild(f);
		f.submit();
		document.body.removeChild(f);
		return rs.protocol+"//"+rs.appserverhost+"/enterprise/iframeproxy.php?rsent="+rs.rsent+"&listen=1&randid="+l},
			removeiFrames:function(){
	
	if(document.getElementById("postiframe1")){
	
	document.body.removeChild(document.getElementById("postiframe1"))}if(document.getElementById("postiframe2")){
	
	document.body.removeChild(document.getElementById("postiframe2"))}},
			readpage:function(l,
			c){
	
	rs.globalcount=0;
		rs.getreadids();
		if(rs.rs_time){
	
	clearTimeout(rs.rs_time);
		rs.setIconVisivilty()}if(rs.allowScriptAccess===null){
	
	if(rs.flashlink.indexOf("media.readspeaker.com")==-1){
	
	rs.allowScriptAccess="sameDomain"}else{
	
	rs.allowScriptAccess="always"}}var g=rs.convertSpeed(rs.loadSettings("ReadSpeakerHLspeed"));
		if(rs.state.indexOf("USER_SELECTION")==-1){
	
	rs.data.previous.sync=rs.thesync}rs.thesync=rs.loadSettings("ReadSpeakerHL");
		if(rs.thesync===null||rs.thesync===""){
	
	rs.thesync=rs.defaultvalue}var b=l.match(/readid=[^&]+/gi);
		rs.data.current.readid=b[0].replace("readid=",
			"");
		rs.data.current.playerid=c;
		if(rs.data.previous.playerid!==null){
	
	var h=null;
		h=document.getElementById(rs.data.previous.playerid);
		if(h){
	
	h.innerHTML="";
		h.style.display="none"}}rs.data.previous.playerid=rs.data.current.playerid;
		if(rs.state=="USER_SELECTION"||rs.state=="USER_SELECTION_WHILE_PLAYING_USER_SELECTION"||rs.state=="USER_SELECTION_WHILE_PLAYING_NO_SELECTION"||rs.state=="SETTINGS_CHANGED_PLAYING_USER_SELECTION"){
	
	rs.cleanup();
		if(rs.state!="SETTINGS_CHANGED_PLAYING_USER_SELECTION"){
	
	rs.selhtml=rs.selectRange()}var a=encodeURIComponent(rs.issuePOST(l+"&audioformat=flv&sync=user&speed="+g+"&rsjs_ver="+rs.version+"&syncalignuser="+rs.thesync,
			rs.selhtml));
		var d=rs.issuePOST(l+"&speed="+g+"&rsjs_ver="+rs.version,
			rs.selhtml);
		if(document.selection){
	
	document.execCommand("Unselect")}rs.state="PLAYING_USER_SELECTION"}else{
	
	if(rs.postcontent){
	
	rs.state="PLAYING_NO_SELECTION";
		if(rs.data.previous.sync!="none"||rs.thesync!="none"){
	
	rs.cleanup()}if(rs.data.current.readid!==null){
	
	var e=document.getElementById(rs.data.current.readid);
		if(e!==null){
	
	rs.data.current.restorehtml=e.innerHTML}}var a=encodeURIComponent(rs.issuePOST(l+"&audioformat=flv&sync="+rs.thesync+"&speed="+g+"&rsjs_ver="+rs.version,
			"<div id='"+rs.data.current.readid+"'>"+rs.data.current.restorehtml+"</div>"));
		var d=rs.issuePOST(l+"&speed="+g+"&rsjs_ver="+rs.version,
			"<div id='"+rs.data.current.readid+"'>"+rs.data.current.restorehtml+"</div>")}else{
	
	rs.state="PLAYING_NO_SELECTION";
		if(rs.data.previous.sync!="none"||rs.thesync!="none"){
	
	rs.cleanup()}var a=encodeURIComponent(l+"&audioformat=flv&sync="+rs.thesync+"&speed="+g+"&rsjs_ver="+rs.version);
		var d=l+"&speed="+g+"&rsjs_ver="+rs.version}}if(rs.data.current.playerid=="rs_popup_player"){
	
	var k=rs.createPopupPlayer(l,
			a,
			d)}else{
	
	var k="<div id='rs_playerarea'>";
		k+="<object type='application/x-shockwave-flash' id='readspeakerplayer' data='"+rs.flashlink+"?flv="+a+"&autoplay=1&rskin=bump&time_format=ms&rskin=bump&text_play="+rs.phrases.play+"&text_pause="+rs.phrases.pause+"&text_stop="+rs.phrases.stop+"&text_vol="+rs.phrases.volume+"'>";
		k+="<param name='movie' value='"+rs.flashlink+"?flv="+a+"&autoplay=1&rskin=bump&time_format=ms&rskin=bump&text_play="+rs.phrases.play+"&text_pause="+rs.phrases.pause+"&text_stop="+rs.phrases.stop+"&text_vol="+rs.phrases.volume+"'>";
		k+="<param name='quality' value='high'><param name='autostart' value='true'>";
		k+="<param name='allowScriptAccess' value='"+rs.allowScriptAccess+"'><param name='bgcolor' value='#FFFFFF'>";
		k+="<param name='loop' value='false'></object>";
		k+="<a id='readspeakerclose' href='JavaScript:void(0); ' onclick='rs.closepage(\""+rs.data.current.playerid+"\"); return false'>Sluiten</a></div>";
		k+="<div id='bottomlinks'><a href='JavaScript:void(0); ' class='rs_settings' onclick='rs.showcontrols(\""+l+'", "'+rs.data.current.playerid+"\"); return false'>"+rs.phrases.settings+"</a> | <a id='rsSaveBtn' href='"+d+"' target='rs' onclick='rs.removeiFrames(); return true; '>"+rs.phrases.nosound+"</a> | "+rs.phrases.speechenabled+"</div>";
		k+="<div id='controls'></div>";
		k+="</div>"}var f=document.getElementById(rs.data.current.playerid);
		if(f){
	
	f.innerHTML=k;
		f.style.display="block"}rs.selectedString=""},
			getreadids:function(){
	
	if(rs.data.readid.length===0){
	
	var f=document.getElementsByTagName("A");
		for(var e=0;
		e<f.length;
		e++){
	
	if(f[e].getAttribute("href")&&f[e].getAttribute("href").indexOf(rs.appserverhost+"/cgi-bin/"+rs.rsent)!=-1&&f[e].id!="rsSaveBtn"){
	
	var c=f[e].getAttribute("href").match(/readid=[^&]+/gi);
		if(c){
	
	var a=c[0].replace("readid=",
			"");
		rs.data.readid.push(a)}}}if(rs.data.readid.length>0){
	
	var d=null;
		for(var b=0;
		b<rs.data.readid.length;
		b++){
	
	d=document.getElementById(rs.data.readid[b]);
		if(d){
	
	rs.data.restorehtml.push(d.innerHTML)}}}}},
			closepage:function(b){
	
	var a=document.getElementById(b);
		if(a){
	
	a.innerHTML="";
		a.style.display="none"}rs.state="CLOSE";
		var c=document.getElementById(rs.data.current.readid);
		if(c&&c.className.toLowerCase().indexOf("rs_reload")>-1)
		{
			setTimeout("location.reload(true); ", 500);
		}else{
			setTimeout("rs.cleanup(); rs.data.current.restorehtml=null; ", 500);
		if(document.getElementById("rs_selimg")){
	
	document.body.removeChild(document.getElementById("rs_selimg"))}if(document.getElementById("rs_popup_player")){
	
	document.body.removeChild(document.getElementById("rs_popup_player"))}}},
			rshlexit:function()
			{
				setTimeout("rs.cleanup(); ", 500)
			},
			saveSettings:function(name, content, lifetime){
	
	lifetime=parseInt(eval(lifetime));
		if(lifetime+""=="NaN"){
	
	tmpdate=""}else{
	
	var thedate=new Date();
		thedate.setTime(thedate.getTime()+lifetime);
		thedate=thedate.toGMTString();
		tmpdate="; expires="+thedate}document.cookie=name+"="+escape(content)+tmpdate},
			loadSettings:function(a){
	
	ckarr=document.cookie;
		cks=ckarr.split("; ");
		for(i=0;
		i<cks.length;
		i++){
	
	cknameval=cks[i].split("=");
		for(j=0;
		j<cknameval.length;
		j++){
	
	if(cknameval[j]==a){
	
	return unescape(cknameval[j+1])}}}return""},
			setstyle:function(b){
	
	if(b.indexOf("icon")>-1){
	
	rs.saveSettings("ReadSpeakerHLicon",
			b,
			rs.defaultsurvive)}else{
	
	if(b=="slow"||b=="medium"||b=="fast"){
	
	rs.saveSettings("ReadSpeakerHLspeed",
			b,
			rs.defaultsurvive)}else{
	
	rs.saveSettings("ReadSpeakerHL",
			b,
			rs.defaultsurvive)}}var a=document.getElementById("controls");
		if(a!==null){
	
	a.innerHTML=""}},
			showcontrols:function(b,
			c){
	
	var a=document.getElementById("controls");
		if(a!==null&&a.innerHTML!=""){
	
	a.innerHTML="";
		a.style.display="none";
		return false}var e=rs.loadSettings("ReadSpeakerHL");
		var f=rs.loadSettings("ReadSpeakerHLicon");
		var d=rs.loadSettings("ReadSpeakerHLspeed");
		if(e==""){
	
	e=rs.defaultvalue}if(f==""){
	
	if(rs.popup){
	
	f="iconon"}else{
	
	f="iconoff"}}if(d==""){
	
	d="medium"}thestring="<div id='rspopup'><fieldset class='rs_block'><legend>"+rs.phrases.highlightingoptions+"</legend><ul>";
		thestring+="<li class=";
		if(e=="wordsent"){
	
	thestring+="'rs_active'"}thestring+="><a href='JavaScript:void(0); ' onclick='rs.changeSettings(\""+b+'", "'+c+'", "wordsent"); return false; \'>'+rs.phrases.wordsent+"</a></li>";
		thestring+="<li class=";
		if(e=="sent"){
			thestring+="'rs_active'"}thestring+="><a href='JavaScript:void(0); ' onclick='rs.changeSettings(\""+b+'", "'+c+'", "sent"); return false; \'>'+rs.phrases.sentonly+"</a></li>";
		thestring+="<li class=";
		if(e=="word"){
	
	thestring+="rs_active"}thestring+="><a href='JavaScript:void(0); ' onclick='rs.changeSettings(\""+b+'", "'+c+'", "word"); return false; \'>'+rs.phrases.wordonly+"</a></li>";
		thestring+="<li class=";
		if(e=="none"){
	
	thestring+="rs_active"}thestring+="><a href='JavaScript:void(0); ' onclick='rs.changeSettings(\""+b+'", "'+c+'", "none"); return false; \'>'+rs.phrases.nohighlighting+"</a></li>";
		thestring+="</ul></fieldset><fieldset class='rs_block'><legend>"+rs.phrases.popupbutton+"</legend><ul>";
		thestring+="<li class=";
		if(f=="iconon"){
	
	thestring+="rs_active "}thestring+="><a href='JavaScript:void(0); ' onclick='rs.popup=true; rs.changeSettings(\""+b+'", "'+c+'", "iconon"); return false; \'>'+rs.phrases.show+"</a></li>";
		thestring+="<li class=";
		if(f=="iconoff"){
	
	thestring+="rs_active "}thestring+="><a href='JavaScript:void(0); ' onclick='rs.popup=false; rs.changeSettings(\""+b+'", "'+c+'", "iconoff"); return false; \'>'+rs.phrases.hide+"</a></li>";
		thestring+="</ul></fieldset><fieldset class='rs_block'><legend>"+rs.phrases.speed+"</legend><ul>";
		thestring+="<li class=";
		if(d=="slow"){
	
	thestring+="rs_active "}thestring+="><a href='JavaScript:void(0); ' onclick='rs.changeSettings(\""+b+'", "'+c+'", "slow"); return false; \'>'+rs.phrases.slow+"</a></li>";
		thestring+="<li class=";
		if(d=="medium"){
	
	thestring+="rs_active "}thestring+="><a href='JavaScript:void(0); ' onclick='rs.changeSettings(\""+b+'", "'+c+'", "medium"); return false; \'>'+rs.phrases.medium+"</a></li>";
		thestring+="<li class=";
		if(d=="fast"){
	
	thestring+="rs_active "}thestring+="><a href='JavaScript:void(0); ' onclick='rs.changeSettings(\""+b+'", "'+c+'", "fast"); return false; \'>'+rs.phrases.fast+"</a></li>";
		thestring+="</ul></fieldset></div><div style='clear: both; '></div>"; 
		var a=document.getElementById("controls");
		if(a!==null){
	
	a.style.display="block";
		a.innerHTML=thestring}},
			changeSettings:function(a,
			b,
			c){
	
	if(rs.state=="PLAYING_NO_SELECTION"){
	
	rs.state="SETTINGS_CHANGED_PLAYING_NO_SELECTION"}else{
	
	rs.state="SETTINGS_CHANGED_PLAYING_USER_SELECTION"}rs.setstyle(c);
		rs.readpage(a,
			b)},
			copyselected:function(a){
	
	rs.getMouseXYrel(a);
		setTimeout("rs.getSelectedHTML()",
			50);
		return true},
			createPopupButton:function(){
	
	if(rs.mouse_x_pos&&rs.mouse_y_pos&&rs.selectedString.length>0){
	
	if(!document.getElementById("rs_selimg")){
	
	var h=null;
		var o=document.getElementsByTagName("A");
		var b=[];
		for(var f=0;
		f<o.length;
		f++){
	
	b[f]=o[f]}for(var e=0;
		e<b.length;
		e++){
	
	if(b[e].getAttribute("href")&&b[e].getAttribute("href").indexOf(rs.appserverhost+"/cgi-bin/"+rs.rsent)!=-1&&b[e].id!="rsSaveBtn"){
	
	rs.listenButtonExists=true;
		if(!rs.usersicon&&b[e].getElementsByTagName("img").length>0){
	
	h=b[e].getElementsByTagName("img")[0].src}for(var g=0;
		g<b[e].attributes.length;
		g++){
	
	if(b[e].attributes[g].nodeName.toLowerCase()=="href"){
	
	var a=b[e].attributes[g].nodeValue}else{
	
	if(b[e].attributes[g].nodeName.toLowerCase()=="onclick"){
	
	var n=b[e].attributes[g].nodeValue}}}break}}if(rs.listenButtonExists){
	
	var l=document.createElement("img");
		if(rs.usersicon||!h){
	
	h=rs.protocol+"//media.readspeaker.com/images/buttons/listen_icons/icon_16px.gif"}l.setAttribute("src",
			h);
		l.style.border="none";
		l.setAttribute("alt",
			rs.phrases.listentoselectedtext);
		l.setAttribute("title",
			rs.phrases.listentoselectedtext);
		var m=document.createElement("a");
		m.setAttribute("id",
			"rs_selimg");
		m.setAttribute("href",
			a);
		if(rs.popupplayer){
	
	n="readpage(this.href, 'rs_popup_player');  return false; "}if(n==""){
	
	n="readpage(this.href, 'xp1'); return false; "}m.setAttribute("onclick", "clearTimeout(rs.rs_time); rs.setIconVisivilty(); "+n);
		m.setAttribute("onmouseover", "clearTimeout(rs.rs_time); ");
		m.setAttribute("onmouseout", "rs.hideRSIcon(); ");
		m.onclick=new Function("clearTimeout(rs.rs_time); rs.setIconVisivilty(); "+n);
		m.onmouseover=new Function("clearTimeout(rs.rs_time); ");
		m.onmouseout=new Function("rs.hideRSIcon(); ");
		m.appendChild(l); 
		var c=document.createDocumentFragment();
		c.appendChild(m);
		document.body.appendChild(c)}}if(rs.listenButtonExists){
	
	var p=document.getElementById("rs_selimg");
		p.style.top=rs.mouse_y_pos+"px";
		p.style.left=rs.mouse_x_pos+"px";
		rs.popup_y_pos=rs.mouse_y_pos+"px";
		rs.popup_x_pos=rs.mouse_x_pos+"px";
		var d=rs.loadSettings("ReadSpeakerHLicon");
		if(d==""){
	
	if(rs.popup){
	
	d="iconon"}else{
	
	d="iconoff"}}if(d=="iconoff"){
	
	p.style.display="none"}else{
	
	p.style.display="block"}rs.hideRSIcon()}}},
			createPopupPlayer:function(a,
			e,
			c){
	
	var d=document.getElementById(rs.data.current.playerid);
		if(!d){
	
	var g=document.createElement("div");
		g.setAttribute("id",
			"rs_popup_player");
		var b=document.createDocumentFragment();
		b.appendChild(g);
		document.body.appendChild(b);
		d=document.getElementById(rs.data.current.playerid)}d.style.top=rs.popup_y_pos;
		d.style.left=rs.popup_x_pos;
		var f="<div><span><object type='application/x-shockwave-flash' data='"+rs.flashlink+"?flv="+e+"&autoplay=1&rskin=bump&rplayer=mini&text_play="+rs.phrases.play+"&text_pause="+rs.phrases.pause+"&text_stop="+rs.phrases.stop+"&text_vol="+rs.phrases.volume+"' style='height:20px; width:60px;'>";
		f+="<param name='movie' value='"+rs.flashlink+"?flv="+e+"&autoplay=1&rskin=bump&rplayer=mini&text_play="+rs.phrases.listen+"&text_pause="+rs.phrases.pause+"&text_stop="+rs.phrases.stop+"&text_vol="+rs.phrases.volume+"'>";
		f+="<param name='quality' value='high'><param name='autostart' value='true'>";
		f+="<param name='allowScriptAccess' value='"+rs.allowScriptAccess+"'><param name='bgcolor' value='#FFFFFF'>";
		f+="<param name='loop' value='false'><a id='rsSaveBtn' href='"+c+"' target='rs'>"+rs.phrases.nosound+"</a></object></span>";
		f+="<span style='position: absolute; top: 4px; right: 4px; '><a href='JavaScript:void(0); ' onclick='rs.closepage(\""+rs.data.current.playerid+"\"); return false'><img style='border-style: none !important; margin: 0px !important; ' src='"+rs.protocol+"//media.readspeaker.com/images/enterprise/default/close.png' title='"+rs.phrases.closeplayer+"' alt='"+rs.phrases.closeplayer+"'></a></span></div>";
		f+="<span id='rs_popup_link' style='position: absolute; top: 4px; right: 21px; '><a href='JavaScript:void(0); ' onclick='rs.showcontrols(\""+a+'", "'+rs.data.current.playerid+"\"); return false'><img style='width: 13px; height: 13px; border-style: none !important; ' src='"+rs.protocol+"//media.readspeaker.com/images/enterprise/default/wrench.png' alt='"+rs.phrases.settings+"' title='"+rs.phrases.settings+"'></a></span>";
		f+="<div id='controls'></div>";
		return f},
			hideRSIcon:function(){
	
	if(rs.rs_time){
	
	clearTimeout(rs.rs_time)}rs.rs_time=setTimeout("rs.setIconVisivilty()",
			2500)},
			setIconVisivilty:function(){
	
	if(document.getElementById("rs_selimg")){
	
	document.getElementById("rs_selimg").style.display="none"}},
			getMouseXYpress:function(a){
	
	if(!a){
	
	var a=window.event}a.cancelBubble=true;
		if(a.stopPropagation){
	
	a.stopPropagation()}if(a.pageX||a.pageY){
	
	rs.mouse_y_startpos=a.pageY}else{
	
	if(a.clientX||a.clientY){
	
	rs.mouse_y_startpos=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return true},
			getMouseXYrel:function(a){
	
	if(!a){
	
	var a=window.event}a.cancelBubble=true;
		if(a.stopPropagation){
	
	a.stopPropagation()}var b=null;
		var c=null;
		rs.getViewportSize();
		if(a.pageX||a.pageY){
	
	b=a.pageY;
		c=a.pageX}else{
	
	if(a.clientX||a.clientY){
	
	b=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;
		c=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft}}if(b>rs.mouse_y_startpos){
	
	if((b+20)>(rs.viewportheight-30)){
	
	rs.mouse_y_pos=b-40}else{
	
	rs.mouse_y_pos=b+20}}else{
	
	if((b-40)<10){
	
	rs.mouse_y_pos=b+20}else{
	
	rs.mouse_y_pos=b-40}}if(c<5){
	
	rs.mouse_x_pos=c+30}else{
	
	if(c>rs.viewportwidth-80){
	
	rs.mouse_x_pos=c-80}else{
	
	rs.mouse_x_pos=c+15}}return true},
			getViewportSize:function(){
	
	if(typeof window.innerWidth!="undefined"){
	
	rs.viewportwidth=window.innerWidth+document.body.scrollLeft+document.documentElement.scrollLeft;
		rs.viewportheight=window.innerHeight+document.body.scrollTop+document.documentElement.scrollTop}else{
	
	if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){
	
	rs.viewportwidth=document.documentElement.clientWidth+document.body.scrollLeft+document.documentElement.scrollLeft;
		rs.viewportheight=document.documentElement.clientHeight+document.body.scrollTop+document.documentElement.scrollTop}else{
	
	rs.viewportwidth=document.getElementsByTagName("body")[0].clientWidth+document.body.scrollLeft+document.documentElement.scrollLeft;
		rs.viewportheight=document.getElementsByTagName("body")[0].clientHeight+document.body.scrollTop+document.documentElement.scrollTop}}},
			getSelectedHTML:function(){
	
	rs.selectedString="";
		var b=undefined;
		var a=undefined;
		if(window.getSelection){
	
	a=window.getSelection();
		if(!a.isCollapsed){
	
	if(a.getRangeAt){
	
	b=a.getRangeAt(0)}else{
	
	b=document.createRange();
		b.setStart(a.anchorNode,
			a.anchorOffset);
		b.setEnd(a.focusNode,
			a.focusOffset)}if(b){
	
	DOM=b.cloneContents();
		object=document.createElement("div");
		object.appendChild(DOM.cloneNode(true));
		rs.selectedString=object.innerHTML}else{
	
	rs.selectedString=a}}}else{
	
	if(document.selection){
	
	a=document.selection;
		b=a.createRange();
		if(b&&b.htmlText){
	
	rs.selectedString=b.htmlText}else{
	
	if(b&&b.text){
	
	rs.selectedString=b.text}}}else{
	
	if(document.getSelection){
	
	rs.selectedString=document.getSelection()}}}rs.createPopupButton();
		if(rs.selectedString.length>0&&rs.state=="NO_ACTION"){
	
	rs.state="USER_SELECTION"}else{
	
	if(rs.selectedString.length>0&&rs.state=="PLAYING_USER_SELECTION"){
	
	rs.state="USER_SELECTION_WHILE_PLAYING_USER_SELECTION"}else{
	
	if(rs.selectedString.length>0&&rs.state=="PLAYING_NO_SELECTION"){
	
	rs.state="USER_SELECTION_WHILE_PLAYING_NO_SELECTION"}}}},
			cleanup:function(){
	
	if(document.selection){
	
	if(rs.state=="USER_SELECTION"||rs.state=="USER_SELECTION_WHILE_PLAYING_USER_SELECTION"||rs.state=="USER_SELECTION_WHILE_PLAYING_NO_SELECTION"){
	
	if(rs.oldwordhl_IE.length>0){
	
	for(var c=0;
		c<rs.oldwordhl_IE.length;
		c++){
	
	rs.oldwordhl_IE[c].className=rs.oldwordhlclass_IE[c]}rs.oldwordhlclass_IE=[];
		rs.oldwordhl_IE=[]}if(rs.oldsenthl_IE.length>0){
	
	for(var c=0;
		c<rs.oldsenthl_IE.length;
		c++){
	
	rs.oldsenthl_IE[c].className=rs.oldsenthlclass_IE[c]}rs.oldsenthl_IE=[];
		rs.oldsenthlclass_IE=[]}}if(rs.oldwordhlrange_IE.length>0){
	
	for(var c=0;
		c<rs.oldwordhlrange_IE.length;
		c++){
	
	if(rs.oldwordhlbackcol_IE[c]&&rs.oldwordhlforecol_IE){
	
	rs.oldwordhlrange_IE[c].execCommand("backcolor",
			0,
			rs.oldwordhlbackcol_IE[c]);
		if(rs.oldwordhlforecol_IE[c]!==null){
	
	rs.oldwordhlrange_IE[c].execCommand("forecolor",
			0,
			rs.oldwordhlforecol_IE[c])}}}rs.oldwordhlrange_IE=[];
		rs.oldwordhlbackcol_IE=[];
		rs.oldwordhlforecol_IE=[]}if(rs.oldsenthlrange_IE.length>0){
	
	for(var c=0;
		c<rs.oldsenthlrange_IE.length;
		c++){
	
	if(rs.oldsenthlbackcol_IE[c]&&rs.oldsenthlforecol_IE){
	
	rs.oldsenthlrange_IE[c].execCommand("backcolor",
			0,
			rs.oldsenthlbackcol_IE[c]);
		if(rs.oldsenthlforecol_IE[c]!==null){
	
	rs.oldsenthlrange_IE[c].execCommand("forecolor",
			0,
			rs.oldsenthlforecol_IE[c])}}}rs.oldsenthlrange_IE=[];
		rs.oldsenthlbackcol_IE=[];
		rs.oldsenthlforecol_IE=[]}if(rs.state!="SETTINGS_CHANGED_PLAYING_USER_SELECTION"&&rs.state!="PLAYING_USER_SELECTION"){
	
	rs.selectedWordsRange=[]}}else{
	
	if(rs.state=="USER_SELECTION"||rs.state=="USER_SELECTION_WHILE_PLAYING_USER_SELECTION"||rs.state=="USER_SELECTION_WHILE_PLAYING_NO_SELECTION"){
	
	var d=document.getElementsByTagName("RS:SPAN");
		for(c=d.length-1;
		c>-1;
		c--){
	
	d[c].className=d[c].className.replace("sync_sent_highlighted",
			"");
		d[c].className=d[c].className.replace("sync_word_highlighted",
			"")}var d=document.getElementsByTagName("RSI:SPAN");
		for(c=d.length-1;
		c>-1;
		c--){
	
	d[c].className=d[c].className.replace("sync_sent_highlighted",
			"");
		d[c].className=d[c].className.replace("sync_word_highlighted",
			"")}}if(rs.state=="PLAYING_USER_SELECTION"||rs.state=="SETTINGS_CHANGED_PLAYING_USER_SELECTION"){
	
	if(rs.oldwordhl_FF.length>0){
	
	for(var c=0;
		c<rs.oldwordhl_FF.length;
		c++){
	
	rs.oldwordhl_FF[c].className=rs.oldwordhlclass_FF[c]}rs.oldwordhlclass_FF=[];
		rs.oldwordhl_FF=[]}if(rs.oldsenthl_FF.length>0){
	
	for(var c=0;
		c<rs.oldsenthl_FF.length;
		c++){
	
	rs.oldsenthl_FF[c].className=rs.oldsenthlclass_FF[c]}rs.oldsenthl_FF=[];
		rs.oldsenthlclass_FF=[]}}if(rs.state=="CLOSE"||rs.state=="PLAYING_NO_SELECTION"){
	
	rs.cleanUpSpans()}}if(rs.state=="CLOSE"||rs.state=="PLAYING_NO_SELECTION"&&rs.data.restorehtml!=null&&rs.data.readid!=null){
	
	var b=null;
		for(var a=0;
		a<rs.data.readid.length;
		a++){
	
	b=document.getElementById(rs.data.readid[a]);
		if(b&&rs.data.restorehtml[a]!==null){
	
	b.innerHTML=rs.data.restorehtml[a]}}}if(rs.state=="CLOSE"){
	
	rs.state="NO_ACTION";
		rs.data.restorehtml=[];
		rs.data.readid=[]}},
			rshlsetContent:function(a){
	
	rs.newhtml+=a},
			rshlsetId:function(a){
	
	rs.data.current.readid=a},
			rshlinit:function(){
	
	if(rs.state=="PLAYING_USER_SELECTION"||rs.state=="USER_SELECTION_WHILE_PLAYING_USER_SELECTION"){
	
	rs.firstrun=1;
		if(document.selection){
	
	document.selection.empty()}else{
	
	rs.identifyElementsReplacementNode(document.body)}rs.newhtml=""}else{
	
	if(rs.thesync!="none"){
	
	var a=null;
		if(rs.data.current.readid!==null){
	
	a=document.getElementById(rs.data.current.readid)}if(a!==null){
	
	a.innerHTML=rs.newhtml;
		rs.newhtml=""}}else{
	
	rs.newhtml=""}}rs.removeiFrames()},
			rshlsync:function(d,
			f){
	
	var a=false;
		if((d&2)==0){
	
	if((d&1)!=0){
	
	a=true}else{
	
	a=false}}if(rs.state=="PLAYING_USER_SELECTION"||rs.state=="USER_SELECTION_WHILE_PLAYING_USER_SELECTION"){
	
	if(document.selection){
	
	var e;
		e=rs.selectedWordsRange[f];
		if(rs.firstrun==1){
	
	rs.firstrun=0;
		if(rs.oldsenthlrange_IE&&rs.oldsenthlrange_IE.length>0){
	
	for(var c=0;
		c<rs.oldsenthlrange_IE.length;
		c++){
	
	if(rs.oldsenthlbackcol_IE[c]&&rs.oldsenthlforecol_IE){
	
	rs.oldsenthlrange_IE[c].execCommand("backcolor",
			0,
			rs.oldsenthlbackcol_IE[c]);
		if(rs.oldsenthlforecol_IE[c]!==null){
	
	rs.oldsenthlrange_IE[c].execCommand("forecolor",
			0,
			rs.oldsenthlforecol_IE[c])}}}rs.oldsenthlrange_IE=[];
		rs.oldsenthlbackcol_IE=[];
		rs.oldsenthlforecol_IE=[]}if(rs.selectedWordsRange&&rs.selectedWordsRange.length>0&&rs.thesync=="wordsent"){
	
	for(var c=0;
		c<rs.selectedWordsRange.length;
		c++){
	
	if(rs.selectedWordsRange[c]){
	
	rs.oldsenthlrange_IE.push(rs.selectedWordsRange[c]);
		rs.oldsenthlbackcol_IE.push(rs.selectedWordsRange[c].queryCommandValue("backcolor"));
		rs.oldsenthlforecol_IE.push(rs.selectedWordsRange[c].queryCommandValue("forecolor"));
		if(rs.selectedWordsRange[c].text!=""){
	
	rs.selectedWordsRange[c].execCommand("backcolor",
			0,
			rs.sentColor);
		rs.selectedWordsRange[c].execCommand("forecolor",
			0,
			rs.textColor)}}}}}if(rs.thesync=="wordsent"||rs.thesync=="sent"||rs.thesync=="word"||rs.thesync==""){
	
	if(!a&&rs.oldwordhlrange_IE.length>0){
	
	for(var c=0;
		c<rs.oldwordhlrange_IE.length;
		c++){
	
	if(rs.thesync=="word"||rs.thesync=="sent"){
	
	rs.oldwordhlrange_IE[c].execCommand("backcolor",
			0,
			rs.oldwordhlbackcol_IE[c])}else{
	
	rs.oldwordhlrange_IE[c].execCommand("backcolor",
			0,
			rs.sentColor)}rs.oldwordhlrange_IE[c].execCommand("forecolor",
			0,
			rs.oldwordhlforecol_IE[c])}rs.oldwordhlrange_IE=[];
		rs.oldwordhlbackcol_IE=[];
		rs.oldwordhlforecol_IE=[]}rs.oldwordhlbackcol_IE.push(e.queryCommandValue("backcolor"));
		rs.oldwordhlforecol_IE.push(e.queryCommandValue("forecolor"));
		rs.oldwordhlrange_IE.push(e);
		if(rs.thesync=="sent"){
	
	e.execCommand("backcolor",
			0,
			rs.sentColor)}else{
	
	e.execCommand("backcolor",
			0,
			rs.wordColor)}e.execCommand("forecolor",
			0,
			rs.textColor)}}else{
	
	var e;
		e=rs.selectedWordsRange["sync"+(f)];
		if(e.className.replace("word",
			"")!=e.className){
	
	if(rs.oldwordhl_FF&&rs.oldwordhl_FF.length>0&&rs.oldwordhlclass_FF&&rs.oldwordhlclass_FF.length>0&&!a){
	
	for(var c=0;
		c<rs.oldwordhl_FF.length;
		c++){
	
	rs.oldwordhl_FF[c].className=rs.oldwordhlclass_FF[c]}rs.oldwordhlclass_FF=[];
		rs.oldwordhl_FF=[]}if(rs.thesync=="wordsent"||rs.thesync=="sent"||rs.thesync=="word"||rs.thesync==""){
	
	rs.oldwordhlclass_FF.push(e.className);
		rs.oldwordhl_FF.push(e);
		if(rs.thesync=="sent"){
	
	e.className="sync_sent_highlighted"}else{
	
	e.className="sync_word_highlighted"}}}if(rs.firstrun==1){
	
	rs.firstrun=0;
		if(rs.oldsenthl_FF.length>0){
	
	for(var c=0;
		c<rs.oldsenthl_FF.length;
		c++){
	
	rs.oldsenthl_FF[c].className=rs.oldsenthlclass_FF[c]}rs.oldsenthl_FF=[];
		rs.oldsenthlclass_FF=[]}if(rs.thesync!="none"&&rs.thesync!="word"&&rs.thesync!="sent"){
	
	var b=rs.returnClassArraySubstring("ffsent"+rs.seltexttimes+" ");
		for(var c=0;
		c<b.length;
		c++){
	
	rs.oldsenthl_FF[c]=b[c];
		rs.oldsenthlclass_FF[c]=rs.oldsenthl_FF[c].className;
		b[c].className="sync_sent_highlighted"}}}}}else{
	
	if(document.selection){
	
	var e;
		e=document.getElementById("sync"+(f));
		if(e&&e.className.replace("word",
			"")!=e.className){
	
	if(!a&&rs.oldwordhl_IE.length>0){
	
	for(var c=0;
		c<rs.oldwordhl_IE.length;
		c++){
	
	rs.oldwordhl_IE[c].className=rs.oldwordhlclass_IE[c]}rs.oldwordhl_IE=[];
		rs.oldwordhlclass_IE=[]}rs.oldwordhlclass_IE.push(e.className);
		rs.oldwordhl_IE.push(e);
		e.className="sync_word_highlighted"}else{
	
	if(e&&e.className.replace("sent",
			"")!=e.className){
	
	if(!a&&rs.oldsenthl_IE.length>0){
	
	for(var c=0;
		c<rs.oldsenthl_IE.length;
		c++){
	
	rs.oldsenthl_IE[c].className=rs.oldsenthlclass_IE[c]}rs.oldsenthl_IE=[];
		rs.oldsenthlclass_IE=[]}rs.oldsenthlclass_IE.push(e.className);
		rs.oldsenthl_IE.push(e);
		e.className="sync_sent_highlighted"}}}else{
	
	var e;
		e=document.getElementById("sync"+(f));
		if(e&&e.className.replace("word",
			"")!=e.className){
	
	if(!a&&rs.oldwordhl_FF.length>0){
	
	for(var c=0;
		c<rs.oldwordhl_FF.length;
		c++){
	
	rs.oldwordhl_FF[c].className=rs.oldwordhlclass_FF[c]}rs.oldwordhl_FF=[];
		rs.oldwordhlclass_FF=[]}rs.oldwordhlclass_FF.push(e.className);
		rs.oldwordhl_FF.push(e);
		e.className="sync_word_highlighted"}else{
	
	if(e&&e.className.replace("sent",
			"")!=e.className){
	
	if(!a&&rs.oldsenthl_FF.length>0){
	
	for(var c=0;
		c<rs.oldsenthl_FF.length;
		c++){
	
	rs.oldsenthl_FF[c].className=rs.oldsenthlclass_FF[c]}rs.oldsenthl_FF=[];
		rs.oldsenthlclass_FF=[]}rs.oldsenthlclass_FF.push(e.className);
		rs.oldsenthl_FF.push(e);
		e.className="sync_sent_highlighted"}}}}},
			base64Char:function(a){
	
	if(a<26){
	
	return String.fromCharCode(a+"A".charCodeAt(0))}else{
	
	if(a<52){
	
	return String.fromCharCode(a+"a".charCodeAt(0)-26)}else{
	
	if(a<62){
	
	return String.fromCharCode(a+"0".charCodeAt(0)-52)}else{
	
	if(a==62){
	
	return"+"}else{
	
	if(a==63){
	
	return"/"}else{
	
	return String.fromCharCode(0)}}}}}},
			base64Encode:function(f){
	
	newdata=encodeURIComponent(f);
		var g=0;
		var e=0;
		var b=[];
		for(;
		g<newdata.length;
		g++){
	
	if(newdata.charCodeAt(g)!="%".charCodeAt(0)){
	
	b[e]=newdata.charCodeAt(g)}else{
	
	b[e]=parseInt("0x"+newdata.charAt(g+1)+""+newdata.charAt(g+2));
		g=g+2}e++}var l=b.length;
		var c=4*parseInt((l+2)/3);
		var h=new String();
		var k=parseInt(l/3);
		var a;
		var d=l-3*k;
		g=0;
		for(;
		g<3*k;
		g+=3){
	
	a=rs.base64Char(b[g]>>2);
		h+=a;
		a=rs.base64Char(((b[g]&3)<<4)|(b[g+1]>>4));
		h+=a;
		a=rs.base64Char(((b[g+1]&15)<<2)|(b[g+2]>>6));
		h+=a;
		a=rs.base64Char(b[g+2]&63);
		h+=a}if(d==1){
	
	h+=rs.base64Char(b[g]>>2);
		h+=rs.base64Char((b[g]&3)<<4);
		h+="=";
		h+="="}if(d==2){
	
	h+=rs.base64Char(b[g]>>2);
		h+=rs.base64Char(((b[g]&3)<<4)|(b[g+1]>>4));
		h+=rs.base64Char((b[g+1]&15)<<2);
		h+="="}return h},
			selectRange:function(){
	
	rs.seltexttimes++;
		if(document.selection){
	
	rs.selectedRange=document.selection.createRange().duplicate();
		return rs.selectRangeIE(rs.selectedRange,
			-1)}else{
	
	var a="";
		var b=window.getSelection().getRangeAt(0);
		rs.start=b.startContainer;
		rs.stop=b.endContainer;
		rs.startOffset=rs.modifyOffsetStartOfWord(rs.start,
			b.startOffset);
		rs.endOffset=rs.modifyOffsetEndOfWord(rs.stop,
			b.endOffset);
		rs.bmindex++;
		rs.sentbmindex=rs.bmindex;
		rs.bmindex++;
		rs.startofsentence=1;
		a=rs.rangeMarkupGecko(b.commonAncestorContainer);
		window.getSelection().removeAllRanges();
		return(a)}},
			selectRangeIE:function(m){
	
	var o=m.duplicate();
		m.moveStart("word",
			-1);
		m.moveStart("word",
			1);
		if(!o.isEqual(m)){
	
	m.moveStart("word",
			-1)}o=m.duplicate();
		m.moveEnd("word",
			1);
		m.moveEnd("word",
			-1);
		if(!o.isEqual(m)){
	
	m.moveEnd("word",
			1)}var l=m.duplicate();
		var p=0;
		var s="";
		var v=1;
		var k=m.parentElement();
		var t=0;
		l.collapse();
		var a=l.duplicate();
		a.collapse(false);
		var g=0;
		while(m.inRange(l)&&m.compareEndPoints("EndToEnd",
			l)!=0){
	
	g++;
		p++;
		if(p>10000){
	
	break}l.collapse(false);
		l.expand("word",
			1);
		var h="";
		var b="";
		var r=l.duplicate();
		r.collapse(false);
		a.collapse(false);
		if(a.compareEndPoints("StartToStart",
			r)==0&&a.compareEndPoints("EndToEnd",
			r)==0&&r.htmlText==a.htmlText){
	
	t++;
		if(t<2){
	
	l.move("character",
			1)}else{
	
	if(t<4){
	
	l.move("character",
			2)}else{
	
	if(t<6){
	
	l.move("word",
			1)}else{
	
	if(t<8){
	
	l.move("word",
			2)}else{
	
	if(t<10){
	
	l.move("sentence",
			1)}else{
	
	if(t<12){
	
	l.move("sentence",
			2)}else{
	
	break}}}}}}l.collapse(false)}else{
	
	t=0;
		if(g==-1){
	
	return l}rs.selectedWordsRange[g]=l.duplicate();
		var q=l.text;
		var f=l.htmlText;
		l.collapse(false);
		var e;
		if(v){
	
	lastPos=l.duplicate();
		e=rs.iterateParentTree(lastPos.parentElement(),
			document.body,
			k,
			0)}else{
	
	e=rs.iterateParentTree(l.parentElement(),
			lastPos.parentElement(),
			k,
			0)}var c=rs.iterateParentTree(lastPos.parentElement(),
			l.parentElement(),
			k,
			0);
		var u=l.parentElement();
		for(var n=0;
		n<e&&n<20;
		n++){
	
	if(!u.className.match("sync_")){
	
	h=u.outerHTML.match("<[^>]*>")[0]+h}u=u.parentElement}var u=lastPos.parentElement();
		for(var n=0;
		n<c&&n<20;
		n++){
	
	if(!u.className.match("sync_")){
	
	b+="</"+u.tagName+">"}u=u.parentElement}if(e!=0||c!=0){
	
	lastPos=l.duplicate()}if(v){
	
	s+=h;
		v=0}else{
	
	s+=b+h}if(f.replace("sync_sent_highlighted",
			"")!=""){
	
	s+="<rs:span class='sync_user' id='sync"+g+"'>"+q+"</rs:span>"}a=l.duplicate()}}s+="<!-- f -->";
		var c=rs.iterateParentTree(lastPos.parentElement(),
			document.body,
			k,
			0);
		var u=lastPos.parentElement();
		for(var n=0;
		n<c;
		n++){
	
	if(!u.className.match("sync_")){
	
	s+="</"+u.tagName+">"}u=u.parentElement}l.collapse();
		return(s)},
			iterateParentTree:function(b,
			d,
			f,
			a){
	
	var e=d;
		while(e!==null){
	
	if(b==f){
	
	return a}else{
	
	if(b==e){
	
	return a}}e=e.parentElement}a++;
		return rs.iterateParentTree(b.parentElement,
			d,
			f,
			a)},
			rangeMarkupGecko:function(d){
	
	rs.firstrun=1;
		var f="";
		var c=rs.inc;
		if(d.nodeType==3){
	
	f+=rs.markup(d)}else{
	
	var b;
		var a="";
		if(d.hasChildNodes()){
	
	for(b=0;
		b<d.childNodes.length;
		b++){
	
	var g=d.childNodes.item(b);
		if(g==rs.start){
	
	rs.inc=1}if(d==rs.start&&b==rs.startOffset){
	
	rs.inc=1}if(g.nodeType!=8){
	
	a+=rs.rangeMarkupGecko(g)}if(d==rs.stop&&b==rs.endOffset){
	
	rs.inc=0;
		break}if(g==rs.stop){
	
	rs.inc=0;
		break}}}if((c||rs.inc)&&(!d.className||(d.className.replace("sync")==d.className&&d.id.replace("sync")==d.id))){
	
	var e=document.createElement("div");
		e.appendChild(d.cloneNode(true));
		tempdivtag=e.innerHTML.match("<[^>]*>");
		if(tempdivtag!==null&&tempdivtag.length>0){
	
	f+=tempdivtag[0];
		f+=a;
		f+="</"+d.nodeName+">"}else{
	
	f+=a}}else{
	
	f+=a}if(d.hasChildNodes()){
	
	for(b=0;
		b<d.childNodes.length;
		b++){
	
	if(d==rs.stop&&b==rs.endOffset){
	
	rs.inc=0;
		break}if(g==rs.stop){
	
	rs.inc=0;
		break}}}}return f.replace(/rsi:span/g,
			"rs:span")},
			markup:function(e){
	
	var b=true;
		var g="";
		var c;
		var f="";
		var h="";
		var a=e.nodeValue;
		if((e==rs.start&&rs.startOffset!=-1)&&(e==rs.stop&&rs.endOffset!=-1)){
	
	f=e.nodeValue.substring(0,
			rs.startOffset);
		a=e.nodeValue.substring(rs.startOffset,
			rs.endOffset);
		h=e.nodeValue.substring(rs.endOffset);
		rs.inc=1}else{
	
	if(e==rs.start&&rs.startOffset!=-1){
	
	f=e.nodeValue.substring(0,
			rs.startOffset);
		a=e.nodeValue.substring(rs.startOffset);
		rs.inc=1}else{
	
	if(e==rs.stop&&rs.endOffset!=-1){
	
	a=e.nodeValue.substring(0,
			rs.endOffset);
		h=e.nodeValue.substring(rs.endOffset);
		rs.inc=1}}}if(!rs.inc){
	
	return""}for(var c=0;
		c<rs.exludednodes.length;
		c++){
	
	if(e.parentNode&&e.parentNode.nodeName.toLowerCase()==rs.exludednodes[c]){
	
	b=false;
		g=rs.htmlencode(a);
		break}}if(b){
	
	g=rs.markupSentences(rs.htmlencode(a),
			null)}if(e==rs.stop&&rs.endOffset!=-1){
	
	rs.inc=0}if(b&&e.parentNode!==null&&a!=""){
	
	var d=rs.createreplacementnode(f+g+h,
			getComputedStyle(e.parentNode,
			null));
		e.parentNode.insertBefore(d,
			e);
		e.parentNode.removeChild(e)}return g},
			markupSentences:function(c){
	
	var a=rs.splitString(c,
			new Array(", ", ". ", "! ", "? ", decodeURIComponent("%e3%80%81"), decodeURIComponent("%e3%80%82")));
		if(!a){
	
	return""}var d="";
		var e=[];
		for(var b=0;
		b<a.length;
		b++){
	
	d+="<rsi:span class=' ffsent"+rs.seltexttimes+" cj"+rs.seltexttimes+"' ";
		d+="id='sync"+(rs.sentbmindex)+"'";
		rs.startofsentence=0;
		d+=">";
		d+=rs.markupWords(a[b]);
		d+="</rsi:span>"}return d},
			markupWords:function(c){
	
	var d=rs.splitString(c,
			" ");
		if(!d){
	
	return""}var b="";
		var e=[];
		for(var a=0;
		a<d.length;
		a++){
	
	b+="<rsi:span class='sync_user word ck"+rs.seltexttimes+"'";
		b+=" id='sync"+(rs.bmindex++)+"'";
		b+=">";
		b+=(d[a]);
		b+="</rsi:span>"}return b},
			trim:function(a){
	
	return a.replace(/^\s+|\s+$/g,
			"")},
			htmlencode:function(b){
	
	var c=document.createElement("div");
		var a=document.createTextNode(b);
		c.appendChild(a);
		return c.innerHTML},
			identifyElementsReplacementNode:function(b){
	
	if(b.tagName&&b.tagName=="RSI:SPAN"&&b.id){
	
	rs.selectedWordsRange[b.id]=b}if(b.hasChildNodes()){
	
	for(var a=0;
		a<b.childNodes.length;
		a++){
	
	var c=b.childNodes.item(a);
		rs.identifyElementsReplacementNode(c)}}},
			createreplacementnode:function(c,
			a){
	
	var b=document.createElement("rsi:span");
		b.innerHTML=c;
		b.setAttribute("class",
			"synctemp cl"+rs.seltexttimes);
		return b},
			modifyOffsetStartOfWord:function(b,
			d){
	
	var c=new Array(" ", ", ", ". ", "! ", "? ", decodeURIComponent("%e3%80%81"), decodeURIComponent("%e3%80%82")); while(b.nodeValue&&d!=0){
	
	for(var a=0;
		a<c.length;
		a++){
	
	breakstr=c[a];
		if(b.nodeValue.substring(d-1).indexOf(breakstr)==0){
	
	return d}}d--}return d},
			modifyOffsetEndOfWord:function(b,
			d){
	
	var c=new Array(" ", ", ", ". ", "! ", "? ", decodeURIComponent("%e3%80%81"), decodeURIComponent("%e3%80%82")); while(b.nodeValue&&d!=b.nodeValue.length){
	
	for(var a=0;
		a<c.length;
		a++){
	
	breakstr=c[a];
		if(b.nodeValue.substring(d-1).indexOf(breakstr)==0){
	
	return d}}d++}return d},
			returnClassArraySubstring:function(b){
	
	var c=document.getElementsByTagName("*");
		var d=0;
		var a=[];
		for(i=0;
		i<c.length;
		i++){
	
	if(c[i].className.replace(b,
			"")!=c[i].className){
	
	a[d]=c[i];
		d++}}return a},
			cleanUpSpans:function(){
	
	var b=document.getElementsByTagName("RSI:SPAN");
		var a;
		for(i=b.length-1;
		i>-1;
		i--){
	
	a=document.createDocumentFragment();
		for(j=0;
		j<b[i].childNodes.length;
		j++){
	
	a.appendChild(b[i].childNodes[j].cloneNode(true))}b[i].parentNode.replaceChild(a,
			b[i])}},
			splitString:function(h,
			c){
	
	var m=new Array("");
		var e=0;
		for(var f=0;
		f<h.length;
		f++){
	
	for(var d=0;
		d<c.length;
		d++){
	
	var g=c[d];
		var a=true;
		for(var b=0;
		b<g.length;
		b++){
	
	if(h.length-(f+b)<0||g[g.length-b-1]!=h[f-b-1]){
	
	a=false;
		break}}if(a){
	
	e++;
		m[e]=""}}m[e]+=h[f]}return m}};
		if(document.addEventListener){
	
	document.addEventListener("mousedown",
			rs.getMouseXYpress,
			false);
		document.addEventListener("keydown",
			rs.getMouseXYpress,
			false);
		document.addEventListener("mouseup",
			rs.copyselected,
			false);
		document.addEventListener("keyup",
			rs.copyselected,
			false)}else{
	
	if(document.attachEvent){
	
	document.attachEvent("onmousedown",
			rs.getMouseXYpress);
		document.attachEvent("onkeydown",
			rs.getMouseXYpress);
		document.attachEvent("onmouseup",
			rs.copyselected);
		document.attachEvent("onkeyup",
			rs.copyselected)}else{
	
	document.onmousedown=rs.copyselected;
		document.onkeydown=rs.copyselected;
		document.onmouseup=rs.copyselected;
		document.onkeyup=rs.copyselected}}function readpage(a,
			b){
	
	rs.readpage(a,
			b)}function rshlsetContent(a){
	
	rs.rshlsetContent(a)}function rshlsetId(a){
	
	rs.rshlsetId(a)}function rshlinit(){
	
	rs.rshlinit()}function rshlsync(c,
			e){
	
	var d=c.split(", ");
		var a=e.split(", ");
		for(var b=0;
		b<c.length;
		b++){
	
	rs.rshlsync(d[b],
			a[b])}}function rshlexit(){
	
	rs.rshlexit()}var thestylesheet="<style type='text/css'> ";
		thestylesheet+="#rs_playerarea { position: relative !important; border:1px solid #aeaeae !important; background:#ffffff !important; width: "+rs.phrases.playerwidth+"px !important; height: 39px !important; line-height: 1em !important; }";
		thestylesheet+="#rs_popup_player { font-family: Arial !important; font-size: 13px !important; width: 97px !important; height: 22px !important; position: absolute !important; border: 1px solid #aeaeae !important; z-index: 9000 !important; background: #fff !important; -moz-box-shadow: 2px 4px 6px #999 !important; -webkit-box-shadow: 2px 4px 6px #999 !important; -box-shadow: 2px 4px 6px #999 !important; line-height: 1em !important; }";
		thestylesheet+="#rs_popup_link a:hover { background-color: #a4cbff !important; } #rs_selimg { position: absolute !important; border: 1px solid #aeaeae !important; z-index: 10000 !important; background: #fff !important; padding: 5px !important; -moz-box-shadow: 2px 4px 6px #999 !important; -webkit-box-shadow: 2px 4px 6px #999 !important; -box-shadow: 2px 4px 6px #999 !important; line-height: 1em !important; }";
		thestylesheet+="#rspopup { position: absolute !important; z-index: 1000 !important; background: #fff !important; width: 342px !important; border-color: #a4cbff #aeaeae #aeaeae !important; border-right: 1px solid #aeaeae !important; border-style: solid !important; border-width: 1px !important; margin: 3px 3px 3px 0 !important; font-size: 12px !important; font-family: Arial !important; padding: 3px !important; -moz-box-shadow: 0 7px 6px #999 !important; -webkit-box-shadow: 0 7px 6px #999 !important; -box-shadow: 0 7px 6px #999 !important; }";
		thestylesheet+=".rs_block { float: left !important; margin: 0 3px 0 0 !important; padding: 3px !important; border: 1px solid #ddd !important; width: 160px !important; background: none !important; clear: none !important; }"; 
		thestylesheet+=".rs_block legend { font-weight: bold !important; color: #000 !important; font-size: 12px !important; text-transform: none !important; letter-spacing: 0px !important; }";
		thestylesheet+=".rs_block ul { margin: 0 !important; padding: 0 !important; list-style: none !important; width: 100% !important; }";
		thestylesheet+=".rs_block li { padding: 0 !important; margin: 0 !important; width: 100% !important; background: none !important; list-style-image: none !important; }";
		thestylesheet+=".rs_block li a { text-align: left !important; border-style: none !important; display: block !important; padding: 5px 0 5px 20px !important; text-decoration: none !important; color: #000 !important; font-size: 12px !important; font-family: Arial !important; font-weight: normal !important; }";
		thestylesheet+=".rs_block li a:hover { background: #eee !important; }"; 
		thestylesheet+=".rs_block li.rs_active { background-color: #A4CBFF !important; }";
		thestylesheet+=".rs_block li.rs_active a,  .rs_block li.rs_active a:hover { background: transparent url("+rs.protocol+"//media.readspeaker.com/images/enterprise/default/rs_arrow.gif) no-repeat scroll 10px center !important; }";
		thestylesheet+="#bottomlinks { font-family:Arial !important; color:#333 !important; font-size:11px !important; margin: 2px 0 2px 0 !important; } #bottomlinks a { color: #000 !important; border-style: none !important; text-decoration: none !important; padding: 2px; font-weight: normal !important; font-size:11px !important; font-family: Arial !important; } #bottomlinks a:hover { background-color: #a4cbff !important; }";
		thestylesheet+="a.rs_settings { padding-left: 17px !important; border-style: none !important; background: transparent url("+rs.protocol+"//media.readspeaker.com/images/enterprise/default/wrench.png) no-repeat 2px 2px !important; }";
		thestylesheet+=".sync_word_highlighted { background-color: "+rs.wordColor+" !important; color: "+rs.textColor+" !important; }";
		thestylesheet+="</style>";
		//document.write(thestylesheet);
		
