var hint_contact_title = "Please input your title.";
var hint_contact_msg = "Please input your msg.";
var hint_contact_email = "Please input a valid email address.";
var hint_contact_username = "Please input your name.";
var email_pattern="^[(\\w)-_\.]{1,}@(\\w){1,}\.+(\\w){2,}";

jQuery(document).ready(function(){
   //tag页面summary的显示处理
  $("#show_summary").click(function(e){
		 var summary_all=$("#summary_all").html();
		 var f_text2=$(".f_text2").html();
		 $("#summary_all").html(f_text2);
		 $(".f_text2").html(summary_all);
		 var class_name=$("#show_summary").attr('className');
		 if(class_name=='more'){
			 $("#show_summary").removeClass();
			 $("#show_summary").addClass("less");
		 }else{
			 $("#show_summary").removeClass();
			 $("#show_summary").addClass("more");		 
		}
		 return false;
  });
	$("*").click(function(){
		$(".cat_select").hide();								 
	})
	$(".cat_select a").not(".tab").click(function(e){
		$("input[name=head_cat_id]").val($(e.target).attr('href'));
		$("#curr_cat_selected").val($(e.target).text().substr(0,12)+'...');
		$(".cat_select a").not(".tab").removeClass('on');
		$(e.target).addClass("on");
		return false;
	});
	$("#head_all_cat_select").click(function(){
		$(".cat_select").show();
		return false;
	});
	
});



function str_format(str,pattern){
	re=new RegExp(pattern) 
	if(re.test(str)){
		return true;
	}else{
		return false;	
	}
}

/*tag tabs*/
$(document).ready(function() {
	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.simple_tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.simple_tabs li").click(function() {

		$("ul.simple_tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

});
