function addi(id1) {
 var pc="";
 var m = "";
 var i=0; var j=0; var l=0; var x=0;
 var cpc=0;
 var ifo1 = GetCookie('ifo1');
 var ifon=""; ifot="";
 if (ifo1 != null) {
  l = ifo1.length;
  for (j=0; j <= l; j++) {
   m = ifo1.substr (j,1);
   if (m == "|") { x++; }
   if (m != "|") {
    if (x == 0) { pc+= m; }
   }
  }
  //check to see if item in basket
  pc-0;
  cid1 = new Array(pc+1);
  x=0;
  var t1="";
  for (j=0; j <= l; j++) {
   m = ifo1.substr (j,1);
   if (m == "|") { x++; }
   if (m != "|") {
    if (x == 1) { t1+= m; }
    //if (x == 0) { id1+= m; }
    //if (x == 1) { id2+= m; }
    if (x == 2) {
     cpc++;
     cid1[cpc] = t1;
     //alert('*cid1='+cid1[cpc]);
     x=0;
     t1="";
    }
   }
  }
//alert('*cpc='+cpc);
  for (i=1; i <= cpc; i++) {
   //alert('*id1='+id1+' *cid1='+cid1[i]);
   if (id1 == cid1[i]) { 
    id1 = null;
    alert('Item already in basket'); 
   }
  }
  if ((id1 != null) && (id1 != "undefined" )) {
   var sl=pc.length+1;
   ifot = ifo1.substr (sl,ifo1.length - sl);
   //alert('*pc='+pc+'*sl='+sl+'*ifo1.substr='+ifot);

if (ifot == "") {
   ifon = cpc+1+"|"+id1+"|"+"1";
}
else {
   ifon = cpc+1+"|"+ifot+"|"+id1+"|"+"1";
}

   SetCookie('ifo1', ifon, exp, "/");
   //parent.frame2.location.reload(true);
  }
 }
 else {
  //set new cookie since one doesnt exist
  ifon = "1"+"|"+id1+"|"+"1";
  SetCookie('ifo1', ifon, exp, "/");
 }
 self.location = "../cgix/scartn.asp";
}



