function ExibirImagem(imagem, descricao, largura, altura) {	

	var scroll = "no";
	largura += 40;
	altura += 60;

	if (largura < (screen.width - 20)) {	//largura menor do que a da tela
		wpos = screen.width/2 - largura/2 - 5;
		width = largura;
	}
	else {	//largura maior do que a da tela
		wpos = 0;
		width = screen.width - 20;	
		scroll = "yes";
	}

	if (altura < (screen.height - 70)) {	//altura menor do que a da tela
		hpos = screen.height/2 - (altura)/2 - 30;
		height = altura;

	}
	else {	//altura maior do que a da tela
		hpos = 0;
		height = screen.height - 70;
		scroll = "yes";
	}

	//ajuste para barras de rolagem
	if ((hpos == 0) && (wpos != 0)) {
		width += 16
	}
	
	if ((hpos == 0) && (wpos != 0)) {
		height += 20
	}

	parametros = "width="+width+", height="+height+", left="+wpos+", top="+hpos+", scrollbars="+scroll;

	w = window.open('frmVerImagem.aspx?imgpath=' + imagem + '&descricao=' + descricao,'frameImagem',parametros);
	w.window.focus();
}

function AbrirJanela(url, target, largura, altura, scroll) {	

	if (largura < (screen.width - 20)) {	//largura menor do que a da tela
		wpos = screen.width/2 - largura/2 - 5;
		width = largura;
	}
	else {	//largura maior do que a da tela
		wpos = 0;
		width = screen.width - 20;	
		scroll = "yes";
	}


	if (altura < (screen.height - 70)) {	//altura menor do que a da tela
		hpos = screen.height/2 - (altura)/2 - 30;
		height = altura;

	}
	else {	//altura maior do que a da tela
		hpos = 0;
		height = screen.height - 70;
		scroll = "yes";
	}

	//ajuste para barras de rolagem
	if ((hpos == 0) && (wpos != 0)) {
		width += 16
	}
	
	if ((hpos == 0) && (wpos != 0)) {
		height += 20
	}

	parametros = "width="+width+", height="+height+", left="+wpos+", top="+hpos+", scrollbars="+scroll;

	w = window.open(url, target, parametros);
	w.window.focus();
}