// code to load swf by calling jargonloader.php
var xhr = false;
window.onload = initAll;

function initAll() 
{
  document.getElementById("makeTextRequest").onclick = showJargon;
}

function showJargon() 
{
  makeRequest(this.href);
  return false;
}

function makeRequest(url) 
{
	if (window.XMLHttpRequest) {
		xhr = new XMLHttpRequest();
	}
	else {
		if (window.ActiveXObject) {
			try {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) { }
		}
	}

	if (xhr) {
		xhr.onreadystatechange = loadGame;
		xhr.open("GET", url, true);
		xhr.send(null);
	}
	else {
		document.getElementById("updateArea").innerHTML = "Sorry, but your browser does not support Ajax for games.";
	}
}

function loadGame() 
{
//alert(xhr.readyState);
  if (xhr.readyState == 4) 
  {
    outMsg='&nbsp; <object><embed src="http://www.kprobe.com/kprobe/Jargon/jargonjumble.swf?Filter=Jumbled Jobs" width=500 height=400 quality=high wmode=window type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object> &nbsp;';
    document.getElementById("updateArea").innerHTML = outMsg;
  }
}

	
