function hov(loc,cls){
if(loc.className)
loc.className=cls;
}
function itemDetails() {
// clear any current kit items first...
if(typeof(kitClear) == 'object') {
clearKits();
}
if(itemID != null || itemID == '') {
// split data
var itemData = itemNew[itemID].split("|");
// set up item info
// IF INSTANT RESERVE SWITCH SET, & NO STOCK, HALT TRANSACTION
if (itemData[8]) {
document.form1.sub.disabled=true;
} else { // ELSE ALLOW TRANSACTION
document.form1.sub.disabled=false;
}
// IF INSTANT RESERVE SWITCH SET, DISPLAY STOCK AVAILABLE
if (itemData[9]) {
// SET HIDDEN FIELD VALUE, TO COMPARE STOCK LEVEL TO REQUIRED QTY LEVEL
document.form1.stockLevel.value = itemData[9];
// SET HIDDEN FIELD VALUE, TO PICK UP RESERVED LEVEL OF STOCK FOR LOCID
document.form1.stocklocID.value = itemData[10];
// SET HIIDEN FIELD VALUE TO CUSTOMER ID
document.form1.custID.value = itemData[11];
}
for(i=0; i < itemData.length-1; i++) {
//alert ( 'item'+i + "\n" + itemData[i] );
if(i=='9' && itemData[12]=='NSI'){
} else {
showAddr('item'+i, itemData[i]);
}
//showAddr('item'+i, itemData[i]);
}
//alert ( itemNew[itemID] + "\n" + itemKit[itemID] );
if(itemKit[itemID] != null) {
visTD('kitBit', 'show');
kitClear = new Array();
// set up kit info
for(i=0; i < itemKit[itemID].length; i++) {
// alert ( 'kit'+i + "\n" + itemKit[itemID][i] );
visTD('kit'+i, itemKit[itemID][i]);
// store kitIDs used so they can be cleared later
kitClear[i] = 1;
}
} else {
visTD('kitBit', null);
}
// SET QTY FIELD, PERSONALISED FIELD, & ADD BUTTON TO VISIBLE
visTD('addItem', 'show');
visTD('addItem2', 'show');
// IF PROD_TYPE FIELD AVAILABLE (ITS A PERSONALISED PROD!!!), THEN DISPLAY PERSONALISED FIELD.
if(document.form1.prod_type) {
if(document.form1.pers_group) { // if personalised group item added e.g. shirt name, display toggle
visTD('persDisplay', 'show');
} else {
visTD('persDetails', 'show'); // else just display personalised text field
}
}
// if item item image then set to visible
if (itemData[4] != '') {
// THIS IS TO ALLOW ITEM IMAGES TO BE ENLARGED
visTD('itemImage', '');
} else {
visTD('itemImage', null);
}
itemID = null;
} else {
// THIS IS TO ALLOW ITEM IMAGES TO BE ENLARGED
if(document.form1.stockLevel) {
var resetArray = new Array('addItem', 'kitBit', 'itemImage', 'item0', 'item1', 'item2', 'item3','item4','item5','item6','item7','item9','addItem2','persDetails','persDisplay');
} else {
var resetArray = new Array('addItem', 'kitBit', 'itemImage', 'item0', 'item1', 'item2', 'item3','item4','item5','item6','item7','addItem2','persDetails','persDisplay');
}
for(i=0; i Number(document.form1.stockLevel.value)) {
// IF REQUIRED LEVEL > STOCK LEVEL, HALT & WARN
alert ("*** You cannot order more items than are available. ***");
returnVal = false;
} else {
// IF NO ERRORS, CONTINUE TRANSACTION
// IF NOT PERSONALISED MANDATORY ITEM, OR PERSONALISED FIELD HAS VALUE, ALLOW FORM SUBMIT
if (pvalue!=false) {
returnVal = true;
document.form1.sub.disabled=true;
} else {
// ELSE DISABLE FORM SUBMIT
alert("*** This item requires a personalised value to be entered ***");
returnVal = false;
}
}
} else { // IF INSTANT RESERVE SWITCHED OFF, CONTINUE TRANSACTION
// IF NOT PERSONALISED MANDATORY ITEM, OR PERSONALISED FIELD HAS VALUE, ALLOW FORM SUBMIT
if (pvalue!=false) {
returnVal = true;
document.form1.sub.disabled=true;
} else {
// ELSE DISABLE FORM SUBMIT
alert("*** This item requires a personalised value to be entered ***");
returnVal = false;
}
}
}
// FORCE PERSONALISED FIELD ENTRY
function personalised() {
if(document.form1.personalised.value=='' && document.form1.persval.value=='') {
return false;
} else {
return true;
}
}
// Toggle personalised item settings
function toggleLayer()
{
if(document.form1.a1.checked === true)
{
visTD('persDetails', 'show');
}
else if(document.form1.a2.checked === true)
{
visTD('persDetails');
}
}
function disableSubmitAll(thisForm, cnt){
// IF INSTANT RESERVE SWITCHED ON & REQUIRED LEVEL > STOCK LEVEL, HALT & WARN
if (Number(thisForm.itemQty.value) > Number(thisForm.stockLevel.value)) {
alert ("*** You cannot order more items than are available. ***");
return false;
}
// IF PRODUCT IS A PERSONALISED MANDTORY TYPE, FORCE PESONALISED VALUE ENTRY
if(thisForm.prod_type.value=='14') {
if(thisForm.personalised.value=='' && thisForm.persval.value=='') {
// DISABLE FORM SUBMIT
alert("*** This item requires a personalised value to be entered ***");
return false;
} else {
return true;
thisForm.sub.disabled=true;
}
}
// IF INSTANT RESERVE SWITCHED ON & NOT LOGGED IN, ALLOW ITEM TO BE ADDED TO BASKET
// NOW TEMPID CREATED WHICH IS UPDATED WHEN USER LOGS IN
if(Number(thisForm.stockLevel.value) > 0 && thisForm.custID.value=='') {
return true;
}
}
function itempop(itemname, itemdesc) {
my_window= window.open ('', 'mywindow1','status=1, width=300, height=300, toolbar=no, menubar=no, resizable=yes, scrollbars=yes');
my_window.document.write("");
my_window.focus();
}
function disableSubmitSmry(){
this.summary.sub.disabled=true;
}
// SET SUBMIT FORM GIFT RECEIPT SELECTION VALUE
function submitGift() {
if(document.grform.giftreceipt.checked==true) {
document.summary.giftreceipt.value = document.grform.giftreceipt.value;
}
}
function closeCookie() {
document.getElementById('cookie-law').style.display = "none";
}