$(document).ready(function(){
	
	/***************语言切换效果*******************/
	$('#header_top li a').mouseover(function(){
		$(this).children('span').css('color','#aaa');	
	});
	
	$('#header_top li a').mouseleave(function(){
		$(this).children('span').css('color','');
	});
	/***************语言切换效果END*******************/
	$("body").append('<a style="display:none;" rel="nofollow" href="http://apycom.com/"></a>');
	
	/***************Flash效果*******************/
	$('#slider').nivoSlider();
	
	$('.nivo-caption').mouseover(function(){
		//$(this).css('background-image','url(css/images/flash_bg.png)');	
		$(this).css({'border':'1px solid #ccc','width':'164px','height':'124px'});
	});
	
	$('.nivo-caption').mouseleave(function(){
		//$(this).css('background-image','');	
		$(this).css({'border':'','width':'166px','height':'126px'});
	});
	/***************Flash效果END*******************/


	/***************Box效果*******************/
	$('#box_r li').mouseover(function(){
		$(this).css('background-color','#eee');	
	});
	
	$('#box_r li').mouseleave(function(){
		$(this).css('background-color','');	
	});
	/***************Box效果END*******************/
	
	
	/***************新闻栏效果*******************/
	/*中文*/
	$('#news_baowei,#news_hangye').mouseover(function(){
		$(this).css('background-image','url(css/images/news_title_over.png)');	
	});
	
	$('#news_baowei,#news_hangye').mouseleave(function(){
		$(this).css('background-image','url(css/images/news_title.png)');
	});
	
	/*英文*/
	$('#news_baowei_en,#news_hangye_en').mouseover(function(){
		$(this).css('background-image','url(../css/images/news_title_en_over.png)');	
	});
	
	$('#news_baowei_en,#news_hangye_en').mouseleave(function(){
		$(this).css('background-image','url(../css/images/news_title_en.png)');
	});
	
	/*通用*/
	$('#news li a').mouseover(function(){
		$(this).css({'background-position':'0 -12px','color':'#fff'});
	});
	
	$('#news li a').mouseleave(function(){
		$(this).css({'background-position':'0 0','color':'#ddd'});
	});
	/***************新闻栏效果END*******************/



	/***************友情链接效果*******************/
	$('a.friend_other').click(function(){
		$(this).css({'height':'55px','cursor':'default','background-image':''});
		$('a.friend_com').css({'height':'40px','cursor':'pointer'});
		$('#friend_link').css({'background-position':'0 -100px'});
		$('div.friend_com').hide();
		$('div.friend_other').slideDown();
	});
	
	$('a.friend_com').click(function(){
		$(this).css({'height':'55px','cursor':'default','background-image':''});
		$('a.friend_other').css({'height':'40px','cursor':'pointer'});
		$('#friend_link').css({'background-position':'0 0'});
		$('div.friend_com').hide();
		$('div.friend_other').slideUp();
		$('div.friend_com_cur').slideDown();
	});
	
	//合作伙伴自动切换
	$("body").everyTime(3000,function() {
		var cur=$('div.friend_com_cur');
		var nex=cur.next('.friend_com');
		if(($('a.friend_com').css('height')=='55px'|| $('#friend_btn').parent().attr('id')=='friend_link_en' )&& !$('#friend_btn').hasClass("msover"))/*判断中英文页面、合作伙伴是否showing*/
		{
				cur.slideUp(800);
				nex.slideDown(800);	
				cur.removeClass('friend_com_cur');
				nex.addClass('friend_com_cur');
				cur.remove();
				nex.after(cur);
				
				$("div.friend_com li a").bind({
					mouseover:function(){
						$(this).css('background-image','url(css/images/friend_bg.png)');
						$('#friend_btn').addClass('msover');
					},  
					mouseleave:function(){
						$(this).css('background-image','');
						$('#friend_btn').removeClass('msover');
					}  
				});
				$('#friend_link_en div.friend_com li a').mouseover(function(){
					$(this).css('background-image','url(../css/images/friend_bg.png)');	
				});
		}
	});
	
		
	$('#friend_btn a').mouseover(function(){
		if($(this).css('height')=='40px')
		$(this).css({'background-image':'url(css/images/friend_btn.png)'});
	});
	
	$('#friend_btn a').mouseleave(function(){
		if($(this).css('height')=='40px')
		$(this).css({'background-image':''});
	});
	
	
	$("div.friend_com li a").bind({
    	mouseover:function(){
			$(this).css('background-image','url(css/images/friend_bg.png)');
			$('#friend_btn').addClass('msover');
		},  
		mouseleave:function(){
			$(this).css('background-image','');
			$('#friend_btn').removeClass('msover');
		}  
  	});
  
	/*英文*/
	$('#friend_link_en div.friend_com li a').mouseover(function(){
		$(this).css('background-image','url(../css/images/friend_bg.png)');	
	});
	
	
	$('div.friend_other li a').mouseover(function(){
		$(this).css('color','#666');	
	});
	
	$('div.friend_other li a').mouseleave(function(){
		$(this).css('color','');
	});
	/***************友情链接效果END*******************/
	
});
