// JavaScript Document
$(document).ready(function(){	
//会员中心
	$(".member_menu dt").click(function(){
		$(this).parents("dl").find("dd").toggle();
		$(this).parents("dl").toggleClass("dtClose");				
		});
	$(".member_menu dl dt:first").css("border-top","none");
	
	$(".member_text textarea").focus(function(){
		if($(this).val()==this.defaultValue){
			$(this).val("");
			}	
		}).blur(function(){
			if($(this).val()==""){
				$(this).val(this.defaultValue);
			    }		
	   		});
			
	$('.member_news li:last-child').css("border-bottom","none");
	$('.member_news ul:first').show();	
	$('.member_news h2 span').each(function(index){
		$(this).click(function(){
			$('.member_news h2 span').removeClass("member_news_current");
			$(this).addClass("member_news_current");
			$('.member_news ul').hide();
			$('.member_news ul').eq(index).show();
			});
		});		
	
	$('.title_new h3 a:last').addClass("member_share_border");	
	
//查找好友
	$(".findFriendCon").first().show();	
	$(".findFriend h4 a").click(function(){
		$(this).parents("h4").next(".findFriendCon").toggle();						
		});
		
	$(".share_record th:eq(0)").css("padding-left","40px");
	$(".share_record th:eq(2)").css({"text-align":"right","padding-right":"50px"});
	$(".share_record td:nth-child(3)").css({"text-align":"right","padding-right":"50px"});
	
//分组编辑
	$(".editBtn").click(function(){		
		showDialog();
		$(".member_edit").show();
		});		
	function showDialog(){
		var objW=$(window);
		var objC=$(".member_edit");
		var brsW=objW.width();
		var brsH=objW.height();
		var sclL=objW.scrollLeft();
		var sclT=objW.scrollTop();
		var curW=objC.width();
		var curH=objC.height();		
		var left=sclL+(brsW-curW)/2;
		var top=sclT+(brsH-curH)/2;
		objC.css({"left":left,"top":top});
		}		
	$(window).resize(function(){
		if(!$(".member_edit").is(":visible")){
			retutn;
			}
		showDialog();
		});
	$(".member_edit .close").click(function(){
		$(".member_edit").hide();		
		});	
	$(".member_edit .answerBtn1").click(function(){
		$(".member_edit").hide();		
		});
		
//屏蔽动态		
	var x=5;
	var y=15;
	$(".stopBtn").click(function(e){
		$(".member_stop").css({"top":(e.pageY+y)+"px","left":(e.pageX+x)+"px"}).show();
		});
	$(".member_stop .close").click(function(){
		$(".member_stop").hide();		
		});	
	$(".member_stop .answerBtn1").click(function(){
		$(".member_stop").hide();		
		});
	
	var timer=null;
	$(".member_stop").mouseover(function(){
		clearTimeout(timer);
		});
	$(".member_stop").mouseout(function(){
		timer=setTimeout(function(){$(".member_stop").hide()},1000);		
		});		
	$(".stopBtn").mouseover(function(){
		clearTimeout(timer);
		});
	$(".stopBtn").mouseout(function(){
		timer=setTimeout(function(){$(".member_stop").hide()},1000);		
		});
		
	$(".questionNew tr td:nth-child(1)").addClass("tdBg");	
	$(".questionNew tr td:nth-child(2)").css("text-align","right");	
	$(".questionNew tr th:eq(1)").css("text-align","right");
	$(".questionNew tr:last td").css("border-bottom","none");
	
});