function Gallery(){this.sBaseId='detailImage';this.iSelectedImage=1;this.sLinkClass='transON';this.sLinkClassSel='transOFF';this.bSetImage=true;this.bSetBackground=false;this.bSetNav=true;this.bSetText=true;this.IE=false;if(navigator.appName=="Microsoft Internet Explorer"){this.IE=true;}this.switchImage=function(iKey){this.iSelectedImage=iKey;if(this.bSetImage){this.setImage(this.iSelectedImage);}if(this.bSetBackground){this.setBackground(this.iSelectedImage);}if(this.bSetNav){this.setNav(this.iSelectedImage);}if(this.bSetText){this.setText(this.iSelectedImage);}return(void(0));};this.setImage=function(iKey){if(iKey==''){iKey=this.iSelectedImage;}try{objImageHidden=document.images[this.sBaseId+'_'+iKey];objImage=document.images[this.sBaseId];if(this.IE&&objImage.filters[0]){objImage.filters[0].apply();}objImage.src=objImageHidden.src;objImage.alt=objImageHidden.alt;if(this.IE&&objImage.filters[0]){objImage.filters[0].play();}}catch(err){}return(void(0));};this.setBackground=function(iKey){if(iKey==''){iKey=this.iSelectedImage;}try{objImageHidden=document.images[this.sBaseId+'_'+iKey];objBgElement=xGetElementById(this.sBaseId+'_Background');objBgElement.style.backgroundImage='url('+objImageHidden.src+')';}catch(err){}return(void(0));};this.setNav=function(iKey){if(iKey==''){iKey=this.iSelectedImage;}try{xGetElementById(this.sBaseId+'_Link'+iKey).className=this.sLinkClassSel;}catch(e){}var i=1;while(1){if(i==iKey){i++;continue;}try{xGetElementById(this.sBaseId+'_Link'+i).className=this.sLinkClass;}catch(err){return(void(0));}i++;}return(void(0));};this.setText=function(iKey){if(iKey==''){iKey=this.iSelectedImage;}try{xGetElementById(this.sBaseId+'_Text').innerHTML=xGetElementById(this.sBaseId+'_Text'+iKey).innerHTML;}catch(err){}return(void(0));};this.prev=function(){var iNewKey;try{iNewKey=this.iSelectedImage-1;if(document.images[this.sBaseId+'_'+iNewKey]){this.switchImage(iNewKey);}}catch(err){}return(void(0));};this.next=function(){var iNewKey;try{iNewKey=this.iSelectedImage+1;if(document.images[this.sBaseId+'_'+iNewKey]){this.switchImage(iNewKey);}}catch(err){}return(void(0));}}
