/* number of images in the images/thumbs folder */
var imgCount = 31;


function show(toShow) {
	document.getElementById(visible).id = toShow;
	visible = toShow;
	return false;
}

function rotate() {
    show(visible == 'images'?'partners':'images');
}

var state = 1;
var imgId = 1;
var images = new Array(0,1,2);
function rotateImages() {
    // only rotate if it is actually displayed
    if (visible == 'images' && state == 1) {
        var img = images[0];
        while (img == images[0] || img == images[1] || img == images[2]) {
            img = Math.round(Math.random()*(imgCount-1));
        }
        
        var image = document.getElementById("img"+imgId);
        images[imgId-1] = img;
        image.src = "images/thumbs/"+img+".jpg";
        imgId++;
        if (imgId == 4) {
            imgId = 1;
        }
    }
}

function pause() {
    state = 0;
}

function play() {
    state = 1;
}


