﻿$(document).ready(function(){
	$("#user_comment .comment-input").one("focus",function(){
		$(this).val("");												
	});


		check_user_comment();
	$(".noname").click(function(){
			check_user_comment();
		})

	function check_user_comment(){
		if($(".noname").attr("checked")==true){
			$("#user_comment .username,#user_comment .password").attr("disabled","disabled").css("background-color","#ece9d8");
			$("#password").hide();
		}else{
			$("#user_comment .username,#user_comment .password").removeAttr("disabled").css("background-color","#ffffff");;
			$("#password").show();
			$("#user_comment .username").focus();
		}
	}
	
	$("#font_b").click(function(){
		$("#news_content").css("font-size","20px");							
	});
	$("#font_m").click(function(){
		$("#news_content").css("font-size","14px");							
	});
	$("#font_s").click(function(){
		$("#news_content").css("font-size","12px");							
	});	
	
	//隐藏空导读
	if($("#summary_info p:empty").length==$("#summary_info p").length){
     $("#summary_info").hide();  
	}
	//隐藏副标题
	if($("#title_feild h2:empty").length==$("#title_feild h2").length){
     $("#title_feild h2").hide();  
	}	

	//文章内容过大，宽屏
	$("#news_content .padding table,#news_content .padding img").each(function(){
		if($(this).width()>$("#news_content").width()){
			$("#sidebar").hide();
			$("#content").css("width","auto");
			$("#content").css("border-right","0 none");
			$("#news_content").css("width","auto");
			$("#news_content").css("overflow","visible");
			$("#news_content .padding").css("overflow","visible");
		}else{return;}
	})
	
});
