/*
 * Shopping Cart System Olive-Cart.

 * This is the integration file for JavaScript.
 */

function go_step(){
 var ElementsCount=document.Form_login.elements.length;
 var post= new Array();
   for( i=0 ; i<ElementsCount ; i++ ) {

      var number =document.Form_login.elements[i].name;
      var value_data =document.Form_login.elements[i].value;
      post += number+'='+value_data+'&';
   }

 CartIn(post);
}
function SSLpage(Mode){
  document.Form.method = "post";
  document.Form.action='https://www.olive-design.com/olivedesign/newOliveCms/cart/mypage/index.php';
  document.Form.mode.value=Mode;
  document.Form.submit();
}

function mode(mode){
    var  post = 'mode='+mode;
 CartIn(post);
}
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);
  }
}

window.onload = function (){
  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("userlogin").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;
  }
}