$(document).ready(function(){
	//首页导航挂号提示
	$('#regTips ul').hide();
	$('#regTips').hover(
		function(){
			$(".navMenu_right").addClass("ahover");
			$(this).children('ul').show();
		},
		function(){
			$(".navMenu_right").removeClass("ahover");
			$(this).children('ul').hide();
		}		
	);
	
	$('#regTips ul li').hover(
		function(){
			 $(this).addClass("lihover");
		},
		function(){
			 $(this).removeClass("lihover");
		}		
	);
						   
		//南京81医院首页专家巡礼滚动
		//播放速度
		var speed = 8000;
		//控制范围，符合jQuery路径即可
		var block = '#index_doctor dl';
		//需要显示的内容条目数
		var eq = 1;
		if($(block).length > eq){//如果内容数目大于需要滚动的数目，开始滚动！
			//隐藏除了第一个的其它所有节点
			//$(block).gt(eq-1).css('display','none');
			$(block).slice(eq-0).css('display','none');
			//播放开始
			setInterval('scrollContent("'+block+'",'+eq+',2)',speed);
		}
});

//*********************************************************************************\
//	JS翻滚内容函数
//	基于jQuery内核开发，必须引入jQuery
//	@Author:bridgler
//	@Email:qiao@yynet.cn
//	@Date:2008-05-02
//	初始化必须执行
//	block 制定控制对象
//	eq	页面显示数目
//	type 效果类型：1 - 为滑动，2 - 为渐变，3 - 滑动加渐变
//**********************************************************************************/
function scrollContent(block,eq,type){
		//获取第节点
	    var $firstNode = $(block);
	    //动画效果
	    switch(type){
	    	case 1:
	    		animation_out = {height:'hide'};
	    		animation_in = {height:'show'};
	    		break;
	    	case 2:
	    		animation_out = {opacity:'hide'};
	    		animation_in = {opacity:'show'};
	    		break;
	    	case 3:
	    		animation_out = {height:'hide',opacity:'hide'};
	    		animation_in = {height:'show',opacity:'show'};
	    		break;
	    	default:'';
	    }
	    //开始动画
	    $firstNode.eq(0).animate(animation_out,1000,function(){//隐藏
	    	//克隆.追加到最后.隐藏
	        $(this).clone().appendTo($(this).parent()).css('display','none');
	        //显示第二个节点内容
	    	$firstNode.eq(eq).removeAttr('style').animate(animation_in,1000);
	    	//删除第一个节点内容
	        $(this).remove();
	    });
}

$(function(){
	//顶部搜索
	text_tip = '请输入搜索关键字';
	text_val = $('#header_search_txt').val();
	$('#header_search_txt').bind('click',function(){
		if(text_val == text_tip){
			$(this).val('');
		}
	});
	$('#header_search_txt').bind('blur',function(){
        if($(this).val() == ''){
			$(this).val(text_tip);
		}
	});
	
	$('div.ts_type>label').click(function(){
										  $(this).parent().find('label').removeClass('tst_current');
										  $(this).parent().find('input[type=radio]').attr('checked',false);
										  $(this).addClass('tst_current');
										  $(this).find('input[type=radio]').attr('checked',true);
										  })
})




