function ShowSample(sampleLink) {
	// check if we got a string, then go find the link
	if (typeof(sampleLink) == 'string') sampleLink = $('a[href=\#' + sampleLink + ']');
	
	// display the link bullet and hide the current sample details
	$('.sampleLinks a.current').removeClass('current');
	$('.sampleDetailsCurrent').addClass('sampleDetails').removeClass('sampleDetailsCurrent');
	// show the bullet beside the link and show the content (get content id from href)
	$(sampleLink).addClass('current');
	sampleName = $(sampleLink).attr('href').substr(1);
	$('#sample' + sampleName).addClass('sampleDetailsCurrent').removeClass('sampleDetails');
}

var count = 1;
var totalImgs = 8;
var rotateTime = 500;
var retateImgId = 'demoImg';

function RotateImg() {
	currentCount = count;
	if (count < totalImgs) count ++;
	else count = 1;
	
	$('#' + retateImgId + count).fadeIn(rotateTime);
	
	setTimeout('RotateImg();', rotateTime + 2000);
	setTimeout('ChangeZIndex(' + currentCount + ');', rotateTime + 2000);
}

function ChangeZIndex(index) {
	$('#' + retateImgId + index).hide().css('z-index', $('#' + retateImgId + index).css('z-index') + 1);
}