function openImage(obj, width, height, title, content){
	title=title.replace(/<br[ \/]*>/,' ');
	var h=0;

	if(typeof(screen)!='undefined'){
		x=(screen.width-width)/2;
		y=(screen.height-height-h)/2-110;
		if(y<10)
			y=30;
	}else{
		x=300;
		y=200;
	}

	//var myWin=open(obj.href,'w'+obj.href,'width='+width+', height='+(height+h)+', left='+x+', top='+y+', scrollbars=yes, resizable=yes');
	var myWin=open(obj.href,'','width='+(width)+', height='+(height+h)+', left='+x+', top='+y+', scrollbars=yes, resizable=yes');
	myWin.document.writeln('<html><head><title>'+title+'</title><style>'+
	'body {'+
		'overflow: auto;'+
	'}'+
	'html, body {'+
		'background-color: #2d2b1e;'+
		'color: white;'+
		'margin: 0;'+
		'padding: 0;'+
		'font-family: Verdana;'+
	'}'+

	'p {'+
		'margin: 10px 0px;'+
	'	text-indent: 15px;'+
	'}'+
	'h4 {'+
		'margin: 5px 0 10px;'+
	'	font-family: Verdana, Tahoma, sans-serif;'+
		'font-size: 15px;'+
	'	font-weight: bold;'+
		'color: #ffa08e;'+
	'}'+
	'h5 {'+
		'margin: 5px 0 7px;'+
		'font-family: Verdana, Tahoma, sans-serif;'+
		'font-size: 12px;'+
		'font-weight: bold;'+
		'color: #ffa08e;'+
	'}'+
	'h6 {'+
		'margin: 5px 0 7px;'+
		'font-family: Arial, Verdana, Tahoma, sans-serif;'+
		'font-style: italic;'+
		'font-weight: normal;'+
		'font-size: 12px;'+
		'color: #ffa08e;'+
	'}'+

	'#div_id {'+
		'position: absolute;'+
		'right: 5px;'+
		'top: 5px;'+
		'padding: 0px 10px;'+
		'font-size: 10px;'+
		'background-color: #eee;'+
		'border: 1px solid #999;'+
		'color: black;'+
	'}'+

	 '#div_content {'+
		'margin: 10px 10px 5px;'+
		'padding: 0;'+
		'font-size: 12px;'+
		/*'font-weight: bold;'+*/
	'}'+

	'</style></head><body><img src="'+obj.href+'" width="'+width+'" height="'+height+'" /><br />'+(title ? '<div id="div_id"><b>'+title+'</b></div>' : ''));
	if(content)
		myWin.document.writeln('<div id="div_content">'+content+'</div>');
	myWin.document.writeln('</body></html>');
	myWin.document.close();
	
	//myWin.resizeTo(width, height+h+10);
	if(content) {
		h=myWin.document.getElementById('div_content').clientHeight;
		if(!h)
			h=myWin.document.getElementById('div_content').offsetHeight;
		//print_r2(myWin.document.getElementById('div_content'));
		//alert(h);
		if(navigator.userAgent.toLowerCase().indexOf('firefox')!=-1)
			h+=15;
		if(h){
			if(navigator.userAgent.toLowerCase().indexOf('MSIE')!=-1)
				myWin.moveBy(0,-20);
			myWin.resizeBy(0,h+20);
			//alert(1);
		}else
			myWin.resizeBy(0,60);
	}
	return false;
}

