var arrCategoryName = new Array(); var arrCategories = new Array(); var boxType; //var firstActive=true; function displayInfo(id){ if(document.getElementById('spanActiveInfo')){ // if(firstActive){ if (boxType==2) { var tmpStr = "\n" tmpStr += "\n" tmpStr += " \n" tmpStr += " \n" tmpStr += " \n" tmpStr += "\n" tmpStr += "
\n" if(document.getElementById('compareVS')) document.getElementById('compareVS').style.visibility=""; if(document.getElementById('compareButton')) document.getElementById('compareButton').style.visibility=""; } else if (boxType==3) { var tmpStr = "\n"; tmpStr += "\n"; tmpStr += "
\n"; tmpStr += "\n"; tmpStr += "
\n"; tmpStr += "
\n"; // tmpStr += "
"; tmpStr += "\n"; tmpStr += "\n"; tmpStr += "\n"; tmpStr += "
"; tmpStr += ""; tmpStr += "
\n"; } else { var tmpStr = "\n"; tmpStr += "\n"; tmpStr += "
\n"; tmpStr += "\n"; tmpStr += "
\n"; tmpStr += "
\n"; // tmpStr += "
"; tmpStr += "\n"; tmpStr += "\n"; tmpStr += "\n"; tmpStr += "
\n"; tmpStr += "
\n"; } document.getElementById('spanActiveInfo').innerHTML = tmpStr; preload('pixel','/Files/Images/Layout/pixel.gif'); // } if(document.getElementById('imgBrandLogo')){ if(arrBrandLogo[id] != "") imgSwap('imgBrandLogo','imgBrandLogo'+id); else imgSwap('imgBrandLogo','pixel'); } if(document.getElementById('imgActiveImage')) imgSwap('imgActiveImage','imgProdBig'+id); if(document.getElementById('imgActiveLink')) document.getElementById('imgActiveLink').href=arrLinks[id]; if(document.getElementById('buttonLink')) document.getElementById('buttonLink').href=arrLinks[id]; //if(document.getElementById('imgActiveModelD')) imgSwap('imgActiveModelD','imgProdModelD'+id); if(document.getElementById('spanActiveModelD')) document.getElementById('spanActiveModelD').innerHTML = arrProductText[id]; //alert(arrProductDesc[id] + arrProductText[id]); if(document.getElementById('spanActiveDesc')) document.getElementById('spanActiveDesc').innerHTML = arrProductDesc[id]; } // firstActive = false; } var tmpActionText = "" function updateActionText(text){ if(tmpActionText != text){ document.getElementById('actiontext').innerHTML = text; document.getElementById('actiontext').style.left = (sliderWidth/2)-(parseInt(document.getElementById('actiontext').offsetWidth)/2); } tmpActionText = text; } var slide=false; function overStartSlide(blnAction, dir){ if(blnAction){ if (!slide) { if (!moving) moveTo(stopPos-prodMaxWidth*dir); slide = true; } }else{ slide = false; } } function startSlideRight(){ moveTo(stopPos+prodMaxWidth); } function startSlideLeft(){ moveTo(stopPos-prodMaxWidth); } function moveTo(pos2) { var tmpLength = 0; if(prodCounter == -1) tmpLength = arrProducts.length; else tmpLength = prodCounter; var tmpValue = (-(pos2/prodMaxWidth)+1); var tmpValue2 = tmpValue+(prodDisplayed-1); if(tmpLength prodDisplayed) updateActionText(""+txtShowingProduct+" "+tmpValue+""+txtTo+" "+tmpValue2+""+txtOfTotal+" "+tmpLength+" "+txtProducts+""); else updateActionText("" + topText + ""); stopPos = pos2; if(stopPos >= 0) hide("leftarrow"); else show("leftarrow"); //if(stopPos <= -(parseInt(document.getElementById('area').offsetWidth)-(sliderDisplayWidth+prodSpacerWidth))) hide("rightarrow"); if(stopPos <= -((tmpLength*(prodSpacerWidth+prodWidth))-(sliderDisplayWidth+prodSpacerWidth))) hide("rightarrow"); else show("rightarrow"); if (!moving) { moving = true; timerID = setInterval("doSlide()",13); } } var stopPos=0; var speed=0; var sumSpeed=0; var moving=false; var timerID = 0; function doSlide(){ areaobj = document.getElementById('area'); left = areaobj.offsetLeft; dir = (left-compPos && compPos<=0){ moveTo(compPos); }else sumSpeed-=(speed+=dir); }else sumSpeed-=(speed+=dir); }else if(Math.abs(speed)0 || absSpeed>1)) { clearInterval(timerID); moving = false; sumSpeed=speed=0; maxSpeed=secondaryMaxSpeed; } } var arrProductOrder = new Array(); var prodCounter = -1; var useDropdown = true; function showProductsByCategory(obj){ if(document.getElementById('spanActiveInfo')){ document.getElementById('spanActiveInfo').innerHTML = imgHeader; firstActive = true; } maxSpeed=segmentMaxSpeed; prodCounter = 0; for(var i = 0; i < arrProducts.length; i++){ if (Segment==-1) Segment = obj.value; if(Segment!= -1){ var temp = false; for(var j = 0; j < arrCategories[Segment].length; j++){ if(arrCategories[Segment][j] == arrCatId[i]){ temp = true; break; } } if(temp){ document.getElementById("product_"+i).style.display = "inline"; } else{ document.getElementById("product_"+i).style.display = "none"; } } else{ document.getElementById("product_"+i).style.display = "inline"; } if(document.getElementById("product_"+i).style.display == "inline") arrProductOrder[i] = prodCounter++; } speed=0; Segment=-1; init(); } function imageLoad(imgName) { var factor = 0; var Ymax = prodHeight; var Xmax = prodWidth; var Y = (oLarge=eval("document.getElementById('" + imgName + "')")).height; var X = oLarge.width; var Ys = .2*(Y *= factor = Math.min(Ymax/Y, Math.min(Xmax/X,1))); var Xs = .2*(X *= factor); oLarge.height = Y; oLarge.width = X; } function initImageLoad(){ for(var i = 0; i < arrProducts.length; i++){ imageLoad("i"+i); } } function isInString(txt){ var arrCookieInfo = getCookie("productCompare"); if(arrCookieInfo!=null){ arrCookieInfo = arrCookieInfo.split(","); for(i = 0; i < arrCookieInfo.length;i++){ if(txt == arrCookieInfo[i]) return " checked"; } } return ""; } /* function getCookie(name){ var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1){ begin = dc.indexOf(prefix); if (begin != 0) return null; } else{ begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1){ end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } */ function printSlider(){ var strSliderStart = "
\n"; var strSliderEnd = "
\n"; var strActionText = "
\n"; var strDropdown = ""; if(useDropdown){ var strDropdown = "
\n"; strDropdown += "\n"; strDropdown += "
\n"; if(document.getElementById('dropdownSelector')) document.getElementById('dropdownSelector').innerHTML = strDropdown; } var strLeftarrow = "
\n"; strLeftarrow += "\n"; strLeftarrow += "
\n"; strLeftarrow += "preload('img_arrowleft','"+imgArrowLeft+"');preload('img_arrowleft_w','"+imgArrowLeftActive+"');"; var strRightarrow = "
"; strRightarrow += "\n"; strRightarrow += "
\n"; strRightarrow += "preload('img_arrowright','"+imgArrowRight+"');preload('img_arrowright_w','"+imgArrowRightActive+"');"; var strContainerStart = "
\n"; var strContainerEnd = "
\n"; var strAreaStart = "
\n"; var strAreaEnd = "
\n"; var strProducts = ""; if(isCategory == true || "true" == "false") strProducts = "\n"; else strProducts = "
\n"; // strProducts += "\n"; for(var i = 0; i < arrProducts.length; i++){ strProducts += "\n"; arrProductOrder[i] = i; } strProducts += "\n"; strProducts += "
\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "
\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "\n"; if(isCategory == true || "true" == "false") strProducts += "\n"; else strProducts += "\n"; strProducts += "\n"; strProducts += "
\""+arrProductText[i]+"\"
"+arrProductText[i]+""+arrProductText[i]+"
\n"; //strProducts += "preload('imgProdModelD"+i+"','"+arrProductModelD[i]+"');preload('imgBrandLogo"+i+"','"+arrBrandLogo[i]+"');preload('imgProdBig"+i+"','"+arrProductsBig[i]+"');\n"; strProducts += "preload('imgBrandLogo"+i+"','"+arrBrandLogo[i]+"');preload('imgProdBig"+i+"','"+arrProductsBig[i]+"');\n"; strProducts += "
\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "\n"; strProducts += "
\n"; strProducts += "
\n"; strProducts += "
\n"; strProducts += "
\n"; var strOut = strSliderStart + strActionText + strLeftarrow + strRightarrow + strContainerStart + strAreaStart + strProducts + strAreaEnd + strContainerEnd + strSliderEnd; document.write(strOut); } function init(){ if(Segment!=-1) showProductsByCategory(document.getElementById('category')); document.getElementById('area').style.top = 0; if(prodCounter==-1) document.getElementById('area').style.left = -arrProducts.length*prodMaxWidth; else document.getElementById('area').style.left = -prodCounter*prodMaxWidth; //document.getElementById('container').style.width = arrProducts.length*prodMaxWidth; if(parseInt(document.getElementById('area').offsetWidth) < parseInt(sliderDisplayWidth+prodSpacerWidth)){ hide("leftarrow"); hide("rightarrow"); } else{ show("rightarrow"); hide("leftarrow"); } if(prodCounter==-1) { if(arrProducts.length