if (document.images)
{
  pic1=new Image(140,50);
  pic1.src="/img/updatecart.gif";
}

http = getHTTPObject();
 
function getHTTPObject(){
/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
  return xmlHttp;
}
 
function addskin(){
  document.getElementById('sidecart').innerHTML = '<table width=170 cellpadding=0 cellspacing=0 border=0><tr height=26><td width=170 background=img/bg/side_cat_top.gif align=center valign=middle class=menuheader>Shopping Cart</td></tr><tr height=5><td width=170 background=img/bg/side_cat_divider.gif></td></tr><tr><td width=170 background=img/bg/side_cat_item.gif align=center valign=middle><img src=img/updatecart.gif width=140 height=50></td></tr><tr height=10><td width=170 background=img/bg/side_cat_bottom.gif></td></tr><tr height=20><td width=170></td></tr></table>';
  var randomnumber=Math.floor(Math.random()*10001)
  var url = "inc-sidecart.asp?ajax=True&additem=True&rnd=" + randomnumber;
  http.open("GET", url, true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
}

function quickaddskin(skinid){
  document.getElementById('sidecart').innerHTML = '<table width=170 cellpadding=0 cellspacing=0 border=0><tr height=26><td width=170 background=img/bg/side_cat_top.gif align=center valign=middle class=menuheader>Shopping Cart</td></tr><tr height=5><td width=170 background=img/bg/side_cat_divider.gif></td></tr><tr><td width=170 background=img/bg/side_cat_item.gif align=center valign=middle><img src=img/updatecart.gif width=140 height=50></td></tr><tr height=10><td width=170 background=img/bg/side_cat_bottom.gif></td></tr><tr height=20><td width=170></td></tr></table>';
  var randomnumber=Math.floor(Math.random()*10001)
  var url = "inc-sidecart.asp?ajax=True&quickadd=" + skinid + "&rnd=" + randomnumber;
  http.open("GET", url, true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
}

function addvoucher(vouchertype){
  document.getElementById('sidecart').innerHTML = '<table width=170 cellpadding=0 cellspacing=0 border=0><tr height=26><td width=170 background=img/bg/side_cat_top.gif align=center valign=middle class=menuheader>Shopping Cart</td></tr><tr height=5><td width=170 background=img/bg/side_cat_divider.gif></td></tr><tr><td width=170 background=img/bg/side_cat_item.gif align=center valign=middle><img src=img/updatecart.gif width=140 height=50></td></tr><tr height=10><td width=170 background=img/bg/side_cat_bottom.gif></td></tr><tr height=20><td width=170></td></tr></table>';
  var randomnumber=Math.floor(Math.random()*10001)
  var url = "inc-sidecart.asp?ajax=True&addvoucher=True&size=" + vouchertype + "&rnd=" + randomnumber;
  http.open("GET", url, true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
}

function handleHttpResponse(){
  if(http.readyState == 4){
   document.getElementById('sidecart').innerHTML = http.responseText;
  }
}
