function setLoading(){
    document.getElementById('icq1').style.backgroundColor="transparent";
    document.getElementById('icq1').style.backgroundRepeat="no-repeat";
    document.getElementById('icq1').style.backgroundPosition="top left";
    document.getElementById('icq1').style.backgroundImage="url('http://realparts.ru/images/icq1_loading.gif')";
    document.getElementById('icq2').style.backgroundColor="transparent";
    document.getElementById('icq2').style.backgroundRepeat="no-repeat";
    document.getElementById('icq2').style.backgroundPosition="top left";
    document.getElementById('icq2').style.backgroundImage="url('http://realparts.ru/images/icq2_loading.gif')";
}

function getHTTPObject(){
   if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
   else if (window.XMLHttpRequest) return new XMLHttpRequest();
   else {
      alert("Your browser does not support AJAX.");
      return null;
   }
}

function setOutput1(){
  if(httpObject1.readyState == 4){
   document.getElementById('icq1').style.backgroundImage="url('"+httpObject1.responseText+"')";
  }
}

function setOutput2(){
  if(httpObject2.readyState == 4){
   var ua = navigator.userAgent.toLowerCase();
   isIE = (ua.indexOf("msie") != -1 && ua.indexOf("opera") == -1 && ua.indexOf("webtv") == -1);
   if(isIE==true) {
   document.getElementById('icq2').style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+httpObject2.responseText+"',sizingMethod=crop)";
   }
   else { document.getElementById('icq2').style.backgroundImage="url('"+httpObject2.responseText+"')"; }
  }
}

function doWork1(){
   httpObject1 = getHTTPObject();
   if (httpObject1 != null) {
      httpObject1.open("GET", "http://realparts.ru/icq.php?id=1", true);
      httpObject1.send(null);
      httpObject1.onreadystatechange = setOutput1;
   }
}

function doWork2(){
   httpObject2 = getHTTPObject();
   if (httpObject2 != null) {
      httpObject2.open("GET", "http://realparts.ru/icq.php?id=2", true);
      httpObject2.send(null);
      httpObject2.onreadystatechange = setOutput2;
   }
}

var httpObject1 = null;
var httpObject2 = null;

function flowers(){
   doWork1();
   doWork2();
}
