/*function for slideshow*/
$(document).ready(function(){$('.slideshow').cycle({fx:'fade'}); });
function aj(w)
{
  var xh;
  if(window.XMLHttpRequest)xh=new XMLHttpRequest();
  else if (window.ActiveXObject)xh=new ActiveXObject("Microsoft.XMLHTTP");

  if(w=='cacheKiaImages')/*cache images for kia*/
  {
    xh.onreadystatechange=function()
    {
      if(xh.readyState==4)
      {
        document.getElementById("dump").innerHTML=xh.responseText;
        i=document.getElementById("dump").getElementsByTagName("i");
        cache=new Array();
        for(j=0;j<i.length;j++)
        {
          a=new Image();
          a.src=i[j].innerHTML;
          cache.push(a);
        }
      }
    }
    xh.open("POST","aj?action=cacheKiaImages",true);
    xh.send(null);
  }

  else if(w=='loadShowroom')/*load latest showroom cars*/
  {
    xh.onreadystatechange=function()
    {
      if(xh.readyState==4)
      {
        document.getElementById("carbody").innerHTML=xh.responseText;
      }
    }
    xh.open("POST","aj?action=loadShowroom",true);
    xh.send(null);
  }

}

setTimeout("aj('cacheKiaImages')",1200);
