var musekey = "";
var optibody = document.getElementsByTagName('body')[0];
var script = document.createElement('script');
script.type= 'text/javascript';
script.src= 'http://www.tattle.com/optimuse/jquery-1.3.2.min.js';
optibody.appendChild(script);
var script2 = document.createElement('script');
script2.type= 'text/javascript';
script2.src= 'http://www.tattle.com/optimuse/optimize.php';
optibody.appendChild(script2);

function runOptimizer(data)
{
	var text = data.Text.Replace;
	var newtext = data.Text.With;
	var museid = data.Text.ID;
	var linkElem = $("*>a:contains('" + text + "')");
	linkElem.text(newtext);
	linkElem.mousedown(function()
							{
								 xmlhttp.open("GET", "http://www.tattle.com/optimuse/click.php?c=" + newtext + "&id=" + museid,true);
 xmlhttp.send(null)
							});
}


var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}