function thumbWindow(image, imagetitle, w, h, fit_to_screen, imgtoolbar, onclick, onblur, copyprotect, mosConfig_live_site, caption) {
	//screen width and height for maximum value of popup size
	var screen_w = screen.availWidth;
	var screen_h = screen.availHeight;
	var scroll = 'no';

	//detect IE
	var agt=navigator.userAgent.toLowerCase();
	var ismsie  = (agt.indexOf("msie") != -1);
	var isns  = (navigator.appName.indexOf("Netscape") != -1);
	//define some sizes for IE and others (only tested with Firefox and IE)
	if(ismsie) {
		scrollbarsize = 18;
		statusbarsize = 50;
	} else {
		scrollbarsize = 25;
		statusbarsize = 20;
	}
	if ( fit_to_screen && (w > screen_w) ) {
		image_w = screen_w;
		image_h = Math.round (screen_w * (h / w ));
		//if scrollbars will be shown, substract scrollbar size
		if(image_h >= screen_h) {
			image_w = image_w - scrollbarsize;
			image_h = image_h - scrollbarsize;
		}
		popup_w = screen_w;
		popup_h = screen_h;
		scroll = 'yes';
	} else {
		image_w = w;
		image_h = h;
		popup_w = w;
		popup_h = h;
		if(image_w + statusbarsize > screen_w) {
			popup_w = popup_w + scrollbarsize;
			popup_h = popup_h - statusbarsize;
			scroll = 'yes';
		}
	}
	var justify_top = (screen_h - h) / 2;
	var justify_left = (screen_w - w) / 2;
	if (justify_top < 0) {
		justify_top = 0;
	}
	if (justify_left < 0) {
		justify_left = 0;
	}

	winprops = 'height='+popup_h+',width='+popup_w+',top='+justify_top+',left='+justify_left+',scrollbars='+scroll+',resizable=no,status=no'

	win = window.open('', 'myThumb', winprops)
	win.document.open();
	win.document.write('\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n');
	win.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>');
	if (imgtoolbar==0) {
		win.document.write('\n<meta http-equiv="imagetoolbar" content="false" />');
	}
	
	win.document.write('\n<title>'+imagetitle+'</title></head>');
	win.document.write('\n<body style="margin: 0"');
	//close popup on blur (when it looses focus)
	if (onblur==1){
		win.document.write(' onBlur="window.close()" onClick="window.close()">');
	}
	else {
		win.document.write('>');
	}
	//copyprotection will not work with fit_to_screen, so disable it if it is enabled
	if (copyprotect && !fit_to_screen) {
		win.document.write('<img src="'+mosConfig_live_site+'/mambots/content/mdrimagebot/image_copy_protected!.gif" style="background-image: url(\''+image+'\');" width="'+image_w+'" height="'+image_h+'"');
	} else {
		win.document.write('<img src="'+image+'" width="'+image_w+'" height="'+image_h+'"');
	}
	win.document.write(' alt="'+imagetitle+'" title="'+imagetitle+'" border="0" />');
	win.document.write('</body></html>');
	win.document.close();
	win.focus();
	
	return true;
}