// Facebook Profile page functions //////

function checkCode()
{
	divid="output";
	code=document.getElementById("code").value;
	product_id=document.getElementById("product_id").value;
	//document.getElementById(divid).innerHTML='<img src=images/loader.gif />';
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	} 
	
// ************************************************************************************************

// Set the path to your web site below.  Replace "yourwebsitehere.com" with your actual domain name

// ************************************************************************************************

	var url="http://www.adamsim.com/check-code.php";
	url=url+"?code="+code+"&product_id="+product_id;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}



/// Start Ajax Coding
function stateChanged() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById(divid).innerHTML=xmlHttp.responseText;
	}
}

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;
}

//// end of ajax coding


