FlBnr = function(eltId, HTTP_SERVER) {
	
	this.fTimer = null;
	this.fFrameTimer = null;
	this.fTextTimer = null;
	this.fSlide = 7000;
	this.fFrame = 7000;
	this.fFade = 400;
	this.fSrc = HTTP_SERVER + 'images/goairlink_bnr/';
	this.fHotDealLink = '';
	this.fEltId = eltId;
	this.flBnrContainer = null;
	this.flBnrTextContainer = null;
	this.fNavigateContainer = null;
	this.preloadContainer = null;
	this.spacer = '';
	
	this.fFrames = [];
	this.fFramesTexts = [];
	this.fFramesLinks = [];
	
	this.HTTP_SERVER = HTTP_SERVER;
	var _self = this;
	this.cachedImages = [];
	this.fCurrent = 0;
	this.fImagesCount = 0;
	
	this.init = function() {
		if (this.fFrames.length > 0) {
			$('#' + this.fEltId).append('<div id="preloadImages" style="display:none" />');
			this.preloadContainer = $('#' + this.fEltId + ' #preloadImages');
			$.each(this.fFrames, function(i) {_self._preloadQueue(_self.fFrames[i]);});
			if (this.fFramesTexts.length > 0) { $.each(this.fFramesTexts, function(i) {_self._preloadQueue(_self.fFramesTexts[i]);}); }
			this.preloadContainer.find('img').load(function() {_self._loadImage();});
		}
	}
	this._preloadQueue = function(src) { this.preloadContainer.append('<img src="' + src + '">'); this.fImagesCount += 1; }
	this._loadImage = function() {
		this.fImagesCount -= 1;
		if (this.fImagesCount == 0) this._afterPreload();
	}
	this._afterPreload = function() {
		$('#' + this.fEltId).css('cursor', 'pointer').html('');
		
		$('#' + this.fEltId).append('<div id="flBnrContainer" />').append('<div id="flBnrTextContainer" />');
		this.flBnrContainer = $('#' + this.fEltId + ' #flBnrContainer'); this.flBnrTextContainer = $('#' + this.fEltId + ' #flBnrTextContainer');
		_bg = $('#' + this.fEltId);
		var flc_w = _bg.width() - ($.browser.msie ? 1 : 0); var flc_h = _bg.height();
		this.flBnrContainer.css({'width':flc_w, 'height':flc_h}); this.flBnrTextContainer.css({'width':_bg.width()});
		
		$('body').append('<a href="#" id="flLink_' + this.fEltId + '"><img class="flMainLink" src="' + this.spacer + '" width="' + flc_w + '" height="' + flc_h + '"></a>');
		var _pos = $('#' + this.fEltId).position();
		$('.flMainLink').css({'top':(_pos.top - ($.browser.msie?2:0) - 5), 'left':(_pos.left - ($.browser.msie?2:0))})
		
		this._buidNavigation();
		this._start();
		
		$(window).resize(function() {
			var _pos = $('#' + _self.fEltId).position();
			_self.fNavigateContainer.css({'left':(_pos.left)});
			$('.flMainLink').css({'left':(_pos.left - ($.browser.msie?2:0))});
			$('.fHotDealLink').css({'left':(_pos.left - ($.browser.msie?2:0))})
		});
	}
	this._buidNavigation = function() {
		$('body').append('<div class="fNavigateContainer" id="fNavigateContainer_' + this.fEltId + '" />');
		this.fNavigateContainer = $('#fNavigateContainer_' + this.fEltId);
		if (this.fFrames.length > 0) {
			$.each(this.fFrames, function(i) {
				var img = $('<img src="' + _self.spacer +'">');
				if (i == 0) img.width(128).height(14);
				if (i == 1) img.width(70).height(14);
				if (i == 2) img.width(170).height(14);
				_self.fNavigateContainer.append(img);
			});
			var _btns = this.fNavigateContainer.find('img');			
			var _pos = $('#' + this.fEltId).position();
			this.fNavigateContainer.css({'top':(_pos.top + 255), 'left':(_pos.left + 5)});
			_btns.hover(
				function() {
					_self._showFrame(_btns.index(this), true);
					_self._increaseFramesCount();
					return false;
				},
				function() { if ($(this).attr('active') == 0) $(this).attr('src', _self.fFramesButtons[_btns.index(this)][1]); }
			);
			_btns.click(function() { return false; });
		}
	}
	this._start = function() {
		this.flBnrContainer.find('img').remove();
		this.fFrameTimer = $.timer(this.fFrame, function() {_self._nextFrame();});
		this._nextFrame();
	}
	
	this._nextFrame = function() { this._showFrame(this._getCurrentIndex()); this._increaseFramesCount(); };
	this._increaseFramesCount = function() { this.fCurrent += 1; if (this.fCurrent == this.fFrames.length) this.fCurrent = 0; }
	this._getCurrentIndex = function() { return this.fCurrent; };
	this._showFrame = function(fi, forceChangeSrc) {
		forceChangeSrc = forceChangeSrc == undefined ? false : forceChangeSrc;
		this.fCurrent = fi;
		var img = this.flBnrContainer.find('img');
		this.flBnrTextContainer.find('img').remove();
		$('body .fHotDealLink').remove();

		if (img.length == 0) {
			img = this.flBnrContainer.append('<img src="' + this.fFrames[this.fCurrent] + '" class="unitPng">');
			_self.fCurrent = 0; _self._frameAnimation();
			
		} else {
			if (forceChangeSrc || $.browser.msie) {
				img.attr('src', _self.fFrames[_self.fCurrent]);
				_self._frameAnimation();
				
			} else {img.animate({opacity:0}, this.fFade, function() {
					$(this).attr('src', _self.fFrames[fi]).animate({opacity:1}, _self.fFade, function() {_self._frameAnimation();});
				});
			}
		}
		
		if (this.fFramesLinks[this.fCurrent] != undefined) {
			var href = this.fFramesLinks[this.fCurrent];
			if (href != '') $('#flLink_' + this.fEltId).attr('href', href);
			else $('#flLink_' + this.fEltId).attr('href', 'javascript:void(0);');
			
			if (fi == 0) {
				var _pos = $('#' + this.fEltId).position();
				$('body').append('<a class="fHotDealLink" onfocus="blur();" href="#" onclick="openTab(2);return false;"><img src="' + this.spacer + '" width="100" height="22"></a>');
				$('body .fHotDealLink').css({'top':(_pos.top + 485), 'left':(_pos.left + 60)});
			}
		}
		
		if (this.fFrameTimer !== null) this.fFrameTimer.reset(this.fFrame);
	};
	this._frameAnimation = function() {return;}
}
