function changeInnerBuy(innerID,value,isbn) {
if (value=="") {value=1}; // set value at 1
var thisID = eval(innerID);
var thistext = '
' + value + '
';
thisID.innerHTML = thistext;
}
function changeInnerInspect(innerID,isbn) {
var thisID = eval(innerID);
var thistext = '
1
';
thisID.innerHTML = thistext;
}
function cartHasUnavailable()
{
var oCookie = getCookie('Palgrave') ? getCookie('Palgrave').split(';') : false;
if(oCookie == false )return false;
for(var i = 0; i < oCookie.length; i++)
{
var splitCookie = oCookie[i].split('|');
if(typeof splitCookie[4] != 'undefined' && splitCookie[4] == 'NA')return true;
}
return false;
}
function addtoCart(idstring,value,innerId,inspect)
{
if (value=="") {value=1}; // set value at 1
var bookIsbn = idstring.split('|')[0];
var bookTitle = idstring.split('|')[1];
var availability = idstring.split('|')[4];
var priceAvailability = new PriceAvailability(bookIsbn,value);
var message = null;
if((availability == 'NA' && (!priceAvailability.available) && cartHasUnavailable() == false)
|| (availability == 'A' && (!priceAvailability.available)))
{
// message = 'Items not in stock are added to the shopping cart as book requests. The cost of these items is not included in the debit amount when paying by credit card from the website. Our Sales department will contact customers when processing book requests in order to estimate availability of items not in stock.';
}
//if book not available change its availability status
/*
if(!priceAvailability.available)
{
var idstringSplit = idstring.split('|');
idstringSplit[idstringSplit.length - 1] = 'NA';
idstring = idstringSplit.join('|');
}
*/
var cookieExpires = new Date();
cookieExpires.setTime(cookieExpires.getTime() + (1 * 60 * 60 * 1000 ));
getCookie('Palgrave') ? tmpCookie = getCookie('Palgrave') : tmpCookie = "";
tmpCookie += idstring + "|" + value + ";";
setCookie('Palgrave', tmpCookie, cookieExpires, '/');
//window.location.reload(false);
getSummary();
if(inspect)
{
var thistext = '
1
';
} else {
var thistext = '
' + value + '
';
}
if(priceAvailability && (!priceAvailability.available))
{
thistext += '
' + priceAvailability.getShipDateString() + '
'; } document.getElementById(innerId).innerHTML = thistext; thisVal=""; if(message)alert(message); } function removefromCart(id) { // remove single item from cart getCookie('Palgrave') ? thisCookie = getCookie('Palgrave') : thisCookie = ""; var cookieExpires = new Date(); cookieExpires.setTime(cookieExpires.getTime() + (1 * 60 * 60 * 1000 )); var thisCookieSplit = thisCookie.split(';'); var tmpCookie = ""; for (var i=0;i