// JavaScript Document
//选项卡效果;控制游戏下载机型选择列表
function showOption(arg1,arg2){
	
	$(arg1).removeClass('DownTabclickOn');
	$(arg1+':eq(0)').addClass('DownTabclickOn');
	$(arg2).hide();
	$(arg2+':eq(0)').show();
	
	$(arg1).each(function(index){
		$(this).mouseover(function(){
			$(arg2).hide();
			$(arg2+':eq('+index+')').show();
			
			$(arg1).removeClass('DownTabclickOn');
			$(arg1+':eq('+index+')').addClass('DownTabclickOn');
			

		});
	});
}


// 百叶窗效果
//arg0：鼠标点击元素
//arg1：显示区域元素
//arg2：鼠标点击选项卡显示区域的样式
var shutterShow = function(arg0,arg1,arg2){
			$(arg0).show();
			$(arg0+':eq(0)').hide();
			$(arg1).hide();
			$(arg1+':eq(0)').show();
			
			//$(arg0+'div img').attr('src',arg2+'.jpg');
			//$(arg1+'div img').attr('src',arg2+'.jpg');
					
			$(arg0).each(function(index){

				var imgNun = index+1;
				$(arg0+' div img:eq('+index+')').attr('src',arg2+imgNun+'.jpg').attr('value','图片');
				$(arg1+' div img:eq('+index+')').attr('src',arg2+imgNun+'.jpg');

				$(this).mouseover(function(){
					$(arg0).show();
					$(this).hide();
					$(arg1).hide();
					$(arg1+':eq('+index+')').show();
				});
			});
			
		}
//幻灯片

		$(function(){
			$('#slides').slides({
				preload: true,
				preloadImage: 'img/loading.gif',
				play: 5000,
				pause: 2500,
				hoverPause: true,
				animationStart: function(current){
					$('.caption').animate({
						bottom:-35
					},100);
					if (window.console && console.log) {
						// example return of current slide number
						console.log('animationStart on slide: ', current);
					};
				},
				animationComplete: function(current){
					$('.caption').animate({
						bottom:0
					},200);
					if (window.console && console.log) {
						// example return of current slide number
						console.log('animationComplete on slide: ', current);
					};
				},
				slidesLoaded: function() {
					$('.caption').animate({
						bottom:0
					},200);
				}
			});
		});
  
//点击显示隐藏层

$(document).ready(function(){
    $('.sidelist').mousemove(function(){
	$(this).find('.i-list').show();
	$(this).find('h3').addClass('hover');
	});
	$('.sidelist').mouseleave(function(){
	$(this).find('.i-list').hide();
	$(this).find('h3').removeClass('hover');
	});
}); 
  
//幻灯片自动播放插件
jQuery.fn.runBanner = function(params){
	
	var pb = params || {
        className:"show",//样式名称
        child: "flashBanner"//对象ID名称
    };

	var _className = pb.className;
    var _child = $("#" + pb.child);
	var _runTime ;
	var _showNum = 0;
	var _bannerNum = _child.children('ul').children().length;
	
	var runBanner = function(){
		_child.children('ol').children().each(function(index){
			$(this).click(function(){
				_showNum = index;
				clearTimeout(_runTime);
				showRunBnner(_showNum);
			});                                                                                                                                   
		});
		showRunBnner(_showNum);	
	
	}
	
	var showRunBnner = function(){
		_child.children('ul').children().eq(_showNum).fadeIn("slow").siblings().hide();
		_child.children('ol').children().eq(_showNum).addClass(_className).siblings().removeClass(_className);
		_showNum++;
		
		if(_showNum >= _bannerNum || _showNum < 0){
			_showNum = 0;
		}
		_runTime = setTimeout(showRunBnner,3000);
			
	}
	
	runBanner();
}
  
