function initSlidePager()
{
	var slideshow = document.getElementById('slideshow');
	if (slideshow) {
		var gotodiv = document.createElement('div');
		gotodiv.setAttribute('id','slidebtn');
	
		var gotolink = document.createElement('a');
		gotolink.setAttribute('href','javascript:nextSlide()');
		gotolink.setAttribute('id','nextlink');
	
		var gotoimg = document.createElement('img');
		gotoimg.setAttribute('src','/img/portfolio/portfolio-arrow.gif');
		gotoimg.setAttribute('alt','');
	
		slideshow.appendChild(gotodiv);
		gotodiv.appendChild(gotolink);
		gotolink.appendChild(gotoimg);
	}
}

function nextSlide()
{
	var lastSlide = shortNames.length - 1;
	currentSlide++;
	if (currentSlide > lastSlide) currentSlide = 0;

	document.getElementById('slideimg').src = '/img/portfolio/slide-'+shortNames[currentSlide]+'.gif';
	document.getElementById('slidetitle').innerHTML = longNames[currentSlide];
	var slideLink = document.getElementById('slidelink');
	if (hasCases[currentSlide]) {
		document.getElementById('slidelink');
		if (slideLink.firstChild != null) {
			slideLink.firstChild.href = caseStudyLink+shortNames[currentSlide]+'.php';
		} else {
			var newlink = document.createElement('a');
			newlink.setAttribute('href',caseStudyLink+shortNames[currentSlide]+'.php');
			newlink.innerHTML = caseStudyLabel;
			slideLink.appendChild(newlink);
		}
	} else {
		if (slideLink.firstChild != null) {
			slideLink.removeChild(slideLink.firstChild);
		}
	}
	
}