var PhotoBtnClass="photoBtn";var CurrentImageClass="selected";var SlideID="slidePhoto";var PhotoInfoURL="";function ImageRotator(d){this.imageNames=d.imagesArray;this.imagePath=d.imagePath;this.photoBtns=document.getElementById(d.photoBtns);this.photoCont=document.getElementById(d.photoCont);this.slideID=d.slideID;this.setEvents();this.preLoad();this.objName=d.objName;this.imageLink=d.imageLink;this.imageNum=0;this.linkID=d.linkID;var e=document.getElementById(this.slideID);if(this.imageLink==1){initRequest("GET",PhotoInfoURL+this.imageNames[this.imageNum+this.numOfLinks],true,function(){writeResponseText("rotatorDescription",false)});e.src=this.imageArray[this.imageNum].src}if(this.imageLink==2){var f=document.getElementById(this.linkID);f.setAttribute("href",this.imageNames[this.imageNum+this.numOfLinks]);e.src=this.imageArray[this.imageNum].src}if(this.imageLink==3){this.createAjax(this)}}ImageRotator.prototype.createAjax=function(f){this.ajax=new Ajax();this.ajaxObj=this.ajax.init();var e=this;this.ajax.handler=function(){e.testing(f)};try{this.ajaxObj.onreadystatechange=e.ajax.handler;this.ajaxObj.open("GET",PhotoInfoURL+this.imageNames[this.imageNum],true);this.ajaxObj.send("")}catch(d){alert("Sorry, there was a problem contacting the server\nError: "+d.message)}};ImageRotator.prototype.testing=function(b){if(b.ajaxObj.readyState==4&&b.ajaxObj.status==200){b.photoCont.innerHTML=b.ajaxObj.responseText}};ImageRotator.prototype.setEvents=function(){this.linksArray=this.photoBtns.getElementsByTagName("a");this.numOfLinks=0;var e=this;for(var d=0,f=this.linksArray.length;d<f;d++){if(this.linksArray[d].className.match(PhotoBtnClass)){this.numOfLinks++;this.linksArray[d].onclick=function(){if(!this.className.match(CurrentImageClass)){e.imageNum=this.innerHTML-1;e.prepForSwap()}return false}}}};ImageRotator.prototype.preLoad=function(){this.imageArray=[];for(var d=0,c=this.numOfLinks;d<c;d++){this.imageArray[d]=new Image();this.imageArray[d].src=this.imagePath+this.imageNames[d];this.imageArray[d].setAttribute("id","slidePhoto")}};ImageRotator.prototype.prepForSwap=function(d){for(var e=0,f=this.linksArray.length;e<f;e++){if(this.linksArray[e].className.match(CurrentImageClass)){this.linksArray[e].className=this.linksArray[e].className.replace(" selected","");break}}this.linksArray[this.imageNum].className+=" selected";if(this.imageLink==3){someName=this;this.swapImage()}else{initRequest("GET",PhotoInfoURL+this.imageNames[this.imageNum+this.numOfLinks],true,function(){writeResponseText("photoDescripCont",false)});someName=this;fadeOut(this.slideID,100,50,30,false,function(){someName.swapImage()})}};ImageRotator.prototype.swapImage=function(){var d=document.getElementById(this.slideID);if(this.imageLink==2){var c=document.getElementById(this.linkID);c.setAttribute("href",this.imageNames[this.imageNum+this.numOfLinks])}if(this.imageLink==3){someName=this;initRequest("GET",PhotoInfoURL+this.imageNames[this.imageNum],true,function(){writeResponseText(someName.photoCont.id,false)});return true}d.src=this.imageArray[this.imageNum].src;fadeIn(this.slideID,20,100,20)};