﻿$(document).ready(function() {
	//导航
	function nav(){
		$("#menuBar li[name]").hover(
			function () {
				$(this).addClass("active");
				$(this).children('div.nav').show();
			},
			function () {
				$(this).removeClass("active");
				$(this).children('div.nav').hide();

				$("li[name='"+currentNav+"']").addClass('active');
			}
		);
		$("li[name='"+currentNav+"']").addClass('active');
	};

	//页签淡入淡出
	function tab(){
		$(".tabBar").each(function(j){
			$('#tabBar'+(j+1)+'>li').click(
				function () {
					var i=$(this).index()+1;
					var liNumber = $(this).parent.length+1;
					for(k=1;k<=liNumber;k++){
						$("#tab"+(j+1)+"_"+k).css("display","none");
						//$("#tab"+(j+1)+"_"+k).fadeOut();
					}
					$("#tab"+(j+1)+"_"+i).fadeIn();
					$('#tabBar'+(j+1)+'>li').removeClass('active');
					$(this).addClass('active');
				}
			);
		});

	};
	
	//开户按钮提示
	function accountTiper(){
		$(".btnBox a").hover(
			function () {
				$(this).next('div').show();
			},
			function () {
				$(this).next('div').hide();
			}
		);
	};
	
	//底部链接
	$("#links").click(
		function () {
			$("#linksOption").toggle();

		}
	);

	//input焦点
	$("input[type=text]").focus(function(){
	  $(this).removeClass('txtInput').addClass('txtInput_focus');
	}); 
	$("input[type=text]").blur(function(){
	  $(this).removeClass('txtInput_focus').addClass('txtInput');
	}); 

	//二级菜单当前状态
	$('.subMenuBox li a,.nav li a,.rBox .videoList li a').each(function(){
		$(this).attr({"href":$(this).attr("href")+"?p="+($(this).parent().index()+1)});
	});

	function QueryString(item){
	var sValue=location.search.match(new RegExp("[\?\&]"+item+"=([^\&]*)(\&?)","i")) 
	return sValue?sValue[1]:sValue
	}
	var p=QueryString("p");
	if (p)
	{
		$(".subMenuBox li:nth-child("+p+")").removeClass('active').addClass('active');
	}else if((typeof(currentPage))!="undefined"){
			$(".subMenuBox li:nth-child("+currentPage+")").removeClass('active').addClass('active');
	}

	$(".truecolor tr:odd").addClass("color1");
	$(".truecolor tr:even").addClass("color2");
	$(".truecolor tr").hover(function(){
	$(this).addClass("color3")
	},function(){
	$(this).removeClass("color3")
	});

	$(".navShade").each(function(){
		$(this).height($(this).parent().height());
	});

	///////////////////////////////////////////////////////////////////////////
	function init(){
		nav();
		tab();
		accountTiper();
	}

	init();
	//字号
		$(document).ready(function() {
$('#resizer li').click(function() {
var fontSize = 14;
var name = $(this).attr('id');
if (name == 'f_s') {
fontSize -= 2
} else if (name == 'f_l') {
fontSize += 4
} else if (name == 'f_m') {
fontSize == 1.4
}
$('.entry p,.experts_img').css('font-size', fontSize + 'px') // '.entry p' 就是要控制的正文的选择器
});
});

	
});


