// Start 垂直廣告輪播
　　　$(function(){
		// 大廣告圖片的高度及動畫時間
		// 計時器及輪播時間(毫秒)
		var adHeight = 224,
			animateSpeed = 400,
			timer,
			speed = 3500;

		function showNext(){
			// 找出目前是第幾個選項被展示出來(jQuery 1.4)
			var $li = $('#adblock ul.link li'),
				no = $li.has('a.selected').index();
			
			// 計算出下一個要展示的廣告選項
			no = (no + 1) % $li.length;
			
			// 觸發指定選項的 mouseover 事件
			$li.eq(no).children('a').mouseover();

			// 再啟動計時器
			timer = setTimeout(showNext, speed);
		}

		$('#adblock ul.link li a').each(function(i){
			$(this).css('top', i * 56);
		}).hover(function(){
			var $this = $(this),
				// 找出目前 li 是在選單中的第幾個(jQuery 1.4)
				no = $this.parent().index();
			
			// 先移除有 .selected 的超連結的樣式
			$('#adblock ul.link li a.selected').removeClass('selected');
			// 再把目前點擊到的超連結加上 .selected
			$this.addClass('selected');
			
			// 把 ul.showbox 的 top 移到相對應的高度
			$('#adblock ul.showbox').stop().animate({
				top: adHeight * no * -1
			}, animateSpeed);
			
			// 移除計時器
			clearTimeout(timer);
		}, function(){
			// 啟動計時器
			timer = setTimeout(showNext, speed);
		}).focus(function(){
			$(this).blur();
		}).eq(0).addClass('selected');
		
		// 當滑鼠移到廣告上時停止計時器..移出後啟動計時器
		$('#adblock ul.showbox li').hover(function(){
			clearTimeout(timer);
		}, function(){
			timer = setTimeout(showNext, speed);
		});
		
		// 啟動計時器
		timer = setTimeout(showNext, speed);
	});
// End 垂直廣告輪播

// Start 滑出式說明廣告
$(function(){
		// 預設標題區塊 .abgne_tip_gallery_block .caption 的 top
		var _titleHeight = 30;
		$('.abgne_tip_gallery_block').each(function(){
			// 先取得區塊的高及標題區塊等資料
			var $this = $(this), 
				_height = $this.height(), 
				$caption = $('.caption', $this),
				_captionHeight = $caption.outerHeight(true),
				_speed = 200;
			
			// 當滑鼠移動到區塊上時
			$this.hover(function(){
				// 讓 $caption 往上移動
				$caption.stop().animate({
					top: _height - _captionHeight
				}, _speed);
			}, function(){
				// 讓 $caption 移回原位
				$caption.stop().animate({
					top: _height - _titleHeight
				}, _speed);
			});
		});
	});
// End 滑出式說明廣告
