$(function () {
	/*list-class control*/
	$('.zebra li:odd').addClass('odd');
	$('.zebra li:last-child').css({'border-bottom':'none'});
	$('#footer li:first-child').addClass('first');
	$('.tabList li:nth-child(6)').addClass('borderNone');
	$('.ver4box .tabList li:nth-child(4)').addClass('borderNone');
	$('.ver4box .tabList li:nth-child(6)').removeClass('borderNone');
	$('.listSet li:odd').addClass('w235');
	
	/*side navigation*/
	$('.level02').css('display', 'none');
	$('.level02 ul li:last-child').addClass('last');
	$('.level01 .newEntryList ul li:last-child').addClass('last');
	$('.toggle').click(function() {
		$(this).siblings('.level02').slideToggle(500);
		return false;
	});
	
	/*tab navigation*/
	$("#tab01 ul.tabList li:first a").addClass("current");
  	$("#tab01 ul.tabPanel li:not(:first)").hide();
  	$("#tab01 ul.tabList a").click(function(){
    if(!$(this).hasClass("current")){
      $("#tab01 ul.tabList a.current").removeClass("current");
      $(this).addClass("current");
      $("#tab01 ul.tabPanel li").hide().filter($(this).attr("href")).show();
    }
    return false;
	});
	$("#tab02 ul.tabList li:first a").addClass("current");
  	$("#tab02 ul.tabPanel li:not(:first)").hide();
  	$("#tab02 ul.tabList a").click(function(){
    if(!$(this).hasClass("current")){
      $("#tab02 ul.tabList a.current").removeClass("current");
      $(this).addClass("current");
      $("#tab02 ul.tabPanel li").hide().filter($(this).attr("href")).show();
    }
    return false;
	});
	$("#tab03 ul.tabList li:first a").addClass("current");
  	$("#tab03 ul.tabPanel li:not(:first)").hide();
  	$("#tab03 ul.tabList a").click(function(){
    if(!$(this).hasClass("current")){
      $("#tab03 ul.tabList a.current").removeClass("current");
      $(this).addClass("current");
      $("#tab03 ul.tabPanel li").hide().filter($(this).attr("href")).show();
    }
    return false;
	});
	
	$('a[href*=#].scrollto').click(function() {
	if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	&& location.hostname == this.hostname) {
		var $target = $(this.hash);
		$target = $target.length && $target
		|| $('[name=' + this.hash.slice(1) +']');
	if ($target.length) {
		var targetOffset = $target.offset().top;
		$('html,body')
			.animate({scrollTop: targetOffset}, 1000);
		return false;
		}
	}
  });
});
