function ButtonMouse(obj,e)
{
	var cell=obj.rows[0].cells[1];
	cell.style.color=(e==1?"#0054E3":"#808080");
}



var files;
function ChangePicture(i)
{
	files=Form1.ihFiles.value.split("|");

	var index=(parseInt(Form1.ihIndex.value) + i + files.length) % files.length;
	Form1.ihIndex.value=index;
	
	var imgPhoto=(Form1.imgPhotoA.style.visibility=="visible"?Form1.imgPhotoB:Form1.imgPhotoA)
	imgPhoto.src="../fotos/" + Form1.ihPath.value + files[index];
}

function ShowPicture()
{
	var index=parseInt(Form1.ihIndex.value);
	var imgA=event.srcElement;
	var imgB=(imgA==Form1.imgPhotoA?Form1.imgPhotoB:Form1.imgPhotoA);
	
	imgA.filters(0).apply();
	imgB.filters(0).apply();

	imgA.style.visibility="visible";
	imgB.style.visibility="hidden";
	imgA.style.left=Math.round(Math.random()*(screen.availWidth-imgA.offsetWidth));
	imgA.style.top=Math.round(Math.random()*(screen.availHeight-imgA.offsetHeight));

	imgA.filters(0).play();
	imgB.filters(0).play();

	tdStatus.innerHTML="<b>" + files[index] + "</b> - Imagem " + (index+1) + " de " + files.length;

	if (Form1.ihSlideShow.value!="0") setTimeout("AutoChangePicture()",4000);
}

function CheckKey()
{
	switch (event.keyCode) {
	case 37: ChangePicture(-1); break;
	case 39:
	case 13: ChangePicture(1); break;
	case 27: window.close(); break;
	}
}

function AutoChangePicture() {
	if (Form1.ihSlideShow.value!="0") ChangePicture(1);
}

function SlideShow()
{
	if (Form1.ihSlideShow.value=="0") {
		Form1.ihSlideShow.value="1";
		ssControler.innerText=";";
		ChangePicture(1);
	}
	else {
		Form1.ihSlideShow.value="0";
		ssControler.innerText="4";
	}
}