function changeImg(amount){
	var currImg = document.getElementById("currImg");
	
	if(amount < 0){
		if (currInd > 0) {
			currInd--;
		} else {
			currInd = total-1;
		}
	}else{
		if (currInd+1 < total) {
			currInd++;
		} else {
			currInd = 0;
		}
	}
	document.getElementById("imgProjects").filters[0].apply();
	document.getElementById("imgProjects").src = imgs[currInd][0];
	document.getElementById("imgProjects").filters[0].play();
	document.getElementById("h1").innerHTML = imgs[currInd][1];
	document.getElementById("h2").innerHTML = imgs[currInd][2];
	currImg.innerHTML = currInd+1;

	if (document.getElementById("currImgB") != null) {
		SyncBig();
	}
}
function SyncBig(){
	document.getElementById("currImgB").innerHTML = document.getElementById("currImg").innerHTML;
	document.getElementById("imgProjectsB").filters[0].apply();
	document.getElementById("imgProjectsB").src = imgs[currInd][3];
	document.getElementById("imgProjectsB").filters[0].play();
	document.getElementById("h1B").innerHTML = imgs[currInd][1];
	document.getElementById("h2B").innerHTML = imgs[currInd][2];
}

function winOpen(){
//var img = imgs[currInd][3];
//window.open(img,"_project","toolbar=no, location=no, directories=no, status=no, menubar=no,scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=500, top=30, left=100");
SyncBig();
//document.getElementById("mainTable").filters[0].apply();
document.getElementById("mainFlash").style.display = 'none';
document.getElementById("mainTable").style.display = 'none';
document.getElementById("exp").style.display = 'inline';
//document.getElementById("mainTable").filters[0].play();
}
function winClose(){
document.getElementById("exp").style.display = 'none';
document.getElementById("mainFlash").style.display = 'inline';
document.getElementById("mainTable").style.display = 'inline';
}
function winOpen2() {
var img = imgs[currInd][3];
urltogo = "../modules/snaps_big.asp?img_url="+img;
LeftPosition=(screen.width)?(screen.width-620)/2:100;
TopPosition=(screen.height)?(screen.height-620)/2:100;
x=document.getElementsByTagName('body')[0];
x.style.filter='alpha(opacity=30)';
myWindow=window.open(urltogo,"bigImg","toolbar=no, location=no, directories=no, status=no, menubar=no,scrollbars=no, resizable=no, copyhistory=no, width=620, height=620,top="+TopPosition+",left="+LeftPosition);
myWindow.focus();
}

function img2txt(img) {
	txt = img.alt;
	//img.parentNode.innerHTML=txt;
	img.src='../images/spacer.gif';
	//img.parentNode.innerHTML='<div style="{width:100%;height:100%;background:#DFDFDF;text-align:center;}">image is missing</div>';
}