function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"nav_1":"nav1";
  con.style.display=i==cursel?"block":"none";
 }
}
$(function(){
$("#KinSlideshow").KinSlideshow({
                mouseEvent:"mouseover",		
                titleFont:{TitleFont_size:14}, 
titleBar:{titleBar_height:50}
        });
})
$(document).ready(function() {
	/*$(this).find('.erjihot').toggle();*/
	/*$(".content .leftnav .hotnav li").click(function(){
		
		var test=$(this).attr('class');
		if(test=="on"){
		$(this).attr('class','');
		}else{
		$(this).addClass("on");
		}
	})
*/
});
$(document).ready(function() {
var pro=$('.cityli .on em').text();
var city=$('#cityli2 .on em').text();
var catname=$('#catname').val();
if(pro==''){pro='全国';}
$('.zxcity').text(pro+catname);
if(city){$('.zxcity').text(city+catname);}
});
function zixunurl(url){
window.open(url,'zixun','height=700,width=1000, top=100,left=400,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes')
}
$(document).ready(function() {
$('.submitbq').click(function(){	
var keys=$('.input').val();
var apppath=$('#apppath').val();
var url=apppath+"keylist/"+keys+"/";
if(keys==''){
alert('请输入关键词');	
return false;
}else{
window.open(url);
}
});
});

/*/常用/	*/
function getCookie(name)
{
    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
    if(arr=document.cookie.match(reg))
        return unescape(arr[2]);
    else
        return null;
}
$(document).ready(function() {
	$('.shcang').click(function(){
	var _this = $(this);　
	var catid=$(this).attr('catid');
	var wzid=$(this).attr('wzid');
	var zan=$(this).attr('zan');
	var plid=catid+'_'+wzid;
	var fonsi=getCookie("name"+plid);
	if(fonsi==plid){
	alert('你已赞过该回答');	
	return false;
	}
	document.cookie="name"+plid+"="+plid; 
	$.ajax( {  
    url:'/index.php?m=content&c=api&a=dianzan',
    data:{catid : catid,wzid : wzid,zan : zan,},  
    type:'post',  
    cache:false,  
    dataType:'json',  
    success:function(data) {    
    $('.zanshu').text(data);
},  
     error : function() {  
         alert("异常！");  
    }  
});
    });
});