;
(function($) {
//本文のみ表示
$(function() {
var displayURL = location.href;
var numPosition = displayURL.indexOf('?');
var displayName = displayURL.substring(numPosition+1);
if(displayName == 'display'){
$('head').append("");
css = $('head').children(':last');
css.attr({
rel: 'stylesheet',
type: 'text/css',
href: 'http://www.tmd.ac.jp/common/css-tmd/base/display-part.css'
});
}
});
//スマフォメニュー
$(function() {
//$('#header .sp-menu').hide();
$(".sp-header-btn").click(function(){
$("#header .sp-menu").toggle();
if ($('#header .sp-menu').is(':visible')) {
$(".sp-header-btn img").attr('src', $(".sp-header-btn img").attr("src").replace("_off.", "_on."));
} else {
$(".sp-header-btn img").attr('src', $(".sp-header-btn img").attr("src").replace("_on.", "_off."));
}
});
$(".sp-header-btn2").click(function(){
$("#header .sp-menu2").toggle();
if ($('#header .sp-menu2').is(':visible')) {
$(".sp-header-btn2 img").attr('src', $(".sp-header-btn2 img").attr("src").replace("_off.", "_on."));
} else {
$(".sp-header-btn2 img").attr('src', $(".sp-header-btn2 img").attr("src").replace("_on.", "_off."));
}
});
});
$(function() {
//$('#header .sp-menu').hide();
$(".sp-header-search").click(function(){
$("#header .search-deco").toggle();
if ($('#header .search-deco').is(':visible')) {
$(".sp-header-search img").attr('src', $(".sp-header-search img").attr("src").replace("_off.", "_on."));
} else {
$(".sp-header-search img").attr('src', $(".sp-header-search img").attr("src").replace("_on.", "_off."));
}
});
/*
$(".sp-header-btn a").toggle(function(){
$(".sp-header-btn a img").attr('src', $(".sp-header-btn a img").attr("src").replace("_off.", "_on."));
},function(){
$(".sp-header-btn a img").attr('src', $(".sp-header-btn a img").attr("src").replace("_on.", "_off."));
});
*/
});
//サイトマップ開閉
$(function() {
var Target_click = '.sitemap .junction-h2 .junction-btn , .unauthorized .junction-h2 .junction-btn , .not-found .junction-h2 .junction-btn , .forbidden .junction-h2 .junction-btn'
var Target_parents = '.junction';
var Target_find = '.junction-box';
$('.junction').each(function() {
if ($(this).find('.junction-box').length === 0) {
$(this).find('.junction-btn').hide();
}
})
if($(Target_click).parents(Target_parents).find(Target_find).css('display') == 'none'){
$(Target_click).find('span').addClass("icon");
$(Target_click).find('span').removeClass("icon-on").text('開く');
} else {
$(Target_click).find('span').addClass("icon-on");
$(Target_click).find('span').removeClass("icon").text('閉じる');
}
$(Target_click).on('click', function(){
if($(this).parents(Target_parents).find(Target_find).css('display') == 'none'){
$(this).find('span').addClass("icon-on");
$(this).find('span').removeClass("icon").text('閉じる');
$(this).parents(Target_parents).find(Target_find).slideDown();
} else {
$(this).find('span').addClass('icon');
$(this).find('span').removeClass("icon-on").text('開く');
$(this).parents(Target_parents).find(Target_find).slideUp();
}
});
});
//SNS
$(function() {
var url = document.URL;
$('#main .social-area .book').append('');
$('#main .social-area .facebook').append('');
$('#footer .footer-social-area .facebook').append('');
});
})(jQuery);