﻿function tabit(btt){
	var idname = new String(btt.id);
	var s = idname.indexOf("_");
	var e = idname.lastIndexOf("_")+1;
	var tabName = idname.substr(0, s);
	var id = parseInt(idname.substr(e, 1));
	var tabNumber = btt.parentNode.childNodes.length;

	for(i=1;i<8;i++){

			document.getElementById(tabName+"_dit_"+i).style.display = "none";
			document.getElementById(tabName+"_btt_"+i).className = "";
		};
		document.getElementById(tabName+"_dit_"+id).style.display = "block";
		btt.className = "curr";
};

function etabit(btn){
	var idname = new String(btn.id);
	var s = idname.indexOf("_");
	var e = idname.lastIndexOf("_")+1;
	var tabName = idname.substr(0, s);
	var id = parseInt(idname.substr(e, 1));
	var tabNumber = btn.parentNode.childNodes.length;
	for(i=1;i<tabNumber;i++){
			document.getElementById(tabName+"_div_"+i).style.display = "none";
			document.getElementById(tabName+"_btn_"+i).className = "";
		};
		document.getElementById(tabName+"_div_"+id).style.display = "block";
		btn.className = "curr";
};


function news_show(){
	$(document).ready(function(){
		$(".news_dis tr:nth-child(1)").show();
		$(".news_dis tr:nth-child(2)").show();
		$(".news_dis tr:nth-child(3)").show();
		$(".news_dis tr:nth-child(4)").show();
		$(".news_dis tr:nth-child(5)").show();
		$(".news_dis tr:nth-child(6)").show();
		$(".change_sta").click(function(){
			var dis = $(this).parent().parent().parent().parent().parent().find(".news_dis tr:nth-child(7)").css("display"); 
			if(dis == 'none'){
				$(this).parent().parent().parent().parent().parent().find("tr").show();
			}else{
				$(this).parent().parent().parent().parent().parent().find(".news_dis").find("tr").hide();
				$(".news_dis tr:nth-child(1)").show();
				$(".news_dis tr:nth-child(2)").show();
				$(".news_dis tr:nth-child(3)").show();
				$(".news_dis tr:nth-child(4)").show();
				$(".news_dis tr:nth-child(5)").show();
				$(".news_dis tr:nth-child(6)").show();
			}
		});
	});
}
