$(function(){
///////////////////// start /////////////////////

// Page Scroll
$("a[href^=#]").click(function(){
	var Hash = $(this.hash);
	var HashOffset = $(Hash).offset().top;
	$("html,body").animate({
		scrollTop: HashOffset
	}, 500);
	return false;
});

// img Swap
var postfix = '_on';

$('.btn').not('[src*="'+ postfix +'."]').each(function() {
	var img = $(this);
	var src = img.attr('src');
	var src_on = src.substr(0, src.lastIndexOf('.'))
	           + postfix
	           + src.substring(src.lastIndexOf('.'));
	$('<img>').attr('src', src_on);
	img.hover(function() {
		img.attr('src', src_on);
	}, function() {
		img.attr('src', src);
	});
});

// img Fade
$(".fade").hover(function(){
	$(this).queue([]).stop();
	$(this).fadeTo(0,0.4);
},
function(){
	$(this).fadeTo(300,1.0);
});

// index-favorite_link
$("#favorite dl").hover(function(){
	$("#favorite dt img").queue([]).stop();
	$("#favorite dt img").fadeTo(0,0.4);
},
function(){
	$("#favorite dt img").fadeTo(300,1.0);
});

// policy-menu_link
$(".policy-ml").hover(function(){
	$(".policy-ml img").queue([]).stop();
	$(".policy-ml img").fadeTo(0,0.4);
	$(".policy-ml a").css("text-decoration","underline");
},
function(){
	$(".policy-ml img").fadeTo(300,1.0);
	$(".policy-ml a").css("text-decoration","none");
});

$(".policy-mr").hover(function(){
	$(".policy-mr img").queue([]).stop();
	$(".policy-mr img").fadeTo(0,0.4);
	$(".policy-mr a").css("text-decoration","underline");
},
function(){
	$(".policy-mr img").fadeTo(300,1.0);
	$(".policy-mr a").css("text-decoration","none");
});

//activity-menu_link
$(".activity-no1").hover(function(){
	$(".activity-no1 .pho img").queue([]).stop();
	$(".activity-no1 .pho img").fadeTo(0,0.4);
},
function(){
	$(".activity-no1 .pho img").fadeTo(300,1.0);
});

$(".activity-no2").hover(function(){
	$(".activity-no2 .pho img").queue([]).stop();
	$(".activity-no2 .pho img").fadeTo(0,0.4);
},
function(){
	$(".activity-no2 .pho img").fadeTo(300,1.0);
});

$(".activity-no3").hover(function(){
	$(".activity-no3 .pho img").queue([]).stop();
	$(".activity-no3 .pho img").fadeTo(0,0.4);
},
function(){
	$(".activity-no3 .pho img").fadeTo(300,1.0);
});

$(".activity-no4").hover(function(){
	$(".activity-no4 .pho img").queue([]).stop();
	$(".activity-no4 .pho img").fadeTo(0,0.4);
},
function(){
	$(".activity-no4 .pho img").fadeTo(300,1.0);
});

$(".activity-no5").hover(function(){
	$(".activity-no5 .pho img").queue([]).stop();
	$(".activity-no5 .pho img").fadeTo(0,0.4);
},
function(){
	$(".activity-no5 .pho img").fadeTo(300,1.0);
});

// top_visual
$(".face").hover(function(){
	$("img.vis").attr("src" , "images/btn_visual_on.jpg");
	},function(){
		$("img.vis").attr("src" , "images/btn_visual.jpg");
});

//css
$('#side #s-menu div dt:first-child').each(function(){
	$(this).css({
		'border-top' : '0'
	});
});

$('.activity-index li:first-child').each(function(){
	$(this).css({
		'background-image' : 'url("images/bg_activity.gif")',
		'background-position' : 'left top'
	});
});

$('.activity-index li:first-child h4').each(function(){
	$(this).css({
		'background-image' : 'url("../common/images/bg_arrow02.gif")',
		'background-position' : '3px 0.5em',
		'padding' : '0 89px 0 18px'
	});
});

$('.activity-index li:first-child p').each(function(){
	$(this).css({
		'padding' : '0 89px 0 18px'
	});
});

$('.activity-list li:last-child ,.greet-list li:last-child').each(function(){
	$(this).css({
		'margin-bottom' : '0',
		'border-bottom' : '0'
	});
});

$('.activity-list li dl.activity-mda dt:last-child, .activity-col .pdf-list li:last-child').each(function(){
	$(this).css({
		'margin-right' : '0',
		'border-right' : '0'
	});
});

$('.activity-col p:last-child, .art-col p:last-child, .art-col ul.key-ans li:last-child p').each(function(){
	$(this).css({
		'margin-bottom' : '0'
	});
});

$('.art-paper li:last-child, .art-column li:last-child, .column-list li:last-child').each(function(){
	$(this).css({
		'border-bottom' : '0'
	});
});

$('.art-paper li:first-child').each(function(){
	$(this).css({
		'padding' : '15px 0 25px'
	});
});

$('.column-list li:first-child').each(function(){
	$(this).css({
		'padding' : '10px 0 25px'
	});
});

$('.art-col ul.key-ans li:last-child p.pgtop').each(function(){
	$(this).css({
		'display' : 'none'
	});
});

///////////////////// end /////////////////////
});
