var horizontalImageScrollerObj=function(_rootDivId,_imageDivClass,_imageClass,_imageLinkClass,_numImagesPerPage,_numPixelsBetweenImages,_rootImagePath,_leftDisabledImageFileName,_leftEnabledImageFileName,_rightDisabledImageFileName,_rightEnabledImageFileName,_pageSelectedImageFileName,_pageUnselectedImageFileName){var _numPages=1,_currentPage=1,_rootDiv=document.getElementById(_rootDivId),_paginationDiv=document.createElement("div"),_imageDiv=document.createElement("div"),_leftScrollButtonDiv=document.createElement("div"),_leftScrollButton=document.createElement("img"),_rightScrollButtonDiv=document.createElement("div"),_rightScrollButton=document.createElement("img"),_allImages=[];this.setProperty=function(property,value){eval(property+"='"+value+"';")};this.getProperty=function(property){var value;eval("value="+property+";");return value};this.appendImageLink=function(imagePathAndFileName,href,displayText){if(imagePathAndFileName!=""){var nextImagePosition=_allImages.length,thisImg=document.createElement("img");thisImg.src=imagePathAndFileName;var thisImgDiv=document.createElement("div");thisImgDiv.className=_imageClass;thisImgDiv.appendChild(thisImg);var thisImgLink=document.createElement("a");thisImgLink.href=href;thisImgLink.innerHTML=displayText;var thisImgLinkDiv=document.createElement("div");thisImgLinkDiv.className=_imageLinkClass;thisImgLinkDiv.appendChild(thisImgLink);var thisImgLinkContainerDiv=document.createElement("div");thisImgLinkContainerDiv.className=_imageDivClass;thisImgLinkContainerDiv.appendChild(thisImgDiv);thisImgLinkContainerDiv.appendChild(thisImgLinkDiv);_allImages[nextImagePosition]=thisImgLinkContainerDiv;if(_imageDiv.childNodes.length<_numImagesPerPage){if(_imageDiv.childNodes.length>0)thisImgLinkContainerDiv.style.marginLeft=_numPixelsBetweenImages+"px";_imageDiv.appendChild(thisImgLinkContainerDiv)}if(_allImages.length<=_numImagesPerPage){_numPages=1;if(_paginationDiv.childNodes.length<1){var pageImage=document.createElement("img");pageImage.src=_rootImagePath+_pageSelectedImageFileName;_paginationDiv.appendChild(pageImage)}}else{var tempPageCount=parseInt(_allImages.length/_numImagesPerPage);if(tempPageCount==_numPages&&_allImages.length%_numImagesPerPage>0)tempPageCount++;if(tempPageCount>_numPages){_numPages++;var pageImage=document.createElement("img");pageImage.src=_rootImagePath+_pageUnselectedImageFileName;_paginationDiv.appendChild(pageImage);_rightScrollButton.src=_rootImagePath+_rightEnabledImageFileName}}}};this.scrollImages=function(direction){var curPage=_currentPage;if(direction=="left"&&_currentPage>1)_currentPage--;else if(direction=="right"&&_currentPage<_numPages)_currentPage++;if(curPage!=_currentPage){_paginationDiv.childNodes.item(curPage-1).src=_rootImagePath+_pageUnselectedImageFileName;_paginationDiv.childNodes.item(_currentPage-1).src=_rootImagePath+_pageSelectedImageFileName}var firstImageIndex=_currentPage*_numImagesPerPage-_numImagesPerPage,lastImageIndex=firstImageIndex+_numImagesPerPage,numImagesToRemove=_imageDiv.childNodes.length;if(firstImageIndex+_numImagesPerPage>_allImages.length&&firstImageIndex>0){numImagesToRemove=_allImages.length-firstImageIndex;firstImageIndex=_allImages.length-_numImagesPerPage}for(var i=firstImageIndex;i<firstImageIndex+_numImagesPerPage;i++){if(numImagesToRemove>0){_imageDiv.removeChild(_imageDiv.firstChild);numImagesToRemove--}if(i<=_allImages.length){_imageDiv.appendChild(_allImages[i]);_imageDiv.lastChild.style.marginLeft=_numPixelsBetweenImages+"px"}}if(_imageDiv.firstChild)_imageDiv.firstChild.style.marginLeft="0px";if(_currentPage==1)_leftScrollButton.src=_rootImagePath+_leftDisabledImageFileName;else _leftScrollButton.src=_rootImagePath+_leftEnabledImageFileName;if(_currentPage==_numPages)_rightScrollButton.src=_rootImagePath+_rightDisabledImageFileName;else _rightScrollButton.src=_rootImagePath+_rightEnabledImageFileName};this.constructor=function(){_imageDiv.id="his_imageContainer";_paginationDiv.id="his_paginationImageContainer";_leftScrollButton.src=_rootImagePath+_leftDisabledImageFileName;_leftScrollButtonDiv.id="his_leftScrollButton";_rightScrollButton.src=_rootImagePath+_rightDisabledImageFileName;_rightScrollButtonDiv.id="his_rightScrollButton";_leftScrollButton.onclick=function(){horizontalImageScroller.scrollImages("left")};_rightScrollButton.onclick=function(){horizontalImageScroller.scrollImages("right")};_leftScrollButtonDiv.appendChild(_leftScrollButton);_rightScrollButtonDiv.appendChild(_rightScrollButton);_rootDiv.appendChild(_paginationDiv);_rootDiv.appendChild(_leftScrollButtonDiv);_rootDiv.appendChild(_imageDiv);_rootDiv.appendChild(_rightScrollButtonDiv)};this.constructor()};function horizontalScrollerInit(){}if(window.addEventListener)window.addEventListener("load",horizontalScrollerInit,false);else if(window.attachEvent)window.attachEvent("onload",horizontalScrollerInit)