// JavaScript Document
window.onload = initLinks;

var myPix = new Array("../pics/mstudio/studio.png","../pics/mstudio/compile.gif","../pics/mstudio/f1codegmact.gif","../pics/mstudio/menued.gif"
					  ,"../pics/mstudio/treeview.gif");
var thisPic = 0;
var t;

function initLinks() {
	
	document.getElementById("prevLink").onclick = processPrevious;
	document.getElementById("nextLink").onclick = processNext;
	document.getElementById("status").innerHTML = "1/" + myPix.length;
	document.getElementById("myPicture").src = myPix[0];
	document.getElementById("header").onmousemove = showcoords;
	document.getElementById("sidebar1").onmousemove = showcoords;
	rotate();
}

function processPrevious() {
	if (thisPic == 0) {
		thisPic = myPix.length;
	}
	thisPic--;
	document.getElementById("myPicture").src = myPix[thisPic];
	document.getElementById("status").innerHTML = thisPic+1 + "/" + myPix.length;
	clearTimeout(t);
	return false;
}

function processNext() {
	thisPic++;
	if (thisPic == myPix.length) {
		thisPic = 0;
	}
	document.getElementById("myPicture").src = myPix[thisPic];
	document.getElementById("status").innerHTML = thisPic+1 + "/" + myPix.length;
	clearTimeout(t);
	return false;
}
function rotate() {
	thisPic++;
	if (thisPic == myPix.length) {
		thisPic = 0;
	}
	document.getElementById("myPicture").src = myPix[thisPic];
	document.getElementById("status").innerHTML = thisPic+1 + "/" + myPix.length;
    t = setTimeout("rotate()",3000);
	return false;
}
function showcoords(evt){
	if(!evt){
		evt = window.event;
	}
	document.getElementById("breadright").innerHTML = "X = " + evt.clientX*245 + ", Y = " + evt.clientY*245;
}