var scrWidth=screen.width;
var scrHeight=screen.height;

var xPos;
var yPos;

var PositionX;
var PositionY;

//alert(xPos+'\n'+yPos);

var AutoClose = true;

function MM_openBrWindow(imageURL,imageTitle, imgWidth, imgHeight, isFlash){
	var defaultWidth = imgWidth;
	var defaultHeight = imgHeight;
	xPos=document.body.clientWidth;
	yPos=screen.height;
	PositionX = (xPos-defaultWidth)/2;
	PositionY = (yPos-defaultHeight)/2;
	var imgWin = window.open('','_blank','scrollbars=no,resizable=0,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
	if( !imgWin ) { return true; } //popup blockers should not cause errors

	if(isFlash){
		imgWin.document.write('<html><head><title>'+imageTitle+'<\/title>'+
		'<\/head><body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"'+(AutoClose?' onblur="self.close();"':'')+'>'+
		(document.layers?('<layer left="0" top="0">'):('<div style="position:absolute;left:0px;top:0px;display:table;">'))+
		'<embed src="'+imageURL+'" width="'+imgWidth+'" height="'+imgHeight+'"></embed> '+
		(document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
	}
	else{
		imgWin.document.write('<html><head><title>'+imageTitle+'<\/title>'+
		'<\/head><body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"'+(AutoClose?' onblur="self.close();"':'')+'>'+
		(document.layers?('<layer left="0" top="0">'):('<div style="position:absolute;left:0px;top:0px;display:table;">'))+
		'<img src="'+imageURL+'" title="" >'+
		(document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
	}

	imgWin.document.close();
	if( imgWin.focus ) { imgWin.focus(); }
	return false;
}