var velocidade,tempoJS,dist,mnxpos = 0, distAtual, vsDiv = 'a0';
var NAV=false, NS=false, IE=false;

	if      (document.layers)         NAV = true;
	else if (document.all)            IE = true;
	else if (document.getElementById) NS = true;

var Obj;
var ImagensServ = new Array ();
var ImagensServ_i = new Array ();

function clienteLogin () {
	var clienteLogin = loginForm.login.value;
	var clienteSenha = loginForm.senha.value;
	if (clienteLogin == "") {
		alert ('O campo de login esta vazio');
		return;
	}
	else if (clienteSenha == "") {
		alert ('O campo da senha esta vazio');
		return;
	}
	else {
		window.open('login.asp?login='+clienteLogin+'&senha='+clienteSenha, 'login', 'width=1,height=1,tollbars=0,scrollbars=0,status=0');
		return;
	}
}

function enviaComentario () {
	var comentarioEnvia1 = contatoPagina.comentario.value;
	var comentarioEnvia2 = contatoPagina.email.value;
	var comentarioEnvia3 = contatoPagina.nome.value;
	if (comentarioEnvia1 == "") {
		alert ('O campo de comentário esta vazio');
		return false;
	}
	else if (comentarioEnvia2 == "") {
		alert ('O campo de email esta vazio');
		return false;
	}
	else if (comentarioEnvia3 == "") {
		alert ('O campo de nome esta vazio');
		return false;
	}
	else {
		window.open('comentario.asp?nome='+comentarioEnvia3+'&email='+comentarioEnvia2+'&comentario='+comentarioEnvia1, 'comentario', 'width=1,height=1,toolbars=0,scrollbars=0,status=0');
		return false;
	}
}

function montarPagina () {
	Obj = eval("document.all.conteudoPagina.style");
	hLayer('a1'); hLayer('a2'); hLayer('a3');
	document.images.ep0.src='ep0.1.gif';
}

function abLink (url) {
	var url = url;
	window.open(url, 'link');
}

function hLayer(lay) {
	if (IE)      { eval ("document.all['"+lay+"'].style.visibility = 'hidden'");             }
	else if (NS) { eval ("document.getElementById('"+lay+"').style.visibility = 'hidden'");  }
	else         { eval ("document."+lay+".visibility = 'hide'");                          }
}
function mLayer(lay) {
	hLayer(vsDiv);
	if (IE)      { eval ("document.all['"+lay+"'].style.visibility = 'visible'");             }
	else if (NS) { eval ("document.getElementById('"+lay+"').style.visibility = 'visible'");  }
	else         { eval ("document."+lay+".visibility = 'show'");                          }
	vsDiv = lay;
}

function moverObjeto(obj, x, y) {
if (NS)      { obj.left = x; obj.top = y;           }
else if (IE) { obj.pixelLeft = x; obj.pixelTop = y; } 
else         { obj.moveTo(x,y);                     }
}

function movDiv(t) {

	if(t < mnxpos) {
	velocidade = -5;
	dist = mnxpos - t;
	}
	
	else {
	velocidade = 5;
	dist = t - mnxpos;
	}
	
	if (tempoJS) { clearTimeout(tempoJS); }
	
	if (Math.abs(dist) < 1) {
	return;
	}
	
	else {
	tempoJS = setTimeout('movObjetoAc('+t+')','25');
	}
}

function movObjetoAc(t) {

	if(t < mnxpos) {
	distAtual = mnxpos - t;
	velocidade = -(distAtual/10) - 0.5;
	}

	else {
	distAtual = t - mnxpos;
	velocidade = (distAtual/10) + 0.5;
	}	

	mnxpos += velocidade; mnxpos = mnxpos;
	moverObjeto(Obj, -mnxpos, 0);
	
	if (Math.abs(distAtual) > 1) {
	tempoJS = setTimeout('movObjetoAc('+t+')', 25);
	}
	
	else {
	if (tempoJS) { clearTimeout(tempoJS); } 
	
	}
}

