var xmlHttp

function registerSolvedCube() //Asynchronous Javascript XML function  
{
try {
xmlHttp=GetXmlHttpObject();
var url="javascript/solved_a_cube.php";
xmlHttp.onreadystatechange=function() {
  if (xmlHttp.readyState==4) { 
    document.getElementById("celebrate").innerHTML = '<em>' + xmlHttp.responseText +'</em>';
		document.getElementById("if").innerHTML = 'Congratulations! There is a free PDF summary of the solution in the Gift Shop that will help you remember the moves.';
    }
  }
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

} catch(e){alert(e.message)}
}

function solvedCubeCount() //Asynchronous Javascript XML function  
{
xmlHttp=GetXmlHttpObject();
var url="http://www.howtocube.com/html/javascript/solved_cube_count.php";
xmlHttp.onreadystatechange=function() {
  if (xmlHttp.readyState==4) { 
		//opacity('subtitle', 100, 0, 800);
		document.getElementById("celebrate").innerHTML = '<em>' + xmlHttp.responseText +'</em>';
    //opacity('subtitle', 0, 100, 800);
		//setTimeout("normalSubtitle()",15000);
    }
  }
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function normalSubtitle()
{
document.getElementById("subtitle").innerHTML = '<em>An Animated Guide For Beginners</em>';
setTimeout("solvedCubeCount()",15000);
}

/*function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("celebrate").innerHTML = '<b>' + xmlHttp.responseText +'</b>';
}
} */

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

