// JavaScript Document
$(function(){
	$(".index_top_l_text li:odd").css("backgroundColor","#f2f7fb");//律师推荐各行变色
	//按专长查找放达显示
	$(".index_top_r_l_favoFind_content dl").hover(function(){
		$(this).toggleClass("heightAuto");													   
	})
	//律师页面地区找律师
	$(".lawer_l_area_ul li").hover(function(){
		$(this).addClass("lawer_l_area_ul_active").siblings("li").removeClass("lawer_l_area_ul_active");	
		$(this).children(".areaCity").show();
	},function(){
		$(this).removeClass("lawer_l_area_ul_active");	
		$(this).children(".areaCity").hide();	
	})
	//问题页面提交评论
	$(".ask_pro_answer_dl dd a#pinglun").click(function(){
		$(this).parents("p").siblings("div#pinglunContent").toggle();													
	})
	
	//地区律师页焦点广告
	var i = 0;
	
	var oLi = $('.ytok_m_message_l_show_t > ul.num > li');
	var oImg = $(".ytok_m_message_l_show_t ul.show li");
	oLi.eq(0).addClass("active");
	
	oLi.click(function(){
		var index = oLi.index(this);
		i = index;
		//clearInterval(_h);
		$(this).addClass("active");
		change(i,oLi,oImg);
	})
	auto(i,oLi,oImg);
	
	
})
//失去焦点事件
function fnBlur(obj){
	if(obj.value == ''){
		obj.value = obj.defaultValue;
		//alert(123);
	}
}
//获得焦点事件
function fnFocus(obj){
	if(obj.value == obj.defaultValue){
		obj.value = '';
	}
}
//tab切换
function tab(oThis,activeName,oTitle,oContent,oContentDef){
	$(oThis).addClass(activeName).siblings("li").removeClass(activeName);
	$(oThis).parents(oTitle).siblings(oContent).children(oContentDef).show().siblings("div").hide();
}




//幻灯片统一调用函数
function auto(i,oNumLi,oShowLi){
	var _h = setInterval(function(){
			change(i,oNumLi,oShowLi);
			i++;
			if(i == 4){
				i = 0;
			}
	},5000);
}
function change(i,oNumLi,oShowLi){
    oNumLi.eq(i).addClass("active").siblings("li").removeClass("active");
    oShowLi.eq(i).show().siblings("li").hide();
}


