function stockSizeQuantity(intBasketId,curProd_id,strColor){
//pass in a color and set the backorder for all the sizes
//loop through the size list and find those backordered
strStockMessage = ""
for (i=0; i <= sizeArray[intBasketId].length; i++){
strSize = sizeArray[intBasketId][i]
//clear all graphics set by previous script - start all at empty
varId = "stockIcon" + curProd_id + "_" + strSize
//WARNING!! In order to use getElementById with Firefox you must have the id property set in addition to the name property
objImgAsterisk = document.getElementById(varId)
if(objImgAsterisk){
objImgAsterisk.src="../common/resources/structure/shim.gif"
}
//check stock
strBackOrderDate = checkStock(intBasketId, curProd_id, strSize, strColor)
if(blnInStock[intBasketId] == 0){
if(objImgAsterisk){
//set stock message
strStockMessage = strStockMessage + "
" + strSize
if(strBackOrderDate != ""){
strStockMessage = strStockMessage + " - " + strBackOrderDate
}
//add the red asterisk to the size/quantity
objImgAsterisk.src="../common/resources/0.gif"
}
}
}
//write stock message
curMessage = ""
if(strStockMessage != ""){
curMessage = "
The following sizes are backorderd:" + strStockMessage
}
setStockMessage(curMessage, "stockMessage")
}
function stockPopup(intBasketId, intProd_id, strSize, strColor, strMessageDivId){
//pass in a color and set the backorder for all the sizes
strStockMessage = ""
//checkStock
strBackOrderedDate = checkStock(intBasketId, intProd_id, strSize, strColor)
if(blnInStock[intBasketId] == 0){
//set stock message
strStockMessage = '
Backordered'
if(strBackOrderedDate != ""){
strStockMessage = strStockMessage + " until " + strBackOrderedDate
}
strStockMessage = strStockMessage + ""
}
setStockMessage(strStockMessage, strMessageDivId)
}
function checkStock(basketId, curProdId, curSize, curColor){
curIndex = curProdId + "_" + curSize + "_" + curColor
blnInStock[basketId] = 1
//if the date isn't there the test for stockArray[arrayIndex] doesn't return true, did an or to test for both cases
if(stockArray[basketId][curIndex] || stockArray[basketId][curIndex] == ""){
blnInStock[basketId] = 0
return stockArray[basketId][curIndex]
}
}
function setStockMessage(strMessage, divId){
//WARNING!! In order to use getElementById with Firefox you must have the id property set in addition to the name property
objStockMessage = document.getElementById(divId)
if(objStockMessage){
//clear the previous message
objStockMessage.innerHTML = ""
if(strMessage != ""){
if(objStockMessage){
objStockMessage.innerHTML = strMessage
}
}
}
}
function getSelectedValue(strObjId){
//WARNING!! In order to use getElementById with Firefox you must have the id property set in addition to the name property
objSelect=document.getElementById(strObjId)
if(objSelect){
//might be a list or might be a hidden text box
if(objSelect.options){
//might not have a selected index
if(objSelect.selectedIndex > 0){
strSelectedValue=objSelect.options[objSelect.selectedIndex].value
} else {
strSelectedValue=objSelect.options[0].value
}
} else {
strSelectedValue=objSelect.value
}
} else {
strSelectedValue = ""
}
return strSelectedValue
}