(function($) { document.write('<' + 'style>*[data-sc-role="menu"]{display:none}<' + '/style>'); $(function() { $(window).bind('orientationchange,resize', function() { $('.sp-wrapper').width($(window).width()); }).triggerHandler('orientationchange'); $('div[data-sc-role="main"] img').each(function() { var $img = $(this).removeAttr('height'); var func = function() { $img.css({ width: '100%', 'max-width': $img.width() + 'px' }); }; if ($img.width()) { func(); } else { var count = 100; var interval = setInterval(function() { if ($img.width()) { clearInterval(interval); func(); } count--; if (count < 0) { clearInterval(interval); } }, 300); } }); $('div[data-sc-role="main"]').find('th[width],td[width],colgroup[width]').each(function() { $(this).removeAttr('width'); }); $('div[data-sc-role="main"] *[width]').not('img').each(function() { $(this).attr('width', '100%'); }); if (!location.href.match(/menulist\.html/)) { $('div[data-sc-role="main"] table').each(function() { var $table = $(this).clone(); if (!$table.children('tbody').length) { $table.children('tr').wrapAll(''); } var $tbody = $table.children('tbody').eq(0); var bool = $table.text().replace(/\s\r\n/, '').length > $table.find('th,td').length * 5; bool = !bool ? $table.width() > $('body').width() : bool; bool = bool ? !$table.hasClass('sp-table-nonChange') : bool; if (bool) { $table.children('tbody,thead,tfoot').each(function() { $(this).children('tr').each(function() { if (!$(this).children('td').length && $(this).children().length > 1) { bool = false; } }); }); } if (bool) { bool = $tbody.find('th').length ? true : false; } if (bool) { var $newTable = $(''); $table.children('tbody,thead,tfoot').each(function() { var $container = $(this).clone().empty().appendTo($newTable); $(this).children('tr').each(function() { if (!$(this).children('td').length && $(this).children().length == 1) { $('').append($(this).children().removeAttr('colspan').removeAttr('rowspan').addClass('sp-table-title')).appendTo($container); } else { $(this).children().each(function(i) { $('').append($(this).removeAttr('colspan').removeAttr('rowspan')).appendTo($container); }); } }); }); $table.remove(); $newTable.insertAfter($(this)); $(this).remove(); } }); } $('div[data-sc-role="main"] input:text,div[data-sc-role="main"] textarea').each(function() { $(this).css({ 'max-width': $(this).width() + 'px', width: '100%' }); $(this).removeAttr('size').removeAttr('length').removeAttr('rows').removeAttr('cols'); }); $('*[data-sc-icon-right]').each(function() { if (!$(this).find('*[data-sc-role="icon-text"]').length) { $(this).contents().wrapAll($('').attr('data-sc-role', 'icon-text')); } var iconUrl = $(this).attr('data-sc-icon-right'); var $icon = $('').attr('data-sc-role', 'icon-right').appendTo($(this)); $('').attr({ src: iconUrl, alt: '' }).appendTo($icon); }); $('*[data-sc-icon-left]').each(function() { if (!$(this).find('*[data-sc-role="icon-text"]').length) { $(this).contents().wrapAll($('').attr('data-sc-role', 'icon-text')); } var iconUrl = $(this).attr('data-sc-icon-left'); var $icon = $('').attr('data-sc-role', 'icon-left').appendTo($(this)); $('').attr({ src: iconUrl, alt: '' }).appendTo($icon); }); $('a[data-sc-modal]').click(function(e) { e.preventDefault(); var href = $(this).attr('href'); history.pushState(null, null, href); var $modal = $('
').attr({ 'data-sc-role': 'modal' }).prependTo('body:eq(0)').hide(); var $modalInner = $('
').attr({ 'data-sc-role': 'modal-inner' }).appendTo($modal); if (href.substring(0, 1) == '#') { $(href).show().appendTo($modalInner); $modal.fadeIn(200); $('*[data-sc-role="wrapper"]').fadeOut(100); } else {} }); var pathname = location.pathname; $(window).bind('popstate', function(e) { e.preventDefault(); if (pathname == location.pathname) { $('*[data-sc-role="modal"]').fadeOut(100, function() { $('*[data-sc-role="modal-inner"]').children().hide().appendTo('body:eq(0)'); $(this).remove(); }); $('*[data-sc-role="wrapper"]').fadeIn(200); } }); }); })(jQuery); $(function() { $('.gMap').css('width', '100%'); $('.twtr-doc').css('width', ''); $('.rslides img').css('max-width', ''); $('#navi img').css('max-width', ''); }); $(document).ready(function() { $('.accordion_head').click(function() { $(this).next().slideToggle(); }).next().hide(); }); window.addEventListener('load', function() { setTimeout(doScroll, 100); }, false); window.onorientationchange = function() { setTimeout(doScroll, 100); }; function doScroll() { if (window.pageYOffset === 0) { window.scrollTo(0, 1); } }