jQuery(function($){
	 // Think Tank
	 var tab_list = $('div.think_tank');
	 var tab_list_i = tab_list.find('>ul>li');
	 tab_list.removeClass('jx');
	 function listTabMenuToggle(event){
		  var t = $(this);
		  tab_list_i.removeClass('active');
		  t.parent('li').addClass('active');
		  return false;
	 }
	 tab_list_i.find('>button').hover(listTabMenuToggle).focus(listTabMenuToggle);
});

jQuery(function($){
	// Latest Sympathy
	var tab_list = $('div.sympathy');
	var tab_list_i = tab_list.find('>ul>li');
	tab_list.removeClass('jx');
	tab_list_i.find('>ul').hide();
	tab_list.find('>ul>li[class=active]').find('li').show();
	function listTabMenuToggle(event){
		var t = $(this);
		tab_list_i.find('>.sym_content').hide();
		t.next('.sym_content').show();
		tab_list_i.removeClass('active');
		t.parent('li').addClass('active');
		return false;
	}
	tab_list_i.find('>h4').hover(listTabMenuToggle).focus(listTabMenuToggle);
});

jQuery(function($){
	// Main Latest
	var tab_list = $('div.main_latest');
	var tab_list_i = tab_list.find('>ul>li');
	tab_list.removeClass('jx');
	tab_list_i.find('>ul').hide();
	tab_list.find('>ul>li[class=active]').find('>ul').show();
	function listTabMenuToggle(event){
		var t = $(this);
		tab_list_i.find('>ul').hide();
		t.next('ul').show();
		tab_list_i.removeClass('active');
		t.parent('li').addClass('active');
		return false;
	}
	tab_list_i.find('>a').hover(listTabMenuToggle).focus(listTabMenuToggle);
});



jQuery(function($){
	// Notice Popup(알림판)
	var tab_list = $('div.notice_popup');
	var tab_list_i = tab_list.find('>ul>li');
	tab_list.removeClass('jx');
	tab_list.find('>ul>li[class=active]').show();
	function listTabMenuToggle(event){
		var t = $(this);
		tab_list_i.removeClass('active');
		t.parent('li').addClass('active');
		return false;
	}
	tab_list_i.find('>a').hover(listTabMenuToggle).focus(listTabMenuToggle);
});

jQuery(function($){
	// Go Popup(바로가기)
	var tab_list = $('div.go_popup');
	var tab_list_i = tab_list.find('>ul>li');
	tab_list.removeClass('jx');
	tab_list.find('>ul>li[class=active]').show();
	function listTabMenuToggle(event){
		var t = $(this);
		tab_list_i.removeClass('active');
		t.parent('li').addClass('active');
		return false;
	}
	tab_list_i.find('>a').hover(listTabMenuToggle).focus(listTabMenuToggle);
});

//헤더 BTN 롤링
var tank_which = 0;
var tank_timer = [];
var action = 'f';
var tank_totalSize = 4;

function tank_forward()
{
	tank_which++;
	if (tank_which > tank_totalSize-1 || tank_which < 0) tank_which = 0;
	for (var i=0;i<tank_totalSize;i++) {
		var fld = document.getElementById("tank_"+i);
		fld.className = (i == tank_which) ? 'active' : '';
	}
}

function tank_backward()
{
	tank_which--;
	if (tank_which < 0) tank_which = tank_totalSize-1;
	for (var i=0;i<tank_totalSize;i++) {
		var fld = document.getElementById("tank_"+i);
		fld.className = (i == tank_which) ? 'active' : '';
	}
}

function tank_Stopdisplay() {
	clearInterval(tank_timer);
}

function tank_Startdisplay(act) {
	if (act == 'f')
	{
		action = 'f'
		tank_Stopdisplay();
		tank_timer = setInterval('tank_forward()',3000);
	}
	else
	{
		action = 'b'
		tank_Stopdisplay();
		tank_timer = setInterval('tank_backward()',3000);
	}
}

tank_Startdisplay('f');

//연구회동정 자동 롤링
/*
var pop_which = 0;
var pop_timer = [];
var action = 'f';
var pop_totalSize = 3;

function pop_forward()
{
	pop_which++;
	if (pop_which > pop_totalSize-1 || pop_which < 0) pop_which = 0;
	for (var i=0;i<pop_totalSize;i++) {
		var fld = document.getElementById("popup_"+i);
		fld.className = (i == pop_which) ? 'active' : '';
	}
}

function pop_backward()
{
	pop_which--;
	if (pop_which < 0) pop_which = pop_totalSize-1;
	for (var i=0;i<pop_totalSize;i++) {
		var fld = document.getElementById("popup_"+i);
		fld.className = (i == pop_which) ? 'active' : '';
	}
}

function pop_Stopdisplay() {
	clearInterval(pop_timer);
}

function pop_Startdisplay(act) {
	if (act == 'f')
	{
		action = 'f'
		pop_Stopdisplay();
		pop_timer = setInterval('pop_forward()',3000);
	}
	else
	{
		action = 'b'
		pop_Stopdisplay();
		pop_timer = setInterval('pop_backward()',3000);
	}
}

pop_Startdisplay('f');
*/


// 알림판 팝업
var notice_which = 0;
var notice_timer = [];
var action = 'f';
var notice_totalSize = 3;

function notice_forward() {
	notice_which++;
	if (notice_which > notice_totalSize-1 || notice_which < 0) notice_which = 0;
	for (var i=0;i<notice_totalSize;i++) {
		var fld = document.getElementById("notice_"+i);
		fld.className = (i == notice_which) ? 'active' : '';
	}
}

function notice_backward() {
	notice_which--;
	if (notice_which < 0) notice_which = notice_totalSize-1;
	for (var i=0;i<notice_totalSize;i++) {
		var fld = document.getElementById("notice_"+i);
		fld.className = (i == notice_which) ? 'active' : '';
	}
}

function notice_Stopdisplay() {
	clearInterval(notice_timer);
}

function notice_Startdisplay(act) {
	if (act == 'f')
	{
		action = 'f'
		notice_Stopdisplay();
		notice_timer = setInterval('notice_forward()',3000);
	}
	else
	{
		action = 'b'
		notice_Stopdisplay();
		notice_timer = setInterval('notice_backward()',3000);
	}
}

notice_Startdisplay('f');


// 바로가기 팝업
var go_which = 0;
var go_timer = [];
var action = 'f';
var go_totalSize = 2;

function go_forward() {
	go_which++;
	if (go_which > go_totalSize-1 || go_which < 0) go_which = 0;
	for (var i=0;i<go_totalSize;i++) {
		var fld = document.getElementById("go_"+i);
		fld.className = (i == go_which) ? 'active' : '';
	}
}

function go_backward() {
	go_which--;
	if (go_which < 0) go_which = go_totalSize-1;
	for (var i=0;i<go_totalSize;i++) {
		var fld = document.getElementById("go_"+i);
		fld.className = (i == go_which) ? 'active' : '';
	}
}

function go_Stopdisplay() {
	clearInterval(go_timer);
}

function go_Startdisplay(act) {
	if (act == 'f')
	{
		action = 'f'
		go_Stopdisplay();
		go_timer = setInterval('go_forward()',3000);
	}
	else
	{
		action = 'b'
		go_Stopdisplay();
		go_timer = setInterval('go_backward()',3000);
	}
}

go_Startdisplay('f');
