function changeImage( strId ) {

    if( !strId ) {
        return;
    }

    // サブ画像パス取得
    var strImgId = '#'+strId;
    var strSubImagePath = $(strImgId).attr('src');

    // メイン画像パス取得
    var strMainImagePath = $('#main_image').attr('src');

    // 入れ替え
    $('#main_image').attr('src', strSubImagePath);
    $(strImgId).attr('src', strMainImagePath);
}

function shapeTitle() {

    // 標準幅
    var nMaxWidth = 362;
    // 標準フォントサイズ
    var nDefaultSize = 16;
    // 店舗名Span
    var elSpan = document.getElementById('title_area');
    // フォントサイズを初期化
    elSpan.style.fontSize = nDefaultSize+'px';
    // タイトルエリアの幅を取得
    var nWidth = elSpan.offsetWidth;
    // 幅さが標準を越えた場合は、フォントサイズを下げる
    while( nWidth > nMaxWidth ) {
        shapeFont( elSpan );
        nWidth = elSpan.offsetWidth;
    }
}

function shapeFont( el ) {

    var nFontSize = el.style.fontSize.substr( 0, (el.style.fontSize.length-2) );
    --nFontSize;
    el.style.fontSize = nFontSize+'px';
}

function topics() {

    var arrDiv = [];

    arrDiv[0] = document.getElementById( 't_service' );
    arrDiv[1] = document.getElementById( 't_reserve' );
    arrDiv[2] = document.getElementById( 't_notice' );

    var nMinWidth = 364;
    var nTopicWidth = nMinWidth;

    for( var key in arrDiv ) {
        if( arrDiv[key] ) {
            if( nTopicWidth < arrDiv[key].offsetWidth ) {
                nTopicWidth = arrDiv[key].offsetWidth;
            }
        }
    }
    for( var key in arrDiv ) {
        if( arrDiv[key] ) {
            arrDiv[key].style.width = nTopicWidth+'px';
        }
    }
}

