var ns4, ie4, ie5, moz; ns4 = (document.layers)? true:false; ie4 = (document.all)? true:false; ie5 = (document.getElementByID && document.all)? true:false; moz = (document.getElementById)?true:false; var aPC = new Array(); var aPI = new Array(); var isW3 = (document.getElementById && true); OLpageDefaults(FGCOLOR,'#eeeeee', CAPTIONPADDING, 4, RELY,20, TEXTPADDING,4, BASE, 2 ); var sPrice,cPrice,nPrice,yheight,xwidth; var sProdImgs=""; function AddBookmarks(url, title) { if (document.all) { window.external.AddFavorite(url,title);} else { window.sidebar.addPanel(title, url, '');}
}
function isString(a) { return typeof a == 'string';}
function enterValue(theObj){ alert('Please enter a value where indicated.'); theObj.focus(); return(false);}
function chooseOption(theObj){ alert('Please choose from the available product options.'); theObj.focus(); return(false);}
function dataLimit(theObj){ alert('Please enter a maximum of 255 chars in the field indicated.'); theObj.focus(); return(false);}
function OutputSlider(sCSV, nParent) { parts=sCSV.split(","); switch (parts[2].toLowerCase()) { case "apparel":
if (setOptions (nParent , parts, 11 , 3, 4, 11, "apparel") == 1) { try { jQuery(".messaging",$(".apparel")).css("display","none"); jQuery(".next",$(".apparel")).css("display","block");}
catch (err) { }
} else { try { $(function() { $(".apparel").accessNews({ newsHeadline: "", newsSpeed: "normal"
});});}
catch(err) { }
}
break; case "color":
if (setOptions (nParent , parts, 6 , 3, 4, 5, "color") == 1) { try { jQuery(".messaging",$(".color")).css("display","none");}
catch (err) { alert("error");}
} else { try { $(function() { $(".color").accessNews2({ newsHeadline: "", newsSpeed: "normal"
});});}
catch (err) { }
}
break; case "size":
break;}
}
function setOptions (nIndex, parts, nRecLength, nNameIndex, nCostIndex, ImgIndex, sType) { var sOutput = ""; aOpts=new Array(); var c=0; var f=0; for (nI=0; nI<=nRecLength; nI++) { aOpts[nI]=new Array();}
while (c < parts.length) { if (parts[c]==nIndex) { for (nI=0; nI<=nRecLength; nI++) { aOpts[nI][f] = parts[c+nI];}
f++;}
c = c + nRecLength+1;}
nNumSliderItems = 0; for (nI=0; nI<f; nI++) { if (aOpts[0][nI]==nIndex) { sOptionName = aOpts[nNameIndex][nI]; sOptionName = sOptionName.replace("'",""); sOptURL = aOpts[ImgIndex][nI]; nNumSliderItems++; sURL = "http://"; if (sType=="apparel") { sURL = "nPrice="+ aOpts[4][nI]+"; cPrice=0; sPrice=0; toggleBox('overDiv', 0); CalculateTotalPrice('tForm0'); showProduct("+aOpts[1][nI]+", '"+aOpts[5][nI]+"', "+aOpts[7][nI]+", "+aOpts[8][nI]+"); LoadTopic("+aOpts[1][nI]+", 'prod_info_box', 1); objFormVar = document.tForm0; objFormVar.cboApp0.value="+ aOpts[1][nI] +"; showSelected('"+ sOptURL +"', '"+ sOptionName +"', '"+ sType +"', true); if (objFormVar.hidClr0) { BlankSelection('size'); OutputSlider(document.tForm0.hidClr0.value, "+aOpts[1][nI]+");}  else if (objFormVar.cboSize0) {FindSize('tForm0');}"; nHeight = 50; nBorder = 0; sClassItemIndex = "";}
if (sType=="color") { if (nI==0) bcolor("#"+aOpts[6][0], "main_img"); sURL = "cPrice="+ aOpts[4][nI] +"; sPrice=0; toggleBox('overDiv', 0); CalculateTotalPrice('tForm0'); objFormVar = document.tForm0; objFormVar.cboClr0.value="+ aOpts[1][nI] +"; showSelected('"+ sOptURL +"', '"+ sOptionName +"', '"+ sType +"', true); bcolor('#"+aOpts[6][nI]+"', 'main_img'); FindSize('tForm0');"; nHeight = 20; nBorder = 1; sClassItemIndex = "2";}
if (aOpts[nCostIndex][nI] != 0) { sSign=" (+"; if (aOpts[nCostIndex][nI] < 0)
sSign = " (-"; sOptionName = sOptionName + sSign + formatCurrency(Math.round(Math.abs(aOpts[nCostIndex][nI])*100.0)/100.0) + ")";}
sOutput = sOutput + '<div class="item'+ sClassItemIndex +' fl"><a class="opacityit" href="javascript:'+ sURL +' void(0);" title="'+sOptionName+'"><img src="'+ sOptURL +'" height="'+ nHeight +'" border="'+nBorder+'" alt="'+ sOptionName +'" class="fl" /></a></div>';}
}
if (f==1) { eval(sURL);} else { if (sType=="apparel") alterDivContent("apparelcontainer", "<div id='apparelslider' class='container fl'>"+sOutput+"</div>"); if (sType=="color") alterDivContent("colorcontainer", "<div id='colorslider' class='container fl'>"+sOutput+"</div>");}
return f;}
function formatCurrency(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num))
num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents<10)
cents = "0" + cents; for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + '$' + num + '.' + cents);}
function alterDivContent(sID, theText) { var bvalid = document.all||document.getElementById||document.layers
if (!bvalid) { alert("We apologize, but this webpage does not support your browser. Please use a Firefox, MS IE, Opera, or Safari browser."); return false;}
if (document.all||document.getElementById) { if (!document.getElementById(sID)) return false; document.getElementById(sID).innerHTML = theText;} else { if (document.layers) { var lyr = document.layers[sID].document; lyr.open(); lyr.write(theText); lyr.close();} else
alert("We apologize, but this webpage does not support your browser. Please use a Firefox, MS IE, Opera, or Safari browser."); return false;}
}
function BlankBkgnd(divIDobj) { if ((browser.isIE55 || browser.isIE6up) && browser.isWin32 ) { divIDobj.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";}
divIDobj.background = "";}
function bcolor(bcol, cel) { if (document.all) { var thestyle = eval ('document.all.'+cel+'.style'); thestyle.backgroundColor=bcol;} else { document.getElementById(cel).style.backgroundColor = bcol
}
}
function ChangeBackgroundImage(idCell, imgName) { document.getElementById(idCell).style.backgroundRepeat = "no-repeat"; document.getElementById(idCell).style.backgroundPosition = "center center"; if ((browser.isIE55 || browser.isIE6up) && browser.isWin32 && imgName.match(/.*\.png.*/i) != null) { document.getElementById(idCell).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+imgName+"', sizingMethod='scale')";} else { document.getElementById(idCell).style.background = "url(" + imgName + ")";}
}
function SetBkgndColor(divID, newcolor) { sPreviousColor = ''; if(document.layers) { sPreviousColor = document.layers[divID].bgColor; document.layers[divID].bgColor = newcolor;}
if(document.all) { eval("sPreviousColor = document.all."+divID+".style.backgroundColor;"); eval("document.all."+divID+".style.backgroundColor = newcolor;");}
if(!document.all && document.getElementById) { sPreviousColor = document.getElementById(divID).style.backgroundColor; document.getElementById(divID).style.backgroundColor = newcolor;}
return sPreviousColor;}
function BlankSelection(sType) { if (sType=="color") { OutputSlider(document.tForm0.hidClr0.value, 0); document.tForm0.cboClr0.value=""; cPrice="0"; CalculateTotalPrice("tForm0");} else { document.tForm0.cboSize0.options.length=0; document.tForm0.cboSize0.options[0]=new Option('Select a size','0'); sPrice="0"; CalculateTotalPrice("tForm0");}
}
function FindSize(sFormName) { var objApp, objColor, objSize; eval("objApp=document."+ sFormName +".cboApp0;"); eval("objColor=document."+ sFormName +".cboClr0;"); eval("objSize=document."+ sFormName +".cboSize0;"); if (objSize) { objSize.focus(); objSize.style.background='#cc3300'; objSize.style.color='#FFFFFF';}
sPrice=0; var tempColor; cPrice=0; if (objColor) { tempColor = objColor.value; var strColor; eval("strColor=document."+ sFormName +".hidClr0.value;"); partsColor=strColor.split(","); var priceFirst=new Array(); priceFirst[0]=new Array(); priceFirst[1]=new Array(); var x=0; var y=0; while (x<partsColor.length) { priceFirst[0][y]=partsColor[x+1]; priceFirst[1][y]=partsColor[x+4]; y++; x+=6;}
for(t=0; t<y; t++) { if(priceFirst[0][t] == tempColor) { cPrice=priceFirst[1][t];}
}
}
if (objSize) { var str; eval("str=document."+ sFormName +".hidSize0.value;"); objSize.length=0; var k=0; parts=str.split(","); first=new Array(); first[0]=new Array(); first[1]=new Array(); first[2]=new Array(); first[3]=new Array(); first[4]=new Array(); var nI=0; while (nI<parts.length) { first[0][k]=parts[nI]; first[1][k]=parts[nI+1]; first[2][k]=parts[nI+2]; first[3][k]=parts[nI+3]; first[4][k]=parts[nI+4]; nI+=5; k++;}
matchvalue = ""
if (objColor)
matchvalue = objColor.value; else { if (objApp)
matchvalue = objApp.value;}
var m=0; var p=0; temp="Select "+first[2][0].toLowerCase(); objSize.length=0; objSize.options[0]=new Option(temp,"0"); while (m<k) { if(matchvalue==first[0][m] || matchvalue=="") { sOptionName = first[3][m]; if (first[4][m] != 0) { sSign=" (+"; if (first[4][m] < 0)
sSign = " (-"; sOptionName = sOptionName + sSign + formatCurrency(Math.round(Math.abs(first[4][m])*100.0)/100.0) + ")";}
temp=first[3][m]; val=first[1][m]; objSize.options[p+1]=new Option(sOptionName,val); p++;}
m++;}
}
}
function CalculateTotalPrice(sFormName) { var nBaseVal=0; var pDiv; eval("nBaseVal=document."+ sFormName +".hidBase0.value;"); tPrice=Number( (nPrice?nPrice:0) )+Number( (cPrice?cPrice:0) )+Number( (sPrice?sPrice:0) )+Number( (nBaseVal?nBaseVal:0) ) + updateprice0(); alterDivContent('pricediv', formatCurrency(Math.round(tPrice*100.0)/100.0));}
function CalSizePrice(sFormName) { var objSize; eval("objSize=document."+ sFormName +".cboSize0;"); objSize.style.background='#FFFFFF'; objSize.style.color='Black'; sPrice=0; var str; eval("str=document."+ sFormName +".hidSize0.value;"); var parts=str.split(","); var arrprice=new Array(); arrprice[0]=new Array(); arrprice[1]=new Array(); var x=0; var y=0; while (x<parts.length) { arrprice[0][y]=parts[x+1]; arrprice[1][y]=parts[x+4]; y++; x+=5;}
var k; for(k=0;k<y;k++) { str = objSize.value; if(str == arrprice[0][k]) { sPrice=arrprice[1][k];}
}
CalculateTotalPrice(sFormName);}
sGblDivID = ""; sGblBkgnd = ""; function LoadTopic(appID, sDivID, nType) { sIDType="pt_app_lookup"; if (nType==1) sIDType="pt_app_lookup"; if (nType==2) sIDType="app_lookup"; sRestoreBkgndColor = SetBkgndColor(sDivID, '#CCCCCC'); sGblDivID = sDivID; sGblBkgnd = sRestoreBkgndColor; OLpostAJAX('ajax_content.asp', 'topic='+ sIDType +'&id='+ appID, display_content);}
function display_content() { oXML=OLhttp.responseXML; var sAltAppTypes = ""; var Features = ""; sContent = ""; if (!oXML.getElementsByTagName('ERROR_STATUS')[0]) return; if (oXML.getElementsByTagName('ERROR_STATUS')[0].firstChild.data!='OK') return; nCounter = 0; var items = oXML.getElementsByTagName("RECORD"); for (var i = 0 ; i < items.length ; i++) { var item = items[i]; if (item.getElementsByTagName("PID")[0].firstChild)
var pID = item.getElementsByTagName("PID")[0].firstChild.nodeValue; if (item.getElementsByTagName("TITLE")[0].firstChild)
var nameid = item.getElementsByTagName("TITLE")[0].firstChild.nodeValue; if (item.getElementsByTagName("APPTYPE")[0].firstChild)
var ApparelType = item.getElementsByTagName("APPTYPE")[0].firstChild.nodeValue; if (item.getElementsByTagName("MARKETINGTEXT")[0].firstChild)
var MarketingText = item.getElementsByTagName("MARKETINGTEXT")[0].firstChild.nodeValue; if (item.getElementsByTagName("FABRICTYPE")[0].firstChild)
var FabricType = item.getElementsByTagName("FABRICTYPE")[0].firstChild.nodeValue; if (item.getElementsByTagName("FABRICWEIGHT")[0].firstChild)
var FabricWeight = item.getElementsByTagName("FABRICWEIGHT")[0].firstChild.nodeValue; if (item.getElementsByTagName("BRAND")[0].firstChild)
var BrandName = item.getElementsByTagName("BRAND")[0].firstChild.nodeValue; if (item.getElementsByTagName("BRANDLOGOURL")[0].firstChild)
var BrandLogoURL = item.getElementsByTagName("BRANDLOGOURL")[0].firstChild.nodeValue; if (item.getElementsByTagName("MODEL")[0].firstChild)
var ModelNumber = item.getElementsByTagName("MODEL")[0].firstChild.nodeValue; if (item.getElementsByTagName("FEATURES")[0].firstChild)
Features = item.getElementsByTagName("FEATURES")[0].firstChild.nodeValue; if (item.getElementsByTagName("SIZES")[0].firstChild)
var Sizes = item.getElementsByTagName("SIZES")[0].firstChild.nodeValue; if (item.getElementsByTagName("MICROIMGMURL")[0].firstChild)
var MicroImgURL = item.getElementsByTagName("MICROIMGMURL")[0].firstChild.nodeValue; if (item.getElementsByTagName("SMLIMGMURL")[0].firstChild)
var SmlImgURL = item.getElementsByTagName("SMLIMGMURL")[0].firstChild.nodeValue; if (item.getElementsByTagName("MEDIMGMURL")[0].firstChild)
var MedImgURL = item.getElementsByTagName("MEDIMGMURL")[0].firstChild.nodeValue; if (item.getElementsByTagName("LRGIMGMURL")[0].firstChild)
var LargeImgURL = item.getElementsByTagName("LRGIMGMURL")[0].firstChild.nodeValue; if (nCounter==0) { alterDivContent("nameid", nameid); if (!MarketingText || MarketingText=="") MarketingText = "We only choose the highest quality garments for your apparel.  Not only are these durable and guaranteed, but we only use well-known brands that have a reputation of meeting our high standards."
alterDivContent("marketingtext", MarketingText); if (!BrandLogoURL || BrandLogoURL=="") { alterDivContent("brandlogourl", ""); toggleBox("prodrow", 0);} else { alterDivContent("brandlogourl", "<img src=\""+ BrandLogoURL +"\" style=\"border: 1px solid #CCCCCC\" title=\""+ BrandName +"\"/>"); toggleBox("prodrow", 1);}
alterDivContent("modelnumber", "<b>Model:</b> "+ ModelNumber); alterDivContent("fabricweight", "FABRIC WEIGHT<br />"+ FabricWeight +" "+ FabricType); fWeight = parseFloat(FabricWeight); if (!FabricWeight || FabricWeight=="varies" || fWeight==0 || FabricWeight=="") { alterDivContent("fabricweightscale", ""); toggleBox("fabricrow", 0);} else { sImg = ""; if (fWeight < 4.5) sImg="scale_42"; if (fWeight >= 4.5 && fWeight < 5.2) sImg="scale_50"; if (fWeight >= 5.2 && fWeight < 5.8) sImg="scale_55"; if (fWeight >= 5.8 && fWeight < 6.2) sImg="scale_61"; if (fWeight >= 6.2 && fWeight < 6.7) sImg="scale_65"; if (fWeight >= 6.7 && fWeight < 7.2) sImg="scale_70"; if (fWeight >= 7.2 && fWeight < 7.8) sImg="scale_75"; if (fWeight >= 7.8 && fWeight < 8.5) sImg="scale_80"; if (fWeight >= 8.5 && fWeight < 9.2) sImg="scale_90"; if (fWeight >= 9.2 && fWeight < 9.8) sImg="scale_95"; if (fWeight >= 9.8 && fWeight < 10.4) sImg="scale_100"; if (fWeight >= 10.4) sImg="scale_110"; if (sImg != "") { alterDivContent("fabricweightscale", "<img src=\"../images/ds/apparel/"+ sImg +".gif\" width=\"60\" height=\"60\" style=\"border: 0px solid #CCCCCC\" />"); toggleBox("fabricrow", 1);}
}
Features = Features.replace(/\&bull;/g, ""); Features = Features.replace(/\r\n/g, "<br /> &bull; "); Features = Features.replace(/\n/g, "<br /> &bull; "); if (!Features || Features=="") { alterDivContent("features", "&nbsp;"); toggleBox("featurerow", 0);} else { toggleBox("featurerow", 1); alterDivContent("features", "&bull; "+Features);}
if (MedImgURL && MedImgURL != "") { alterDivContent("smlimgurl", "<img src=\""+ MedImgURL +"\" style=\"border: 1px solid #C0C0C0\" />"); toggleBox("imagerow1", 1); toggleBox("imagerow2", 1);} else { toggleBox("imagerow1", 0); toggleBox("imagerow2", 0); alterDivContent("smlimgurl", "&nbsp;");}
sAltAppTypes = " <a href=\"javascript: LoadTopic("+ pID +", 'appareldetails', 2); void(0);\">"+ BrandName +"</a>,"
} else { sAltAppTypes = " <a href=\"javascript: LoadTopic("+ pID +", 'appareldetails', 2); void(0);\">"+ BrandName +"</a>," + sAltAppTypes
}
nCounter++;}
if (nCounter > 1) { sAltAppTypes = "<BR /><b>Other possible brands used:</b><br />" + sAltAppTypes; sAltAppTypes = sAltAppTypes.substring(0,sAltAppTypes.length-2); alterDivContent("altappid", sAltAppTypes);} else { alterDivContent("altappid", "");}
SetBkgndColor(sGblDivID, sGblBkgnd);}
var bounceprotect = 0; function FixIMG1(sImgsrc, sDiv, max_x, max_y, ImagePath, posx, posy) { var imgPreview = new Image(); var randomnumber = Math.floor(Math.random()*10001)
imgPreview.onload = function(){eval("FixIMG2('"+sImgsrc+"', '"+sDiv+"', this.width, this.height, "+max_x+", "+max_y+", '"+ImagePath+"', "+posx+", "+posy+", "+randomnumber+");");}; imgPreview.src = ImagePath; if (imgPreview.width > 0 ) { FixIMG2(sImgsrc, sDiv, imgPreview.width, imgPreview.height, max_x, max_y, ImagePath, posx, posy, randomnumber)
}
}
function FixIMG2(sImgsrc, sDiv, nx2, ny2, max_x, max_y, ImagePath, posx, posy, randomnumber) { if (randomnumber != bounceprotect) { bounceprotect = randomnumber; if (nx2>max_x) {ny2=Math.round(ny2/(nx2/max_x)); nx2=max_x}
if (ny2>max_y) {nx2=Math.round(nx2/(ny2/max_y)); ny2=max_y;}
if (posx == -1) { posx = 142 - Math.round(nx2/2);} else { posx = Math.round(posx) + Math.round((142-nx2)/2)+8;}
if (posy == -1) { posy = 142 - Math.round(ny2/2);} else { nVadj = ((parseInt(10*nx2/ny2)-10))
if (nVadj < 0) nVadj = 0; posy = Math.round(posy) + Math.round(((120-ny2)/2)-nVadj);}
if (isNaN(posx)) { } else { if (document.getElementById) { eval("oDiv=document.getElementById('"+sDiv+"')");} else { eval ('oDiv = document.all.'+sDiv+'.style');}
oDiv.style.width=nx2+"px"; oDiv.style.height=ny2+"px"; oDiv.style.left=posx+"px"; oDiv.style.top=posy+"px"; eval("oImgsrc = document."+sImgsrc); oImgsrc.height=ny2; oImgsrc.width=nx2; if ((browser.isIE55 || browser.isIE6up) && browser.isWin32 && oImgsrc.src.match(/.*\.png.*/i) != null) { oImgsrc.style.width=nx2+'px'; oImgsrc.style.height=ny2+'px'; oImgsrc.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ ImagePath +"', sizingMethod='scale')"; oImgsrc.src='/images/clear.gif';}
}
}
}
function OLcmdExT1() { toggleBox('overDiv', 0); overlib(OLresponseAJAX, WIDTH, 240, STICKY, CLOSETEXT, 'CLOSE'); $('#overDiv').fadeIn('slow'); return true;}
function toggleBox(szDivID, iState) { if(document.layers) { document.layers[szDivID].visibility = iState ? "show" : "hide"; document.layers[szDivID].display = iState ? "" : "none";} else if(document.getElementById) { var obj = document.getElementById(szDivID); if (obj) { obj.style.visibility = iState ? "visible" : "hidden"; obj.style.display = iState ? "" : "none";}
} else if(document.all) { document.all[szDivID].style.visibility = iState ? "visible" : "hidden"; document.all[szDivID].style.display = iState ? "" : "none";}
}
function CenterXPos() { if(is.ns4 || is.ns6) { available_width = (window.innerWidth / 2) + window.pageXOffset;} else if(is.ie4 || is.ie5 || is.ieX) { available_width = (document.compatMode=="CSS1Compat")?document.documentElement.clientWidth : document.body.clientWidth; nscrollLeft = (document.compatMode=="CSS1Compat")?document.documentElement.scrollLeft : document.body.scrollLeft; available_width = (available_width / 2) + nscrollLeft;} else { available_width=document.body.offsetWidth;}
return (available_width - 20);}
