function open_thumb(img){
	var ndiv = $('<div></div>');
	ndiv.css({width:10, height:10, padding:'20px', backgroundColor:'#fff', position:'relative', textAlign:'center', overflow:'hidden'});
	ndiv.html('<img src="'+img+'" /><a href="" onclick="close_thumb();return false;"><img src="/images/popup_close.gif" /></a>');
	$('img', ndiv).css({border:'none', display:'none'});
	$('a', ndiv).css({position:'absolute', bottom:15, right:20});
	var dheight = $(document).height();
	var wheight = $(window).height();
	var wwidth = $(window).width();
	var overlay = $('<div id="thumb_overlay"></div>');
	overlay.css({width: '100%', height:dheight, position: 'absolute', left: 0, top: 0, zIndex: 99});

	//if($.browser.mozilla && $.browser.version=='1.9'){//don't know what happens on firefox3, have to use image to fix the background
		//overlay.css({background:'url(/images/bg.png) repeat'});
//	}else{
		overlay.css({backgroundColor:'#000', opacity: '0.75'});		
//	}
	var wrapper = $('<div id="thumb_wrapper"></div>');
	wrapper.css({width: '100%', height:wheight, background:'none', position: 'absolute', left: 0, top: 0, zIndex: 100});
	wrapper.append(ndiv);
	ndiv.css({top:wheight/2-190, left:wwidth/2 - 190});
	$("#pagecontainer").before(overlay).before(wrapper);

	ndiv.animate({width: '360', height:'360', opacity:'1.0'}, 500, function(){
		$('img', ndiv).show();
	});
}
function close_thumb(){
	$(this).parent().animate({width: '0', height:'0'}, 1000, function(){$(this).hide();});
	$('#thumb_overlay').remove();
	$('#thumb_wrapper').remove();
	
}
