// Client side library for HOSS.
// These functions all invoke Hoss via popup windows
// They may be called from an A tag where the href attribute
// uses the javascript: protocol.  Make sure that the javascript expression
// RETURNS NO VALUE, otherwise your web browser will attempt to load the
// page.  Example: 
// <A href='javascript: void addItem(ID)'>Buy this</a>
// Where ID is the accpac id of the item.

var HOSS_WIDTH = 600;
var HOSS_HEIGHT = 700;


function showCart () {
  return popupHoss("view");
}

function addItem (id) {
  return popupHoss("add", id);
}

function popupHoss(action, itemID) {
  var url = "https://www.principals.ca/cms/eComm/hoss/hoss.aspx?action=" + action + "&item=" + itemID;
  var features = 'resizable,scrollbars,width=' + HOSS_WIDTH + ',height=' + HOSS_HEIGHT;
  var newWindow = window.open(url, "", features)
  newWindow.focus();
  return false;
}
