// JavaScript Document
$(function(){
	
	//菜单文字样式
	$('#menu h1').addClass("text_red");	
	$('#menu h1 ul').addClass('text_gray2');
	//菜单高度
	var menuH = $('#menu').height();
	var conH = $('#container').height();
	if(menuH < conH){
		$('#menu').height(conH);
	}
	//菜单折叠
	
	$('.menuPage').children('ul').show();
		
	$('#menu h1').hover(function(){
		$(this).children('ul').slideDown();
	},function(){
		
	});
	$('#menu').hover(function(){},function(){
		$('#menu h1').not($('.menuPage')).children('ul').slideUp();	
	})
	//文字大小控制
	var size = 12;
	var lineH = 22;
	$('.font_control span').eq(1).addClass('text_red');
	$('.font_control span').eq(0).click(function(){
		
		$(this).addClass('text_red').siblings('span').removeClass('text_red');	
		$('#con_txt_con p').animate({'font-size':size += 2,'line-height':lineH += 2});
		
		
	})
	$('.font_control span').eq(1).click(function(){
		$(this).addClass('text_red').siblings('span').removeClass('text_red');
		$('#con_txt_con p').animate({'font-size':12,'line-height':22})	
		size = 12;
		lineH = 22;
	})
	$('.font_control span').eq(2).click(function(){
		$(this).addClass('text_red').siblings('span').removeClass('text_red');
		$('#con_txt_con p').animate({'font-size':size -= 2,'line-height':lineH -= 2})	
	})
	//文字大小控制2
	var size2 = 12;
	var lineH2 = 22;
	$('#con_tit_box span').eq(1).addClass('text_red');
	$('#con_tit_box span').eq(0).click(function(){
		
		$(this).addClass('text_red').siblings('span').removeClass('text_red');	
		$('#con_txt_con2 p').animate({'font-size':size2 += 2,'line-height':lineH2 += 2});
		
		
	})
	$('#con_tit_box span').eq(1).click(function(){
		$(this).addClass('text_red').siblings('span').removeClass('text_red');
		$('#con_txt_con2 p').animate({'font-size':12,'line-height':22})	
		size2 = 12;
		lineH2 = 22;
	})
	$('#con_tit_box span').eq(2).click(function(){
		$(this).addClass('text_red').siblings('span').removeClass('text_red');
		$('#con_txt_con2 p').animate({'font-size':size2 -= 2,'line-height':lineH2 -= 2})	
	})
	
	//导航
	//jquery.color.js支持的样式有： ['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor']。
	$('#nav li').prepend('<div></div>');
	
	$('.navPage').children('div').animate({top:-118},500);
	$('.navPage a').css({color:'#FFF'});
	$('#nav li').not($('.navPage')).children('a').css({color:'#c7000a'});
	$('#nav li').hover(function(){
		$(this).siblings('li').not($('.navPage')).children('a').css({backgroundColor:'#fff'});
		
		$(this).children('a').stop().animate({color:'#fff',backgroundColor:'#c7000a' },500);
		$(this).not($('.navPage')).children('div').stop().animate({top:-118},500);
		
	},function(){
		$(this).not($('.navPage')).children('a').stop().animate({color:'#c7000a',backgroundColor:'#fff'},500);
		$(this).not($('.navPage')).children('div').stop().animate({top:0},500);
	})
	
})
