/*--------------- [ajax view image 2010.04.20 ] ---------------*/
function viewImage(TAG,WIDTH,HEIGHT)
{
	var windowWidth = $(window).width();
	var windowHeight = $(window).height();
	var areaWidth = $('.mainArea').width();
	var left = parseInt((windowWidth - WIDTH) / 2);
	var top = parseInt((windowHeight - HEIGHT) / 2);
	//var IMGTAG = '<img src="'+ SRC +'" width="'+ WIDTH +'" height="'+ HEIGHT +'" class="image" />';
	var CLOSEBTN = '<img src="/share/plugin/lightbox/images/lightbox-btn-close.gif" width="66" height="22" alt="× CLOSE" class="nav" />';
	var CLOSEACTION = 'javascript:imageClose();';
	
	$('body').append('<div class="lightContent"><p class="close"><a href="'+ CLOSEACTION +'">'+ CLOSEBTN +'</a></p></div><div class="overrayBg"></div>');
	$(TAG).clone().prependTo(".lightContent");
	//alert(111);
	/*
	if($('.imageBox').width() == null)
	{
		$('.mainArea ').append('<div class="imageBox"><p class="close"><a href="'+ CLOSEACTION +'">'+ CLOSEBTN +'</a></p>'+ IMGTAG +'</div><div class="overrayBg"></div>');
	}
	else
	{
		$('.imageBox img.image').remove();
		$('.imageBox').append(IMGTAG);
	}
	*/
	$('.lightContent').css('left' , left + 'px');
	$('.lightContent').css('top' , top + 'px');
	$('.lightContent').css('width' , WIDTH + 'px');
	$('.lightContent').css('hight' , HEIGHT + 'px');
	$('.lightContent').css('background' , '#FFFFFF');
	$('.overrayBg').css('height' , $('.wrapper').height() + 'px');
	$('.overrayBg').css('opacity' , '0.8');
	$('.overrayBg').fadeIn();
	$(".overrayBg").click(imageClose);
}
function imageClose()
{
	$('.lightContent').fadeOut();
	$('.overrayBg').fadeOut();
	setTimeout("imageRemove()",500);
}
function imageRemove()
{
	$('.overrayBg').remove();
	$('.lightContent').remove();
}

