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 1) { s_subresult = (n_value >= 1e3 ? '00' : '') + Math.floor(n_value%1e3); s_result = s_subresult.slice(-3) + (b_first ? '.' : ',') + s_result; b_first = false; n_value = n_value/1e3; } if (b_first) s_result = '0.' + s_result; return b_negative ? '($' + s_result + ')' : '$' + s_result; } function getTotal(type) { var tmp = splitCookie('Palgrave'); var total = 0; for (var i=0;i 10)) { pass=false; reqfields += "Postcode (4 to 10 numbers only)\n"; } //is order to be set overseas? var oOrder = document.forms['SubmitOrder'].overseasOrder; for(var i=0; i < oOrder.length; i++) { if(oOrder[i].checked)var fOverseasOrder = oOrder[i].value; } if(which.PostalState.selectedIndex == 0 && fOverseasOrder == "0") { pass=false; reqfields += "Postal State\n"; } if (which.PhoneNumber.value!="" && (!reNumbersOnly.test(which.PhoneNumber.value) || which.PhoneNumber.value.length < 8)) { pass=false; reqfields += "Phone (minimum 8 numbers only)\n"; } if (!pass) { alert(reqfields); return false; } var thisArrayCookie = splitCookie('Palgrave'); var inspectFlag = '0'; for (var i=0;i 10 || (fOverseasOrder == "0" && which.PostalCode.value.length > 4))) { pass=false; reqfields += "Postcode (4 to 10 numbers only)\n"; } if (which.PhoneNumber.value!="" && (!reNumbersOnly.test(which.PhoneNumber.value) || which.PhoneNumber.value.length < 8)) { pass=false; reqfields += "Phone (minimum 8 numbers only)\n"; } if (!pass) { alert(reqfields); return false; } if (isInspect) { var strInspect_CompFields = which.Inspect_CompulsoryDetailsFields.value; for (i=0;i 0) && getRadioValue('overseasOrder')!=1) total = total + Number(document.forms['SubmitOrder'].handlingCharge.value); document.getElementById('finalprice').innerHTML = 'Total purchase: $' + total.toFixed(2) + ''; } self.scrollTo(0, 0) } function showPrevLayer(currentLayer) { document.getElementById("Step" + currentLayer + "Layer").style.visibility = "hidden"; document.getElementById("Step" + (--currentLayer) + "Layer").style.visibility= "visible"; self.scrollTo(0, 0) } function getFormLabels(formValue) { strValues = "Firstname; Lastname; EmailAddress; PostalAddress; PostalCity; PostalState; PostalCode; PostalCountry; PhoneNumber; CustomField_1; CustomField_2; Organisation; CardName; CardNumber; CardMonth; CardYear; CardType; Inv_Order_Number; Card_ONumber; S_CName; S_CNumber; S_CMonth; S_CYear; S_CType"; strNames = "First name; Last name; Email address; Street address; City; State; Postcode; Country; Phone number; Account number; Position; School name; Credit card name; Credit card number; Expiry month; Expiry year; Card type; Customer Order Number; Customer Order Number; Credit card name; Credit card number; Expiry month; Expiry year; Card type"; var fromlist = strValues.split('; '); var tolist = strNames.split('; '); for (var i = 0; i < fromlist.length; i++ ) { if (fromlist[i] == formValue) { return tolist[i]; } } return formValue } function stopEvent(oEvent) { if(window.event) { var target = window.event.srcElement; window.event.returnValue = false; } else { var target = oEvent.target; oEvent.preventDefault(); } return target; }