function openPopImage(img){
	var wn, x = 0, y = 0, l, t, i, stm;
	i	= new Image();
	i.src	= img;
	x	= i.width;
	y	= i.height;
	
	if(x==0 || y == 0){
		stm	= setTimeout("openPopImage('"+ img +"')",500);
	}
	else{
		clearTimeout(stm);
		l	= (screen.width-x)/2;
		t	= (screen.height-y)/2;
		
		wn	= window.open('', '', 'left='+ l +', top='+ t +', width='+ x +', height='+ y);
		wn.title = '';
		with(wn.document){
			write("<html>\n");
			write("<title>:: datamace ::</title>\n");
			write("<body leftmargin='0' topmargin='0' rightmargim='0' bottommargin='0'>\n");
			write("<img src='"+ img +"' id='imgM' border='0' style='cursor:pointer;' onClick='window.close();' title='Clique na imagem para fechar a janela'>\n")
			write("<body>\n");
			write("</html>");
		}
	}
}
