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 bokstavsordning()
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4){
      BokstavResponse(xmlHttp.responseText);
    }
  }

  xmlHttp.open("GET", "/wp-content/themes/mallvision/data99.php?data=1", true); 
  xmlHttp.send(null);
}

function generordning()
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4){
      GenerResponse(xmlHttp.responseText);
    }else{
      GenerResponse("<center><div style='color: #fff; font-size: 15px; margin-top: 100px;'>Laddar ...</div></center>");
    }
  }

  xmlHttp.open("GET", "/wp-content/themes/mallvision/generwidget.php", true); 
  xmlHttp.send(null);
}

function hittahit()
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4){
      HittaResponse(xmlHttp.responseText);
    }else{
      HittaResponse("<center><div style='color: #fff; font-size: 15px; margin-top: 100px;'>Laddar ...</div></center>");
    }
  }

  xmlHttp.open("GET", "/wp-content/themes/mallvision/data99.php?data=3", true); 
  xmlHttp.send(null);
}

function oppettiderna()
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4){
      oppettiderResponse(xmlHttp.responseText);
    }else{
      oppettiderResponse("<center><div id='runda' style='height: 40px; color: #fff; font-size: 12px; padding-top: 20px;'>Laddar öppettider ...</div></center>");
    }
  }

  xmlHttp.open("GET", "/wp-content/themes/mallvision/oppetwidget.php", true); 
  xmlHttp.send(null);
}



function oppettidernamob()
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4){
      oppettiderMobResponse(xmlHttp.responseText);
    }else{
      oppettiderMobResponse("<center><div id='runda' style='height: 20px; color: #fff; font-size: 12px; padding-top: 10px;'>Hämtar öppettider och parkeringsplatser ...</div></center>");
    }
  }

  xmlHttp.open("GET", "/wp-content/themes/mallvision/parkeringmobwidget.php", true); 
  xmlHttp.send(null);
}

function pplatser()
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4){
      pplatserResponse(xmlHttp.responseText);
    }else{
      pplatserResponse("<span style='background: blue;padding: 0px 2px 0px 2px; color: #fff; font-weight: bold; margin-left: -5px; margin-right: 6px;'>P</span><em><span style='color:#fff;'>Hämtar antal lediga parkeringsplatser ...</span></em>");
    }
  }

  xmlHttp.open("GET", "/wp-content/themes/mallvision/parkeringwidget.php", true); 
  xmlHttp.send(null);
}


function butikOppet()
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4){
      butikOppetResponse(xmlHttp.responseText);
    }else{
      butikOppetResponse("<center><div style='color: #fff; font-size: 10px;'>Hämtar öppettider ...</div></center>");
    }
  }

  xmlHttp.open("GET", "/wp-content/themes/mallvision/data99.php?data=6", true); 
  xmlHttp.send(null);
}

function topBoxen()
{
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4){
      topBoxenResponse(xmlHttp.responseText);
    }else{
      topBoxenResponse("<center><div style='color: #fff; font-size: 10px;'>Laddar ...</div></center>");
    }
  }

  xmlHttp.open("GET", "/wp-content/themes/mallvision/topboxwidget.php", true); 
  xmlHttp.send(null);
}



function GenerResponse(response)
{
  document.getElementById('generordning').innerHTML = response;
}



function BokstavResponse(response)
{
  document.getElementById('bokstavsordning').innerHTML = response;
}

function HittaResponse(response)
{
  document.getElementById('hittahit').innerHTML = response;
}

function oppettiderResponse(response)
{
  document.getElementById('oppettiderna').innerHTML = response;
}

function oppettiderMobResponse(response)
{
  document.getElementById('oppettidernamob').innerHTML = response;
}

function pplatserResponse(response)
{
  document.getElementById('pplatsermob').innerHTML = response;
}

function pplatserResponse(response)
{
  document.getElementById('pplatser').innerHTML = response;
}

function butikOppetResponse(response)
{
  document.getElementById('butikOppet').innerHTML = response;
}

function topBoxenResponse(response)
{
  document.getElementById('topright_box').innerHTML = response;
}
