var ssCurrSlideIndex=0;
var ssMaxSlideIndex=-1;
var ssSlides=new Array();
var ssRestartable=false;
if(typeof ssInterval=='undefined')
	var ssInterval=1000;
if(typeof ssTileWidth=='undefined')
	var ssTileWidth=62;
if(typeof ssLoop=='undefined')
	var ssLoop=false;
if(typeof ssRunning=='undefined')
	var ssRunning=false;
if(typeof ssSelectable=='undefined')
	var ssSelectable=true;
var formatForPrint=(document.location.href.indexOf('print-version')!=-1);

function slidesSetUp()
{
	if(!W3CDOM)
		return;
	ssSlideshowContainer=document.getElementById('ssSlideshow');
	ssSlideshowContainer.style.visibility='hidden';
	ssSlides=getElementsByClassName('ssSlide');
	ssMaxSlideIndex=ssSlides.length-1;
	for(var i=0;i<ssSlides.length;i++)
	{
		ssSlides[i].id='ssSlide'+i;
	}
	for(i=0;i<ssSlideshowContainer.childNodes.length;i++)
	{
		ssSlideshowContainer.removeChild(ssSlideshowContainer.lastChild);
		i--;
	}
	ssSlideshowContainer.appendChild(c());
	var ssFirstSlide=ssSlides[l()];
	ssSlideshowContainer.appendChild(ssFirstSlide);
	if(ssSelectable)
		d();
	if(ssSelectable)
		ssSlideshowContainer.appendChild(ssSelector);
	ssSlideshowContainer.style.visibility='visible';
	if(ssRunning)
		o();
};

function c()
{
	ssControllor=document.createElement('DIV');
	ssControllor.id='ssControls';
	ssControllor.className='ssMenubar';
	ulTag=document.createElement('UL');
	liNext=document.createElement('LI');
	aTag=document.createElement('A');
	aTag.id='ssNextLink';
	aTag.name='nextlink';
	aTag.href='#';
	aTag.className='pointRight';
	aTag.title='Next slide';
	aTag.onclick=m;
	t=document.createTextNode('Next slide >>');
	aTag.appendChild(t);
	liNext.appendChild(aTag);
	ulTag.appendChild(liNext);
	liRunStop=document.createElement('LI');
	aTag=document.createElement('A');
	aTag.id='ssRunStopLink';
	aTag.name='runstoplink';
	aTag.href='#';
	aTag.className='pointRight';
	aTag.title='Run slideshow';
	aTag.onclick=o;
	t=document.createTextNode('Run');
	aTag.appendChild(t);
	liRunStop.appendChild(aTag);ulTag.appendChild(liRunStop);liPrev=document.createElement('LI');aTag=document.createElement('A');aTag.id='ssPrevLink';aTag.name='prevlink';aTag.href='#';aTag.className='pointLeft disabled';aTag.title='Previous slide';aTag.onclick=D;t=document.createTextNode('<< Previous slide');aTag.appendChild(t);liPrev.appendChild(aTag);ulTag.appendChild(liPrev);ssControllor.appendChild(ulTag);return ssControllor;};function d(){ssSelector=document.createElement('DIV');ssSelector.id='ssTileSelector';for(i=0;i<ssMaxSlideIndex+1;i++){var bool=(i==ssCurrSlideIndex);ssSelector.appendChild(e(i,bool));}};function e(index,status){slide=ssSlides[index];slideImageObj=slide.getElementsByTagName('IMG');slideImageFile=slideImageObj[0].src;slideImageAlt=slideImageObj[0].alt;lastUnderscorePos=slideImageFile.lastIndexOf('.');firstPos=slideImageFile.indexOf('/');firstSrcPart=slideImageFile.substring(firstPos,lastUnderscorePos);lastSrcPart=slideImageFile.substring(lastUnderscorePos);thumbImageFile=firstSrcPart+'_th'+lastSrcPart;imageTag=document.createElement('IMG');imageTag.src=thumbImageFile;imageTag.removeAttribute('width');imageTag.removeAttribute('height');imageTag.width=ssTileWidth;imageTag.height=ssTileWidth;imageTag.alt=slideImageAlt;imageTag.border='1';aTag=document.createElement('A');if(status){aTag.className='ssCurrTileLink';aTag.onclick=D;imageTag.className='ssCurrTileImage';}else{aTag.className='ssTileLink';aTag.onclick=v;imageTag.className='ssTileImage';}aTag.appendChild(imageTag);aTag.id=index;aTag.href='#';return aTag;};function l(){var ssInitialSlideIndex=0;if(location.hash.length>1){ssInitialSlideIndex=location.hash.substring(1)-1;}ssCurrSlideIndex=ssInitialSlideIndex;return ssInitialSlideIndex;};function D(){this.blur();return false;};function o(){if(ssRestartable){B(0);setTimeout(o,ssInterval);ssRestartable=false;w(false);}else{ssRunning=true;m();r(true);process=setInterval('m();',ssInterval);z();}return false;};function C(){ssRunning=false;if(typeof process!='undefined')clearInterval(process);r(false);z();return false;};function r(){ssRSLink=document.getElementById('ssRunStopLink');ssRSLink.innerHTML=(ssRunning?'Stop':'Run');ssRSLink.title=(ssRunning?'Stop slideshow':'Run slideshow');if(ssRunning){ssRSLink.onclick=C;}else{ssRSLink.onclick=o;}};function z(){if(ssRunning){w(false);A(false);}else{if(ssCurrSlideIndex>0)A(true);if(ssCurrSlideIndex==0)A(false);if(ssCurrSlideIndex<ssMaxSlideIndex)w(true);if(ssCurrSlideIndex==ssMaxSlideIndex)w(ssLoop);}};function w(status){ssNLink=document.getElementById('ssNextLink');if(status){ssNLink.onclick=m;ssNLink.className='pointRight';}else{ssNLink.onclick=D;ssNLink.className='pointRight disabled';}};function A(status){ssPLink=document.getElementById('ssPrevLink');if(status){ssPLink.onclick=n;ssPLink.className='pointLeft';}else{ssPLink.onclick=D;ssPLink.className='pointLeft disabled';}};function n(){if(ssCurrSlideIndex>0){var newSlideIndex=ssCurrSlideIndex-1;B(newSlideIndex);g(newSlideIndex);}return false;};function m(){var newSlideIndex=(ssCurrSlideIndex-0)+1;if(newSlideIndex==ssMaxSlideIndex){if(!ssLoop){if(ssRunning)ssRestartable=true;C();}}if(newSlideIndex>ssMaxSlideIndex)newSlideIndex=0;B(newSlideIndex);return false;};function v(){if(typeof process!='undefined')C();B(this.id);return false;};function B(index){ssRestartable=(index==ssMaxSlideIndex?true:false);if(index!=ssCurrSlideIndex){var newSlide=ssSlides[index];var oldSlide=document.getElementById('ssSlide'+ssCurrSlideIndex);ssSlideshowContainer.replaceChild(newSlide,oldSlide);f(index);g(index);}if((index==0)||(index==1)||(index==ssMaxSlideIndex)||(index==ssMaxSlideIndex-1))z();};function g(index){ssCurrSlideIndex=index;};function f(index){if(!ssSelectable)return;var oldTileLink=document.getElementById(ssCurrSlideIndex);oldTileLink.onclick=v;oldTileLink.className='ssTileLink';oldTileLink.firstChild.className='ssTileImage';var newTileLink=document.getElementById(index);newTileLink.onclick=D;newTileLink.className='ssCurrTileLink';newTileLink.firstChild.className='ssCurrTileImage';newTileLink.blur();};function j(){this.className='ssTileLink';};function k(){this.className='ssTileLink_fakeHover';} 