var tid;
var curopac;
var arrimgs;
var imgcounter=0;
var loadingh;

loading=1;
numimages=10;
loadingh='';

function FadeOut() {
	if (loading) return;
	curopac-=4;
	if (curopac < 4) document.getElementById('head2').style.display = 'none';
	document.getElementById('head2').style.filter = 'alpha(opacity='+curopac+')';
	if (curopac > 0) setTimeout("FadeOut()", 1);
	else LoadNextImage('head2');
}

function FadeIn() {
	if (loading) return;
	curopac+=4;
	if (curopac > 0) document.getElementById('head2').style.display = 'block';
	document.getElementById('head2').style.filter = 'alpha(opacity='+curopac+')';
	if (curopac < 100) setTimeout("FadeIn()", 1);
	else LoadNextImage('head1');
}

function LoadNextImage(imgid) {
	if (loadingh == imgid) return;
	loadingh = imgid;
	imgcounter++;
	if (imgcounter > numimages) imgcounter = 1;
	document.getElementById(imgid).src='images/slide'+imgcounter+'.jpg';
}


function popup(url, winname, width, height) {
	if (winname == "") winname = "popup";
	if (width == "") width = "400";
	if (height == "") height = "300";
	var top = (screen.height) / 2 - (height / 2);
	var left = (screen.width) / 2 - (width / 2);
	var win_arg = "scrollbars=yes,status=yes,resizable=yes,location=no,toolbar=no,width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
	window.open(url,winname,win_arg);
}