var FxQuick = new Object;
FxQuick.timeout = false;
FxQuick.wait = 100;

FxQuick.appear = {
			type: 'opacity',
			from: 0,
			to: 60,
			step: 3,
			delay: 5
		};
		
FxQuick.disappear = {
			type: 'opacity',
			from: 60,
			to: 0,
			step: -3,
			delay: 5
		};

FxQuick.show = function(div) {
	clearTimeout(FxQuick.timeout);
	var fn = function() {
		FxQuick.state = 1;
		$fx(div).fxReset();
		$fx(div).fxHold(10).fxAdd(FxQuick.appear).fxRun();
	}
	if (FxQuick.state != 1) {
		FxQuick.timeout = setTimeout(fn, FxQuick.wait);
	}
}

FxQuick.hide = function(div) {
	clearTimeout(FxQuick.timeout);
	var fn = function() {
		FxQuick.state = 0;
		var cb = function(el) {
			$('GalleryOverlay').hide();
		}
		$fx(div).fxReset();
		$fx(div).fxHold(10).fxAdd(FxQuick.disappear).fxRun(cb);
	}
	if (FxQuick.state != 0) {
		FxQuick.timeout = setTimeout(fn, FxQuick.wait);
	}
}

FxQuick.hideOpacity = function(div) {
	var appear = {
			type: 'opacity',
			from: 0,
			to: 0,
			step: 0,
			delay: 0
		};
	$fx($(div)).fxAdd(appear).fxRun();
	$(div).hide();
}

