function doLi(s, u) {
	document.getElementById(s).className="selected";
	document.getElementById(u).className="";

	document.getElementById("employee_" + s).style.display="none";
	document.getElementById("employee_" + u).style.display="block";
}


var panecount = 0, tmpPane, sitestart=0, flow, im;
var speed = 50, resumespeed = 3000, startspeed = 10;
function pane() {
	im = new Array();
	flow = new Array();
	tmpPane = new Array();
	loadImages();
	
	im[0] = document.getElementById("pane0");
	showPane(1);
}
function loadImages() {
	l = big_image.length;
	_big_image = new Array();
	
	for(i=0;i<l;i++) {
		_big_image[i] = new Image();
		_big_image[i].src = big_image[i];
	}
}
function initIm(wich) {
	flow[wich] = true;
	im[wich] = document.getElementById("pane" + wich);
	im[wich].src = _big_image[panecount].src;
	im[wich].style.display = "block";
	im[wich].style.zIndex = 0;
}
function showPane(wich) {
	initIm(wich);

	im[wich].style.opacity = 0;
	im[wich].style.filter = "alpha(opacity=0)";
		
	tmpPane[wich] = setInterval("showPane2(" + wich + ")", speed);
	panecount++;
	if(!big_image[panecount]) {
		panecount = 0;
	}
}
var paneSpeed = 7;
function resume(wich) {
	tmpPane[wich] = setInterval("showPane2(" + wich + ")", speed);
}
function showPane2(wich) {
	o = parseFloat(im[wich].style.opacity);
	o = o * 100;
	
	if(flow[wich]) {
		o = o + paneSpeed;
		if(o >= 100) {
			o = 100;
			flow[wich] = false;
			clearInterval(tmpPane[wich]);
			if(big_image.length > 1) {
				setTimeout("resume(" + wich +")", resumespeed);
			}
			im[0].src = im[1].src;
		}
	} else {
		o = o - paneSpeed;
		if(o<=0) {
			im[wich].style.display = "none";
			clearInterval(tmpPane[wich]);
			flow[wich] = true;
			setTimeout("showPane(" + wich + ")", Math.floor(Math.random() * startspeed));
		}
	}
	im[wich].style.opacity = o/100;
	im[wich].style.filter = "alpha(opacity=" + o+ ")";
}

