var currentIndex=0;var pages=new Array;var representative=new String();function AddOnload(a){if(window.addEventListener){window.addEventListener("load",a,false)}else{if(window.attachEvent){window.attachEvent("onload",a)}}}function BindThumbAnimation(){var e;var d;var a;var f=document.getElementById("thumbnails").getElementsByTagName("img");var c;for(var b=0;b<f.length;b++){f[b].onmouseover=function(){var k=/[0-9](?=\.)/;var l=this.src.search(k);var j=this.src.substr(l,1);var h=parseInt(j);c=this.src;a=this;var i=c;e=setTimeout(g,800);function g(){h+=1;if(h==6){h=1}i=i.replace(k,h);a.src=i;e=setTimeout(g,800)}};f[b].onmouseout=function(){clearTimeout(e);a.src=c}}}function showLargeImage(f,b,e,a){var d=document.getElementById(b);f=f.replace(/_s/,"");var c="http://static.summitracing.com/global/images/prod/large/";c+=f;d.src=c;currentIndex=e;representative=a.toString();PrevNextCheck();isRepresentativeCheck()}function PrevNextCheck(){if((currentIndex==0)&&(pages[0]==0)){document.getElementById("previous").childNodes[0].style.visibility="hidden"}else{document.getElementById("previous").childNodes[0].style.visibility="visible"}if(currentIndex==(imageNameArray.length-1)&&(pages[1]==0)){document.getElementById("next").childNodes[0].style.visibility="hidden"}else{document.getElementById("next").childNodes[0].style.visibility="visible"}}function isRepresentativeCheck(){if(representative==="True"){document.getElementById("image-messages").innerHTML='<p class="image-message">Image is a representation of this part. Actual part may vary.</p>'}else{var a=document.getElementById("image-messages");if(a.hasChildNodes()){while(a.childNodes.length>=1){a.removeChild(a.firstChild)}}}return false}function showNextLargeImage(a,c){var d=document.getElementById(a);if(currentIndex<(imageNameArray.length-1)){currentIndex+=1}else{document.location.href=document.getElementById("next").getElementsByTagName("a")[0].href}fileName=imageNameArray[currentIndex];fileName=fileName.replace(/_s/,"");var b="http://static.summitracing.com/global/images/prod/large/";b+=fileName;d.src=b;representative=imageRepresentativeArray[currentIndex];PrevNextCheck();isRepresentativeCheck()}function showPreviousLargeImage(a){var c=document.getElementById(a);if(currentIndex>0){currentIndex-=1}else{document.location.href=document.getElementById("previous").getElementsByTagName("a")[0].href}fileName=imageNameArray[currentIndex];fileName=fileName.replace(/_s/,"");var b="http://static.summitracing.com/global/images/prod/large/";b+=fileName;c.src=b;representative=imageRepresentativeArray[currentIndex];PrevNextCheck();isRepresentativeCheck()}function page(c,b,a){SRE.Web.Services.PartAdditionalImages.BuildAdditionalImages(c,b,a,currLocation(),onSuccess,onFailure)}function onSuccess(a,c,b){document.getElementById("additional-images").innerHTML=a}function onFailure(a,c,b){alert("An error has occurred: "+a)}function currLocation(){return window.location.href}function getLargeImageId(){return document.getElementById("part-image").getElementsByTagName("img")[0].id}function getMainImageId(){return document.getElementById("media-display").getElementsByTagName("img")[0].id}function getNextId(){return document.getElementById("next").getElementsByTagName("a")[0]}function getNextThumbId(a){return document.getElementById("thumbnails").getElementsByTagName("li")[currentthumb].getElementsByTagName("img")[0].name};
