var _MAX_PRODUCTS=3;
var currentOptionSet=0;
var productInfo={};
var dataRequestCount=0;
var resetOptions;
var passedDataTest=false;
var clearance=false;
var widthMapping=[["X-Narrow","2AA","NN"],["Narrow","2A","3A","4A","5A","A","B","N","SL","SS"],["Medium","M","B","D","Z","YTH"],["Wide","2E","3E","4E","5E","6E","C","E","F","MW","W"],["X-Wide","WW","XW"],["None","NA"]];
if($("leftNavHeader")){$("leftNavHeader").setStyles({width:"140px"})
}var failureText="Sorry, but this content is currently unavailable. Please contact technical support for assistance.";
window.addEvent("domready",function(){addProductOptions();
if(showLocatorOnLoad){openStockLocator()
}});
function doAddToBag(){for(var i=1;
i<=3;
i++){if($("selQuantity"+i)!=null){$("qty"+i).value=$("selQuantity"+i).value
}}if(sizeSelected()){$("sizeSelected").set("value","true")
}else{$("sizeSelected").set("value","false")
}if(widthSelected()){$("widthSelected").set("value","true")
}else{$("widthSelected").set("value","false")
}if(colorSelected()){$("colorSelected").set("value","true")
}else{$("colorSelected").set("value","false")
}$("addToBagForm").submit()
}function addProductOptions(){++currentOptionSet;
var strOptionSet=currentOptionSet.toString();
var previousOptionSet=(currentOptionSet-1).toString();
if(skuId!=""){var selectedSku=getSku(skuId);
if(selectedSku){$("sizeValue").set("value",selectedSku.size.id);
$("widthValue").set("value",selectedSku.width.widthCode);
$("colorValue").set("value",selectedSku.color.id)
}}fetchData(strOptionSet);
if(qty!=null&&qty.length>0){$("selQuantity1").value=qty
}if($("sizeSelected").get("value")=="false"){$("sizeOptionHeader"+currentOptionSet).className="errorHeader"
}if($("widthSelected").get("value")=="false"){$("widthOptionHeader"+currentOptionSet).className="errorHeader"
}if($("colorSelected").get("value")=="false"){$("colorOptionHeader"+currentOptionSet).className="errorHeader"
}updateForm(strOptionSet)
}function updateForm(optionSet){if(productInfo.details){var size,width,color;
if(productInfo.details.sizesInputType=="button"){$$("#sizes"+optionSet+" .buttonActive").each(function(el){size=escape(el.id.replace("sizes"+optionSet+"_",""))
});
$("sizeValue").set("value",size)
}else{if(productInfo.details.sizesInputType=="option"){size=($("sizes"+optionSet).value=="Select One")?"":$("sizes"+optionSet).value;
$("sizeValue").set("value",size)
}}if(productInfo.details.widthsInputType=="button"){$$("#widths"+optionSet+" .buttonActive").each(function(el){width=escape(el.id.replace("widths"+optionSet+"_",""))
});
$("widthValue").set("value",width)
}if(productInfo.details.colorsInputType=="swatch"){$$("#colors"+optionSet+" .swatchActive").each(function(el){color=escape(el.id.replace("colors"+optionSet+"_",""))
});
$("colorValue").set("value",color)
}}}function createButton(choice,optionSet,option,idx){var styles={};
if(choice=="widths"){for(var i=0;
i<widthMapping.length;
i++){if(widthMapping[i].contains(option.label)){option.label=widthMapping[i][0];
break
}}styles={"font-weight":"normal","font-size":"10px","padding-top":"4px","min-width":"56px",width:"auto",height:"25px","text-transform":"uppercase","text-align":"center"}
}var buttonId=choice+optionSet+"_"+option.id;
var button=new Element("button",{id:buttonId,name:buttonId,value:option.id,styles:styles}).set("html",option.label);
if((productInfo.choices[choice].length>1)){var isiPad=navigator.userAgent.match(/iPad/i)!=null;
if(!isiPad){button.addEvent("mouseenter",buttonAction.pass([buttonId,"onmouseover",1]));
button.addEvent("mouseleave",buttonAction.pass([buttonId,"onmouseout",1]))
}button.addEvent("click",function(){buttonAction(buttonId,"onclick",1);
updateData(optionSet);
return(false)
})
}if(option.enabled){button.className=(option.selected)?"buttonActive":"buttonNormal"
}else{button.className="buttonDisabled";
button.set("disabled","disabled")
}button.injectInside($(choice+optionSet));
if((productInfo.choices[choice].length==1)&&option.enabled){$(buttonId).className="buttonActive";
$(buttonId).set("disabled","")
}else{if((dataRequestCount==1&&option.id==productInfo.details[choice+"Default"])&&option.enabled){$(buttonId).className="buttonActive";
$(buttonId).set("disabled","")
}else{var size=$("sizeValue").value;
if(size!=null&&size==option.id){$(buttonId).className="buttonActive";
$(buttonId).set("disabled","")
}var width=$("widthValue").value;
if(width!=null&&width==option.id){$(buttonId).className="buttonActive";
$(buttonId).set("disabled","")
}}}}function createOption(choice,optionSet,option,idx){if(option.enabled){var selOption=new Element("option",{id:choice+optionSet+"_"+option.id,value:option.id,text:option.label});
insertOption($(choice+optionSet),selOption);
if(dataRequestCount==1){$(choice+optionSet).addEvent("change",function(){if(!sizeSelected()){resetOptions=true
}updateData(optionSet)
})
}var x=$("sizeValue").value;
var y=option.id;
if((productInfo.choices[choice].length==1)&&option.enabled){$("sizeValue").set("value",option.id)
}else{if(dataRequestCount==1&&option.selected){$("sizeValue").set("value",option.id)
}else{if((dataRequestCount==1&&option.id==productInfo.details[choice+"Default"])&&option.enabled){$("sizeValue").set("value",option.id)
}}}}}function createSwatch(choice,optionSet,option,idx){var swatchId=choice+optionSet+"_"+option.id;
var swatchSrc=s7Address+productId+"_"+option.colorCode+"_ss_sw?$slswatches$";
if($("skuPrice")&&$("skuPrice").hasClass("clearance")){$("skuPrice_Color"+optionSet).removeClass("price");
$("skuPrice_Color"+optionSet).addClass("clearance")
}if(option.clearance){clearance=true
}var swatch=new Element("img",{src:swatchSrc,id:swatchId,value:option.id,alt:option.label,title:option.label,border:"0"}).setStyle("cursor","pointer");
if((productInfo.choices[choice].length>1)){var isiPad=navigator.userAgent.match(/iPad/i)!=null;
if(!isiPad){swatch.addEvent("mouseenter",function(){if(this.className!="swatchDisabled"){if($("productImageViewer")&&$("productImageViewer").spinset){var code=this.get("src").replace(/^.*_([0-9]+)_ss_sw.*$/,"$1");
$("productImageViewer").spinset.focusColor(code)
}if(this.className!="swatchActive"){this.addClass("swatchActiveTemporary")
}}});
swatch.addEvent("mouseleave",function(){if(this.className!="swatchDisabled"){if(this.hasClass("swatchActiveTemporary")){this.removeClass("swatchActiveTemporary")
}if($("productImageViewer")&&$("productImageViewer").spinset){$("productImageViewer").spinset.unfocusColor()
}}})
}swatch.addEvent("click",function(){if($(swatchId).className!="swatchDisabled"){var currentColor=document.getElements("#"+$(swatchId).parentNode.id+" img.swatchActive");
var activate=false;
if(currentColor.length>0){if($(swatchId).className=="swatchActive"){$(swatchId).className="swatchNormal"
}else{activate=true;
currentColor[0].className="swatchNormal";
$(swatchId).className="swatchActive"
}}else{activate=true;
$(swatchId).className="swatchActive"
}if(activate&&$("productImageViewer")&&$("productImageViewer").spinset){$("productImageViewer").spinset.selectColor(option.colorCode);
$("ColorLabel"+optionSet).set("html"," - "+option.label)
}else{if(!activate&&$("productImageViewer")&&$("productImageViewer").spinset){$("productImageViewer").spinset.unselectColor();
$("ColorLabel"+optionSet).set("html","")
}}updateData(optionSet)
}return(false)
})
}if(option.selected){swatch.className="swatchActive";
if(!window.colorEnforcement){var enforceColorSelection=function(){if($("productImageViewer")&&$("productImageViewer").spinset){$("productImageViewer").spinset.selectColor(option.colorCode);
window.colorEnforcement=true
}else{enforceColorSelection.delay(500)
}};
enforceColorSelection()
}$("ColorLabel"+optionSet).set("html"," - "+option.label)
}else{swatch.className="swatchNormal"
}var color=$("colorValue").get("value");
if(color!=null&&color==option.id){if(!window.colorEnforcement){var enforceColorSelection=function(){if($("productImageViewer")&&$("productImageViewer").spinset){$("productImageViewer").spinset.selectColor(option.colorCode);
window.colorEnforcement=true
}else{enforceColorSelection.delay(500)
}};
enforceColorSelection()
}swatch.className="swatchActive"
}if(!option.enabled){swatchSrc=s7Address+"/na4?$slswatches$&$layer_1_src="+productId+"_"+option.colorCode+"_ss_sw";
swatch.set("src",swatchSrc);
swatch.className="swatchDisabled";
swatch.setStyles({opacity:"0.8",cursor:"default"})
}swatch.injectInside($(choice+optionSet));
if(referrerPage!="shoppingBag"){if((choice=="colors")&&productInfo.choices[choice].length==1){if((choice=="colors")&&(idx==0)&&option.enabled){$(swatchId).className="swatchActive";
$("ColorLabel"+optionSet).set("html"," - "+option.label);
updateData(optionSet)
}else{if(dataRequestCount==1&&option.id==productInfo.details[choice+"Default"]){$(swatchId).className="swatchActive"
}}}}}function widthSelected(){var widthElements=$("widths1").getChildren();
var i=0;
for(i=0;
i<widthElements.length;
i++){if(widthElements[i].tagName=="BUTTON"&&widthElements[i].className=="buttonActive"){return true
}}return false
}function sizeSelected(){if($("sizes1").tagName=="SELECT"){return $("sizes1").options[$("sizes1").selectedIndex].text!="Select One"
}else{var sizeElements=$("sizes1").getChildren();
var i=0;
for(i=0;
i<sizeElements.length;
i++){if(sizeElements[i].tagName=="BUTTON"&&sizeElements[i].className=="buttonActive"){return true
}}return false
}}function colorSelected(){var colorElements=$("colors1").getChildren();
var i=0;
for(i=0;
i<colorElements.length;
i++){if(colorElements[i].tagName=="IMG"&&colorElements[i].className=="swatchActive"){return true
}}return false
}function updateButton(choiceId,option){if(option.enabled&&!$(choiceId).hasClass("buttonNormal")){if(option.selected){$(choiceId).className="buttonActive"
}else{$(choiceId).className="buttonNormal"
}$(choiceId).set("disabled","")
}else{if(!option.enabled&&($(choiceId).hasClass("buttonNormal")||$(choiceId).hasClass("buttonActive"))){$(choiceId).className="buttonDisabled";
$(choiceId).set("disabled","disabled")
}}}function updateOption(choice,choiceId,optionSet,option){if(!option.enabled&&!$(choiceId).disabled){var i=0;
for(i=$(choice+optionSet).length-1;
i>=0;
i--){if($(choice+optionSet).options[i].id==choice+optionSet+"_"+option.id){$(choice+optionSet).options[i]=null
}}}}function updateSwatch(choiceId,option,idx,optionSet){if(option.enabled&&!$(choiceId).hasClass("swatchNormal")){$(choiceId).src="http://s7d2.scene7.com/is/image/DSWShoes/"+productId+"_"+option.colorCode+"_ss_sw?$slswatches$";
if(option.clearance){clearance=true
}if(option.selected){$(choiceId).className="swatchActive";
$("ColorLabel"+optionSet).set("html"," - "+option.label)
}else{$(choiceId).className="swatchNormal"
}$(choiceId).setStyles({opacity:"1",cursor:"pointer"})
}else{if(!option.enabled&&($(choiceId).hasClass("swatchNormal")||$(choiceId).hasClass("swatchActive"))){$(choiceId).src="http://s7d2.scene7.com/is/image/DSWShoes//na4?$slswatches$&$layer_1_src="+productId+"_"+option.colorCode+"_ss_sw";
$(choiceId).className="swatchDisabled";
$(choiceId).setStyles({opacity:"0.8",cursor:"default"})
}}}function prepareChoices(optionSet){var sizeNum=0;
var widthNum=0;
var colorNum=0;
var EnvFlag=location.hostname;
if(productInfo.details.productType=="shoe"||productInfo.details.productType=="kids shoes"){$("sizeChartOptionLink").setStyle("display","block")
}for(var choice in productInfo.choices){productInfo.choices[choice].each(function(option,idx){var choiceId=choice+optionSet+"_"+option.id;
if($(choiceId)){switch(productInfo.details[choice+"InputType"]){case"button":updateButton(choiceId,option);
break;
case"option":updateOption(choice,choiceId,optionSet,option);
break;
case"swatch":updateSwatch(choiceId,option,idx,optionSet);
break
}}else{switch(productInfo.details[choice+"InputType"]){case"button":createButton(choice,optionSet,option,idx);
break;
case"option":createOption(choice,optionSet,option,idx);
break;
case"swatch":createSwatch(choice,optionSet,option,idx);
break
}}});
if(productInfo.choices[choice].length==0&&$("fit"+choice+optionSet)){$("fit"+choice+optionSet).setHTML("")
}else{if(!$(choice+optionSet+"_clear")&&["button","swatch"].contains(productInfo.details[choice+"InputType"])){new Element("div",{id:choice+optionSet+"_clear"}).addClass("clear").injectInside($(choice+optionSet))
}}}if(dataRequestCount==1){productInfo.skus.each(function(option){if(skuId!=null&&skuId.length>0){$("sku"+optionSet).value=skuId;
$("qty"+optionSet).name=skuId
}else{$("sku"+optionSet).value=option.id;
$("qty"+optionSet).name=option.id
}$("prod"+optionSet).value=productId;
if(option.price.length>0){if($("skuPrice")){$("skuPrice").set("html",option.price)
}if($("skuPrice_Color"+optionSet)){$("skuPrice_Color"+optionSet).set("html",option.price)
}}if(option.upc!=null&&option.upc.length>0){$("skuUPC").set("html","UPC # "+option.upc)
}if(option.msrp.length>0){$("skuCompareAt").set("html","Compare at "+option.msrp)
}});
sizeNum=productInfo.details.sizeNum;
widthNum=productInfo.details.widthNum;
colorNum=productInfo.details.colorNum;
if(widthNum==0&&colorNum==0&&sizeNum==0){$("addToBagButton").setStyle("display","none");
if(EnvFlag=="www.dsw.com"){$("soldOut").addClass("itemSoldOut");
$("soldOut").setStyle("width",$("productOptions").offsetWidth);
$("soldOut").setStyle("height",$("productOptions").offsetHeight);
$("soldOut").setStyle("text-align","center");
$("soldOut").set("html",'<img src="http://s7d2.scene7.com/is/image/DSWShoes/Product_Page_Sold_Out_Messaging?wid=195" alt="We are shoe, shoe sorry! We are currently sold out of this product. Try a category to the left or top to find more designer womens and mens shoes"/>');
$("productOptionsContainer").setStyle("opacity",0);
$("stockLocatorOr").setStyle("display","none")
}}skuId=""
}$("skuPrice_Color"+optionSet).set("html","");
productInfo.skus.each(function(option){$("sku"+optionSet).value=option.id;
$("prod"+optionSet).value=productId;
$("qty"+optionSet).name=option.id;
if(option!=null){if(option.clearance==true){if($("skuPrice")){$("skuPrice").set("html","Clearance");
$("skuPrice").removeClass("price");
$("skuPrice").addClass("clearance")
}if($("priceSelected")){$("priceSelected").set("html",option.price);
$("priceSelected").removeClass("priceSelected");
$("priceSelected").addClass("clearancePriceSelected")
}if($("skuPrice_Color"+optionSet)){$("skuPrice_Color"+optionSet).set("html",option.price);
$("skuPrice_Color"+optionSet).removeClass("price");
$("skuPrice_Color"+optionSet).addClass("clearance")
}}else{if(option.price!=null&&option.price.length>0){if($("skuPrice")){$("skuPrice").set("html",option.price);
$("skuPrice").removeClass("clearance");
$("skuPrice").addClass("price")
}if($("priceSelected")){$("priceSelected").set("html",option.price);
$("priceSelected").removeClass("clearancePriceSelected");
$("priceSelected").addClass("priceSelected")
}if($("skuPrice_Color"+optionSet)){$("skuPrice_Color"+optionSet).set("html",option.price);
$("skuPrice_Color"+optionSet).removeClass("clearance");
$("skuPrice_Color"+optionSet).addClass("price")
}}}if(option.stockLevel!=null&&option.stockLevel>0){var stockLevel=parseInt(option.stockLevel)||0;
var stockLevelThreshold=parseInt(productInfo.details.stockLevelThreshold)||0;
if(stockLevel>0&&stockLevel<=stockLevelThreshold){var lastValue=null;
$("sku_stockLevel").getParent().getElements("option").each(function(op){lastValue=op.get("value").toInt();
if(lastValue>stockLevel){op.dispose()
}});
if(stockLevel>lastValue){var max=(stockLevel+1);
var sel=$("sku_stockLevel").getParent().getElement("select");
for(var i=(lastValue+1);
i<max;
i++){new Element("option",{value:i}).set("html",i).inject(sel)
}}$("sku_stockLevel").set("html","ONLY "+stockLevel+" LEFT!");
$("sku_stockLevel").addClass("stockLevel")
}else{if(stockLevel!=0){$("sku_stockLevel").set("html","");
$("sku_stockLevel").removeClass("stockLevel");
var ops=$("sku_stockLevel").getParent().getElements("option");
if(ops.length<10){var sel=$("sku_stockLevel").getParent().getElement("select");
for(var i=ops.length+1;
i<11;
i++){new Element("option",{value:i}).set("html",i).inject(sel)
}}}}}else{$("sku_stockLevel").set("html","");
$("sku_stockLevel").removeClass("stockLevel")
}if(option.upc!=null&&option.upc.length>0){$("skuUPC").set("html","UPC # "+option.upc)
}if(option.msrp!=null&&option.msrp.length>0){$("skuCompareAt").set("html","Compare at "+option.msrp)
}}})
}function testData(){var i=0;
var results=[];
for(var choice in productInfo.choices){results[i]=false;
productInfo.choices[choice].each(function(option){if(option!=null&&option.enabled){results[i]=true
}});
i++
}var result=(results.contains(false)?false:true);
return(result)
}function setProductInfo(){var colorCode=$("colorValue").value;
var sizeCode=$("sizeValue").value;
var widthCode=$("widthValue").value;
var availableSizeSkus=getAvailableSkus(colorCode,widthCode,"");
var availableWidthSkus=getAvailableSkus(colorCode,"",sizeCode);
var availableColorSkus=getAvailableSkus("",widthCode,sizeCode);
if(colorCode!=""&&widthCode!=""&&sizeCode!=""){var selectedSku=getAvailableSkus(colorCode,widthCode,sizeCode)
}else{selectedSku=[]
}ProductData.details.sizeNum=availableSizeSkus.length;
ProductData.details.widthNum=availableWidthSkus.length;
ProductData.details.colorNum=availableColorSkus.length;
productInfo={choices:{sizes:updateSizes(availableSizeSkus),widths:updateWidths(availableWidthSkus),colors:updateColors(availableColorSkus)},details:ProductData.details,skus:[{id:"",upc:"",price:0,clearance:"",msrp:"",yousave:0}]};
if(selectedSku.length==1){productInfo.skus=[{id:selectedSku[0].sku,upc:selectedSku[0].upc,price:selectedSku[0].price,clearance:selectedSku[0].clearance,msrp:selectedSku[0].msrp,stockLevel:selectedSku[0].stockLevel,yousave:0}]
}}function getAvailableSkus(color,width,size){var retVal=new Array();
for(var i=0;
i<ProductData.skus.length;
i++){if(color!=""&&color!=ProductData.skus[i].color.id){continue
}if(size!=""&&size!=ProductData.skus[i].size.id){continue
}if(width!=""&&width!=ProductData.skus[i].width.widthCode){continue
}if(ProductData.skus[i].stockLevel>0){retVal.push(ProductData.skus[i])
}}return retVal
}function getSku(skuId){for(var i=0;
i<ProductData.skus.length;
i++){if(ProductData.skus[i].sku==skuId){return ProductData.skus[i]
}}}function updateSizes(availableSkus){var sizeOptions=new Array();
var id,label,enabled,selected,orderIndex;
for(var i=0;
i<ProductData.skus.length;
i++){id=ProductData.skus[i].size.id;
label=ProductData.skus[i].size.sizeDescription;
enabled=availableSkus.contains(ProductData.skus[i]);
selected=($("sizeValue").value==id);
c=new Choice(id,label,enabled,selected,orderIndex);
if(!c.isInArray(sizeOptions)){sizeOptions.push(c)
}else{if(c.enabled){c.enableInArray(sizeOptions)
}}}if(!isKidsProduct){sizeOptions.sort(function(a,b){if(ProductData.sizes["_"+a.id]==ProductData.sizes["_"+b.id]){return 0
}return(ProductData.sizes["_"+a.id]<ProductData.sizes["_"+b.id])?-1:1
})
}return sizeOptions
}function updateWidths(availableSkus){var widthOptions=new Array();
var id,label,enabled,selected,orderIndex;
for(var i=0;
i<ProductData.skus.length;
i++){id=ProductData.skus[i].width.widthCode;
label=ProductData.skus[i].width.widthName;
enabled=availableSkus.contains(ProductData.skus[i]);
selected=($("widthValue").value==id);
for(var w=0;
w<widthMapping.length;
w++){if(widthMapping[w].contains(label)){orderIndex=w;
break
}}c=new Choice(id,label,enabled,selected,orderIndex);
if(!c.isInArray(widthOptions)){widthOptions.push(c)
}else{if(c.enabled){c.enableInArray(widthOptions)
}}}widthOptions.sort(function(a,b){return a.orderIndex-b.orderIndex
});
return widthOptions
}function updateColors(availableSkus){var colorOptions=new Array();
var id,label,enabled,selected,orderIndex,colorCode,clearance,defaultColor;
for(var i=0;
i<ProductData.skus.length;
i++){id=ProductData.skus[i].color.id;
label=ProductData.skus[i].color.colorDescription;
enabled=availableSkus.contains(ProductData.skus[i]);
selected=($("colorValue").value==id);
colorCode=ProductData.skus[i].color.colorCode;
clearance="";
c=new Choice(id,label,enabled,selected,orderIndex,colorCode,clearance);
if(!c.isInArray(colorOptions)){colorOptions.push(c)
}else{if(c.enabled){c.enableInArray(colorOptions)
}}}colorOptions.sort(function(a,b){if(a.colorCode==b.colorCode){return 0
}if(a.colorCode>b.colorCode){return 1
}return -1
});
for(var i=0;
i<colorOptions.length;
i++){if(colorOptions[i].colorCode==ProductData.details.defaultColorCode){defaultColor=colorOptions.splice(i,1);
colorOptions.unshift(defaultColor[0]);
break
}}return colorOptions
}function Choice(id,label,enabled,selected,orderIndex,colorCode,clearance){this.id=id;
this.label=label;
this.enabled=enabled;
this.selected=selected;
this.orderIndex=orderIndex;
this.colorCode=colorCode;
this.clearance=clearance;
this.isInArray=function(array){for(var i=0;
i<array.length;
i++){if(array[i].id==this.id){return true
}}return false
};
this.enableInArray=function(array){for(var i=0;
i<array.length;
i++){if(array[i].id==this.id){array[i].enabled=true;
break
}}}
}Array.prototype.contains=function(value){for(var i=0;
i<this.length;
i++){if(this[i]==value){return true
}}return false
};
function getInStockColorCodes(){var inStockColors=[];
var i,parsedSku;
if(ProductData&&ProductData.skus.length>0){for(i=0;
i<ProductData.skus.length;
i++){parsedSku=parseSku(ProductData.skus[i].sku);
if(ProductData.skus[i].stockLevel!=0&&!inStockColors.contains(parsedSku.colorCode)){inStockColors.push(parsedSku.colorCode)
}}}return inStockColors
}function fetchData(optionSet){if(dataRequestCount==0||passedDataTest){dataRequestCount++;
setProductInfo();
var inStockColors=getInStockColorCodes();
if(inStockColors.length>0){var inStockCount=inStockColors.length;
var colorChoiceCount=productInfo.choices.colors.length;
var inStockColorchoices=[];
for(var j=0;
j<colorChoiceCount;
j++){for(var i=0;
i<inStockCount;
i++){if(inStockColors[i]==productInfo.choices.colors[j].colorCode){inStockColorchoices[inStockColorchoices.length]=productInfo.choices.colors[j]
}}}if(productInfo.details.colorsDefault!=""){productInfo.choices.colors=[];
for(var i=0;
i<inStockColorchoices.length;
i++){if(inStockColorchoices[i].colorCode==productInfo.details.colorsDefault){productInfo.choices.colors[0]=inStockColorchoices[i]
}}for(var i=0;
i<inStockColorchoices.length;
i++){if(inStockColorchoices[i].colorCode!=productInfo.details.colorsDefault&&!productInfo.choices.colors.contains(inStockColorchoices[i])){productInfo.choices.colors[productInfo.choices.colors.length]=inStockColorchoices[i]
}}}else{productInfo.choices.colors=inStockColorchoices
}}if(!passedDataTest){passedDataTest=testData()
}prepareChoices(optionSet)
}}function updateData(optionSet){updateForm(optionSet);
fetchData(optionSet)
}function insertOption(select,option){option.inject(select,"bottom");
if(!isKidsProduct||(isKidsProduct&&select.id.indexOf("size")!=0)){var x=$A(select.getElements("option")).sort(function(a,b){var left=parseInt(a.text);
var right=parseInt(b.text);
if(isNaN(left)){left=-1
}if(isNaN(right)){right=-1
}return left-right
})
}else{var x=$A(select.getElements("option"))
}select.getElements("option").dispose();
var optionSelected=0;
x.each(function(o,i){o.inject(select,"bottom");
var x=o.value;
var y=$("sizeValue").value;
if(y!=""&&x==y){optionSelected=i
}});
select.getElements("option")[optionSelected].set("selected","true")
}function openStockLocator(){var multiplePrice=($("multiplePrice")!=null)?$("multiplePrice").value:"false";
var qs="prodId="+$("prodId").value+"&sizeCode="+$("sizeValue").value+"&widthCode="+$("widthValue").value+"&colorId="+$("colorValue").value+"&categoryName="+$("categoryName").value+"&categoryId="+$("categoryId").value+"&multiplePrice="+multiplePrice;
ModalWindow.stockLocatorModalWindow("/dsw_shoes/catalog/modals/stockLocator.jsp?"+qs,"Find It In Store","741 0 noscroll")
};
