function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie6)
	return this
}
bw=new checkBrowser()


if (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3)) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))) {
	var AFotos = new Array();
	var tFoto = 10000; //tempo entre as fotos em milisegundos
	var FTimer;

	function trocaFoto(foto,idName) {
		var f = foto - 1;
		if (f < 0) f = AFotos.length - 1;
		//alert(document.images[idName].src + "==>"+ AFotos[f].src)
		if (bw.ns4) 
			document.fotoMidia.document.images[idName].src = AFotos[f].src
		else
			document.images[idName].src = AFotos[f].src
		FTimer = setTimeout("trocaFoto("+f+",'"+idName+"')",tFoto);
	}


	function imgAnim_init(idName, prefix, nImages) {
		var num
		for (i=0;i<nImages;i++) {
			num = parseInt(i+1)
			if (num < 10) num = "0"+num
			AFotos[i] =  new Image;
			AFotos[i].src = "images/" + prefix + num + ".jpg"
		}
		trocaFoto(nImages,idName)
	}
}
