jQuery.noConflict();
jQuery(function($){
	//전체메뉴보기
	$('a[href=#allMenuBox]').click(function(){
		$('#allMenuBox').toggle();
		$(this).toggleClass("allMenu_open");
		return false;
	});
	//소식,공지사항 영역
	var tab_list = $('.tabDiv');
	var tab_list_i = tab_list.find('>ul>li');
	var tab_list_title = tab_list.find('>ul>li[class=tabActive] h3 a img');
	tab_list_i.find('>ul').hide();
	tab_list.find('>ul>li[class=tabActive]').find('>ul').show();
	function listTabMenuToggle(event){
		var t = $(this).parent();
		tab_list_i.find('>ul').hide();
		t.next('ul').show();
		tab_list_i.removeClass('tabActive');
		t.parent('li').addClass('tabActive');
		return false;
	}
	tab_list_i.find('h3>a').hover(listTabMenuToggle).focus(listTabMenuToggle);
	//issue
	$('.issueContent').before('<div id="issueContentPage"></div>')
	$('.issueContent').cycle({
		fx:'fade',
		speed:'fast', 
		fit:1,
		timeout:3000,
		width:201,
		height:172,
		pager:'#issueContentPage',
		pagerEvent:'focusin.cycle',
		pagerAnchorBuilder: paginate
	});
	function paginate(ind, el){
		return '<a href="#" class="num' + (ind+1) + '"></a>'
	}
	//language
	var languageBox_root=$('#languageBox');
	var languageBox_list=$('.languageList');
	var languageBox_btn=$('.btnLanguage');
	languageBox_btn.click(show_option);
	function show_option(){
		$(this).parent('div').children('ul').toggleClass('open');
		return false;
	}
	//language focus out
	$('*:not(".languageList a")').focus(function(){
		languageBox_list.removeClass('open');
	});
	//language mouseleave
	languageBox_root.mouseleave(function(){$(this).children('ul').removeClass('open')})

	//특수클리닉
	var tgContent = $('.proClinic');
	tgContent.hide();
	$('.tgSimple').click(function(){
		$($(this).toggleClass('open'));
		$($(this).attr('href')).toggle();//.find('a').eq(0).focus() 제일첫번째 요소에 포커스;
		return false;
	});
	//특수클리닉-페이지네비
	$('#proClinicList').pajinate({
		num_page_links_to_display :1,
		items_per_page :8,
		wrap_around:true,
		show_first_last:false,
		nav_label_prev : '<img src="images/main/btn_previous.png" alt="" />',
		nav_label_next : '<img src="images/main/btn_next.png" alt="" />' 
	});
});

