/*
 * Shopping Cart System Olive-Cart.
 * copyright (C) 2008-2009 Olive-Design, Corp.
 * link http://www.cart-ya.com/
 * package Olive-Cart
 * version 2.2.11
 *
 * This is the integration file for JavaScript.
/* $Id: cart.js  2009-01-28 15:10:03 $ */

function cartopen(){
	var url=CartUrl+'?step=2';
	var win1=window.open(url,"newopen","resizable=yes,directories=yes,menubar=yes,location=yes,status=yes,toolbar=yes,scrollbars=yes,width=700,height=600,screenX=600, screenY=100,left=500, top=100,",false);
	win1.window.focus();
}

function postIn(Number){
  var Count = document.getElementById(Number).value; 
  var Post_data="step=1&number="+Number+"&count="+Count;
  CartIn(Post_data);
}

function CartIn(Post_data){
  httpObj = createXMLHttpRequest(displayData);
  if (httpObj){
    httpObj.open("POST",CartUrl,true);
    httpObj.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");
    httpObj.send(Post_data);
  }
}

function Onload(){
  var postdata='step=1';
  httpObj = createXMLHttpRequest(displayData);
  if (httpObj){
    httpObj.open("POST",CartUrl,true);
    httpObj.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");
    httpObj.send(postdata);
  }
}

function displayData()
{
  if ((httpObj.readyState == 4) && (httpObj.status == 200)){
    document.getElementById("maincart").innerHTML= httpObj.responseText;
  }
}

function createXMLHttpRequest(object)
{
  var XMLhttpObject = null;
  try{
    XMLhttpObject = new XMLHttpRequest();
  }catch(e){
    try{
      XMLhttpObject = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
      try{
        XMLhttpObject = new ActiveXObject("Microsoft.XMLHTTP");
      }catch(e){
        return null;
      }
    }
  }
  if (XMLhttpObject){
     XMLhttpObject.onreadystatechange = object;
     return XMLhttpObject;
  }
}

