function galleryShow(faid) {
	$(document).ready(function() {
		$('#middle').empty();
		$('#middle').append('<div class="page"><div class="loading">Loading...</div></div>');
		$('#middle').load('../ajaxgalery.php', {fa_id: faid});
		
	});
}

function showImage(imagefile, imgwidth, imgheight, imgcomment) {
	$(document).ready(function() {
	
	
		var $o = {
		fade:'fast',
		opacity:'0.7',
		width: imgwidth+'px',
		height: imgheight+'px',
		image: imagefile,
		comment: imgcomment,
		mrgleft: (imgwidth/2)*-1+'px',
		mrgtop: (imgheight/2)*-1+'px'
		};
		
		var _o = $(document.createElement('div')).css({display:'none',opacity:$o.opacity}).attr('id','galery_overlay');
		
		$('body').append(_o);
		
		var _d = $(document.createElement('div')).addClass('imagePreview').css({display:'none', width: $o.width, height: $o.height}).attr('id', 'image');
		
		var _c = $(document.createElement('div')).addClass('closeImage').css({left: (imgwidth-20)+'px', top: '7px'}).attr('id', 'imageClose');
			
		var _img = '<img src="'+$o.image+'" border="0" width="'+$o.width+'" height="'+$o.height+'" />';
		var _cls = '<img src="../images/close.png" border="0" width="14" height="15" />';
			
		_c.append(_cls);
		
		if($o.comment == ''){
			_d.append(_img).append(_c);	
		}
		else {
			
			var _commCont = $(document.createElement('span')).addClass('imgComment').css({left: '20px', top: (imgheight-25)+'px'}).attr('id', 'imgComment');
			_commCont.append('&nbsp;'+$o.comment+'&nbsp;');
			_d.append(_img).append(_c).append(_commCont);
			
		}
			

			

			
		_o.after(_d);
			
		_o.fadeIn($o.fade);
		_d.fadeIn($o.fade);
			
		_c.click(function(){
		  _o.fadeOut($o.fade);
		  _d.fadeOut($o.fade);
		  $('#image').remove();
		  $('#overlay').remove();
		  $('body').focus();
		});
		
	});

}