function getXMLHttp()
{
  var xmlHttp

  try
  {
    //Firefox, Opera 8.0+, Safari
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    //Internet Explorer
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
      try
      {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e)
      {
        alert("Your browser does not support AJAX!")
        return false;
      }
    }
  }
  return xmlHttp;
}

function MakeRequest(sten, sax, pase)
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {

var myString = xmlHttp.responseText;
var mySplitResult = myString.split("background:url(");

var finalstring = mySplitResult[1].split(");");

      HandleResponse(finalstring[0]);
    }
  }

var street=sten;
var adress=sax;
var zip=pase;


var parameters="street="+street+"&adress="+adress+"&zip="+zip;


var url;
url = window.location.href;
mySplitResult = url.split(".se/");
if (mySplitResult[0]=="http://www.cateringstore")
{
xmlHttp.open("POST", "http://www.cateringstore.se/ajax.php", true);
}
else
{
xmlHttp.open("POST", "http://cateringstore.se/ajax.php", true);
}


xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.send(parameters);

 // xmlHttp.open("GET", "ajax.php", true); 
 // xmlHttp.send(null);

}

function HandleResponse(response)
{
    //document.getElementById('ResponseDiv').innerHTML = response;
    document.getElementById('ResponseDiv').innerHTML = "<img src='" + response.replace("iwidth=680", "iwidth=300") + "'>"; 
 
}
