
function handleHttpResponse() {
  if (http.readyState == 4) {
  document.getElementById('cart').innerHTML = http.responseText;
	document.getElementById('add_cart_display').style.display = 'block';
	document.getElementById('cart_cont').style.display = 'block';

 }
  else {
	document.getElementById('cart').innerHTML = '<img src="http://www.g-interactive.com/www.dizainamebeles.lv/images/loading_black.gif">'
	
  }
	}

function handleDivTag(divtag)
{
   var divtag;
   return divtag;
}
 
var divhandler = new handleDivTag(null); 

function add_cart(id, valoda) {
var divname;
var pid;
document.getElementById('add_cart_display').style.display = 'none';
  http.open("GET", url + '?id=' + id + '&val=' + valoda, true);
  http.onreadystatechange = handleHttpResponse;
  divhandler.divtag = divname;
  http.send(null);
  if(pid != 0 ) {
 }
}

function getHTTPObject() {
   var req;
   if(window.XMLHttpRequest){
      // Firefox, Safari, Opera...
      req = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
      // Internet Explorer 5+
      req = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
      // There is an error creating the object,
      // just as an old browser is being used.
      alert('Problem creating the XMLHttpRequest object');
   }
   return req;
	}

var http = getHTTPObject();

function load_prod() {
	if(document.getElementById('loader')) {
	document.getElementById('prodLeftCont2').style.display = '';
	document.getElementById('loader').style.display = 'none';
	}
}
