// "@(#) $Revision: 1.20 $ (zexy)"
/*----------------------------------------------------------------------------/
/ wd_grandnavi.js
/ グランドなび
/
/ Notes:
/ ・コメントタグとコメントの間は半角スペースを使用(//〜のコメントは使わない)
/ ・2byte文字でおかしくなるときは、その文字の前後にスペースとか/を入れてみる
/ ・リンクはすべてリンクシステム(location.cgi)経由で設定する
/
/ function:
/   [public]
/   xynavi_PrintGrandHeader
/   xynavi_PrintGrandHeaderNoBreadCrumbs
/   xynavi_PrintGrandHeader_s
/   xynavi_PrintGrandHeader_m
/   xynavi_PrintGrandFooter
/   xynavi_PrintGrandFooter_s_ng
/   xynavi_PrintGrandFooter_s
/   [private]
/   xynavi_preload
/   xynavi_preloadForHeader
/   xynavi_getParam
/   xynavi_getCookie
/   xynavi_setCookie
/   xynavi_setCookieForSubdomain
/   xynavi_setLocationCGI
/   xynavi_getHanCD
/   xynavi_replaceKeywords
/   xynavi_getCallHeaderCGITag
/   xynavi_img
/----------------------------------------------------------------------------*/
/* 画像ディレクトリパス */
var xynavi_ImageDir     = '/commonxy/img';
/* location.cgi のURL   */
var xynavi_LocationCGI  = '/cgi-bin/location.cgi?X_CD=GRANDNAVI';
/* location.cgi のURL(グランドフッタ用) */
var xynavi_LocationCGI_footer = '/cgi-bin/location.cgi?X_CD=GRANDFOOTER';
/* ゼクシィnet のリンクCD */
var xynavi_zexy_cd      = 'TP001';
/* ゼクシィnet のリンクCD(ミニヘッダ用) */
var xynavi_zexy_cd_m      = 'TP000';
/* RECRUITフッタロゴ    */
var xynavi_RecruitGIF   = '/common/parts/common_footer_logo.gif';
/* zexy.net サーバ名 */
var xynavi_ZexyServer   = 'http://zexy.net';
/* iIMGタグ用URL */
var xynavi_ImgServerName   = '';
/* リクルートロゴURL表示可否フラグ */
var xynavi_recruit_link_flg = false;
/* 版コード */
var xynavi_hanCDs = {hokaido:"01",tohoku:"02",hokuriku:"03",kanto:"04",tokai:"05",kansai:"06",chugoku:"07",kyushu:"08",sikoku:"10"};
/* 動作環境フラグ */
var xynavi_ExecEnv;
/* フッタ  小版  幅(ヘッダ  小版が呼び出された場合は、ヘッダの幅が設定される。) */
var xynavi_mid_col_width = "100%";

/* location.cgiのURIと画像ファイルの参照ディレクトリを生成 */
xynavi_setLocationCGI();

/* ドメイン名取得 */
var xynavi_domain  = document.domain;           /* ドメイン名 */

/******************************************************************************************
[関数名]    xynavi_PrintGrandHeader
[処理概要]  ゼクシィ グランドヘッダ(パンクズあり)出力


[引数]
 No. 引数         必須  説明
  1. js_han_cd     ×   版コード
  2. class_cd      ●   階層指定
  3. subtop_cd     ×   サブTOPコード(階層指定=3以上の場合、必須)
  4. p_left_margin ×   左余白幅
   

[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_PrintGrandHeader(js_han_cd, p_class_cd, subtop_cd, p_left_margin) {
    
    /* 変数 */
    var class_cd; /* 階層指定 */
    p_left_margin /* 左余白幅 */
    
    /* パラメータチェック */
    /* 左余白幅 数値でなければ、0*/
    if (isNaN(p_left_margin) || p_left_margin == null) {
        left_margin = 0;
    } else {
        left_margin = p_left_margin;
    }
    /* リクルートロゴリンク表示判定 */
    if ( subtop_cd == null || subtop_cd == "") {
        /* エリアTOPの場合は、リンク表示 */
        xynavi_recruit_link_flg = true;
    }
    
    /* 階層指定取得(2 or 3以外は、4とする) */
    if (p_class_cd != null && ( p_class_cd==2 || p_class_cd==3) ) {
        class_cd = p_class_cd;
    } else {
        class_cd = 4;
    }
    
    /* 版コード取得 */
    var han_cd = xynavi_getHanCD(js_han_cd);

    /* 画像先読 */
    xynavi_preloadForHeader(han_cd);
    
    /* 左余白=p_left_margin,パンクズ表示でグランドヘッダ表示CGIを呼び出すscriptタグを生成、出力 */
    var tag = xynavi_getCallHeaderCGITag(han_cd, class_cd, subtop_cd, left_margin, 1);
    document.write(tag);
}

/******************************************************************************************
[関数名]    xynavi_PrintGrandHeaderNoBreadCrumbs
[処理概要]  ゼクシィ グランドヘッダ(パンクズなし)出力


[引数]
 No. 引数           必須  説明
  1. js_han_cd       ×   版コード
  2. subtop_cd       ×   サブTOPコード
  3. p_left_margin   ×   左余白幅

[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_PrintGrandHeaderNoBreadCrumbs (js_han_cd, subtop_cd, p_left_margin) {
    
    /* リクルートロゴリンク表示判定 */
    if ( subtop_cd == null || subtop_cd == "") {
        /* エリアTOPの場合は、リンク表示 */
        xynavi_recruit_link_flg = true;
    }
    /* パラメータチェック */
    /* 左余白幅 数値でなければ、0*/
    if (isNaN(p_left_margin) || p_left_margin == null) {
        left_margin = 0;
    } else {
        left_margin = p_left_margin;
    }
    
    /* 版コード取得 */
    var han_cd = xynavi_getHanCD(js_han_cd);

    /* 画像先読 */
    xynavi_preloadForHeader(han_cd);

    /* 階層指定=0,パンクズ非表示でグランドヘッダ表示CGIを呼び出すscriptタグを生成、出力 */
    var tag = xynavi_getCallHeaderCGITag(han_cd, 0, subtop_cd, left_margin, 0);
    document.write(tag);
}
/******************************************************************************************
[関数名]    xynavi_PrintGrandHeader_s
[処理概要]  ゼクシィ グランドヘッダ  小版  出力


[引数]
 No. 引数             必須  説明
  1. p_header_width    ×   ヘッダ幅
  2. p_left_margin     ×   左余白幅
  3. p_disp_close_btn  ×   クローズボタン表示・非表示フラグ

[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_PrintGrandHeader_s (p_header_width, p_left_margin, p_disp_close_btn) {

    /* 変数 */
    var header_width;   /* ヘッダ幅 */
    var left_margin;    /* 左余白幅 */
    var disp_close_btn; /* クローズボタン表示・非表示フラグ */
    var zexy_top_logo = "";  /* ZexyTOPロゴ */
    var close_btn     = "";  /* クローズボタン */

    /* 画像先読み */
    var prImg= new Array(1);
    prImg[0] = xynavi_ImgServerName + xynavi_ImageDir + "/" + "bt_close_s_ov.gif";
    xynavi_preload(prImg);

    /* パラメータチェック */
    /* ヘッダ幅 数値でなければ、710 */
    if (isNaN(p_header_width) || p_header_width == null) {
        header_width = 710;
    } else {
        header_width = p_header_width;
    }
    /* 左余白幅 数値でなければ、0*/
    if (isNaN(p_left_margin) || p_left_margin == null) {
        left_margin = 0;
    } else {
        left_margin = p_left_margin;
    }
    /* 余白を除いたヘッダ幅算出 */
    if (left_margin > 0) {
        xynavi_mid_col_width = header_width - (left_margin * 2);
    }else{
        xynavi_mid_col_width = header_width;
    }
    
    /* クローズボタン表示・非表示フラグ nullなら、true(表示) */
    if (p_disp_close_btn == null) {
        disp_close_btn = true;
    } else {
        disp_close_btn = p_disp_close_btn;
    }
    
    /* クローズボタン表示・ZexyTOPリンク表示処理 */
    zexy_top_logo = '<img src="[xynavi_ImgServerName]/commonxy/img/hd_title_s.gif" alt="結婚が決まったら結婚式準備サイト-ゼクシィｎｅｔ" width="103" height="26" border="0">';
    if (disp_close_btn) {
        close_btn = '<a href="javascript:window.opener = window;var win = window.open(location.href,\'_self\');window.close();" onMouseOver="xynavi_img(\'bt_close_s\',\'[xynavi_ImgServerName]/commonxy/img/bt_close_s_ov.gif\')" onMouseOut="xynavi_img(\'bt_close_s\',\'[xynavi_ImgServerName]/commonxy/img/bt_close_s.gif\')">' +
                    '<img src="[xynavi_ImgServerName]/commonxy/img/bt_close_s.gif" alt="閉じる" width="48" height="26" border="0" name="bt_close_s">' +
                    '</a>';
    } else {
        zexy_top_logo = '<a href="[xynavi_LocationCGI]&LINK_CD=[xynavi_zexy_cd_m]" target="_top">' +
                        zexy_top_logo +
                    '</a>';
    }
    /* HTML出力 */
    var tmplStr; /* テンプレートHTML 可変の部分を[変数名]で記述、replaceメソッドで置き換え*/
    tmplStr  ='<div id="ngheader">' +
              '    <table width="[header_width]" border="0" cellpadding="0" cellspacing="0">' +
              '    <tr>' +
              '    <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="[left_margin]" height="1"></td>' +
              '    <td width=[xynavi_mid_col_width] valign="bottom">' +
              '        <table width="100%"border="0" cellpadding="0" cellspacing="0">' +
              '        <tr>' +
              '        <td width="103" valign="bottom" align="left" nowrap>' + 
              zexy_top_logo +
              '        </td>' +
              '        <td width="100%"><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="100%" height="40" border="0"></td>' +
              '        <td width="171" valign="bottom" align="right" nowrap>' +
              '        <img src="[xynavi_ImgServerName]/commonxy/img/pbrecruit_black.gif" width="113" height="5" alt="PRODUCED BY RECRUIT"><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="10" height="1">' +
              close_btn +
              '        </td>' +
              '        </tr>' +
              '        <tr>' +
              '        <td colspan="3"><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="5"></td>' +
              '        </tr>' +
              '        <tr>' +
              '        <td colspan="3" background="[xynavi_ImgServerName]/commonxy/img/hd_line_s_bg.gif"><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="100%" height="5"></td>' +
              '        </tr>' +
              '        </table>' +
              '    </td>' +
              '    <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="[left_margin]" height="1"></td>' +
              '    </tr>' +
              '    </table>' +
              '</div>';

    /* 置換キーワード・値配列作成 */
    var aryReplaceInfo = [
        {keyword:'\\[left_margin\\]'         ,value : left_margin         },
        {keyword:'\\[header_width\\]'        ,value : header_width        },
        {keyword:'\\[xynavi_mid_col_width\\]',value : xynavi_mid_col_width},
        {keyword:'\\[xynavi_LocationCGI\\]'  ,value : xynavi_LocationCGI  },
        {keyword:'\\[xynavi_zexy_cd_m\\]'    ,value : xynavi_zexy_cd_m    },
        {keyword:'\\[xynavi_ImgServerName\\]',value : xynavi_ImgServerName }
    ];

    /* キーワード→値  置換処理 */
    tmplStr = xynavi_replaceKeywords(tmplStr, aryReplaceInfo);

    document.write(tmplStr);
}

/******************************************************************************************
[関数名]    xynavi_PrintGrandHeader_m
[処理概要]  ゼクシィ グランドヘッダ  中版  出力


[引数]
 No. 引数             必須  説明
  1. p_header_width    ×   ヘッダ幅
  2. p_left_margin     ×   左余白幅

[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_PrintGrandHeader_m(p_header_width, p_left_margin) {
    
    // 変数
    var left_margin = p_left_margin;   // 左余白幅
    var header_width = p_header_width; // ヘッダ幅
    
    /* 引数チェック */
    // 引数のヘッダ幅が、数値でなければ、ヘッダ幅を950とする。
    if (isNaN(header_width) || header_width == null) {
        header_width = 950;
    }
    
    /* 引数の左余白幅が、数値でなければ、左余白幅を0・                */
    /* ヘッダ幅を910(次世代ハコ以外から呼ばれた場合向け)とする。      */
    if (isNaN(left_margin) || left_margin == null) {
        left_margin = 0;
        header_width -= 40; /* 次世代ハコ・会員系画面以外から呼ばれた場合向けに40px差し引く */
    }

    /* 余白を除いたヘッダ幅算出 */
    if (left_margin > 0) {
        xynavi_mid_col_width = header_width - (left_margin * 2);
    }else{
        xynavi_mid_col_width = header_width;
    }
    
    /* HTML出力 */
    var tmplStr; /* テンプレートHTML 可変の部分を[変数名]で記述、replaceメソッドで置き換え*/
    tmplStr  = '<div id="ngheader">';
    tmplStr += '    <table width="[header_width]" border="0" cellpadding="0" cellspacing="0" class="bg_w">';
    tmplStr += '    <tr>';
    tmplStr += '    <td rowspan="3"><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="[left_margin]" height="1"></td>';
    tmplStr += '    <td >';
    tmplStr += '        <table width="[xynavi_mid_col_width]" border="0" cellspacing="0" cellpadding="0">';
    tmplStr += '        <tr>';
    tmplStr += '        <td valign="bottom">';
    tmplStr += '            <table border="0" cellspacing="0" cellpadding="0">';
    tmplStr += '            <tr>';
    tmplStr += '            <td><a href="[xynavi_LocationCGI]&LINK_CD=[xynavi_zexy_cd_m]" target="_top"><img src="[xynavi_ImgServerName]/commonxy/img/hd_title.gif" alt="結婚が決まったら結婚式準備サイト-ゼクシィｎｅｔ" width="134" height="34" border="0"></a></td>';
    tmplStr += '            </tr>';
    tmplStr += '            <tr>';
    tmplStr += '            <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="6"></td>';
    tmplStr += '            </tr>';
    tmplStr += '            <tr>';
    tmplStr += '            <td><img src="[xynavi_ImgServerName]/commonxy/img/pbrecruit_black.gif" alt="PRODUCED BY RECRUIT" width="113" height="5" border="0"></td>';
    tmplStr += '            </tr>';
    tmplStr += '            </table>';
    tmplStr += '        </td>';
    tmplStr += '        <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="60"></td>';
    tmplStr += '        </tr>';
    tmplStr += '        </table>';
    tmplStr += '    </td>';
    tmplStr += '    <td rowspan="3"><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="[left_margin]" height="1"></td>';
    tmplStr += '    </tr>';
    tmplStr += '    <tr>';
    tmplStr += '    <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="5"></td>';
    tmplStr += '    </tr>';
    tmplStr += '    <tr>';
    tmplStr += '    <td><img src="[xynavi_ImgServerName]/commonxy/img/hd_line.gif" width="[xynavi_mid_col_width]" height="5"></td>';
    tmplStr += '    </tr>';
    tmplStr += '    </table>';
    tmplStr += '</div>';

    /* 置換キーワード・値配列作成 */
    var aryReplaceInfo = [
        {keyword:'\\[left_margin\\]'         ,value : left_margin         },
        {keyword:'\\[header_width\\]'        ,value : header_width        },
        {keyword:'\\[xynavi_mid_col_width\\]',value : xynavi_mid_col_width},
        {keyword:'\\[xynavi_LocationCGI\\]'  ,value : xynavi_LocationCGI  },
        {keyword:'\\[xynavi_zexy_cd_m\\]'    ,value : xynavi_zexy_cd_m    },
        {keyword:'\\[xynavi_ImgServerName\\]',value : xynavi_ImgServerName }
    ];
    
    /* キーワード→値  置換処理 */
    tmplStr = xynavi_replaceKeywords(tmplStr, aryReplaceInfo);

    document.write(tmplStr);
}

/******************************************************************************************
[関数名]    xynavi_PrintGrandFooter
[処理概要]  ゼクシィ グランドフッタ 出力


[引数]
 No. 引数             必須  説明
  1. logo_url          ×   ロゴURL
  2. p_pid             ×   ページID
  3. p_disp_isize_logo ×   isizeリンク表示フラグ
  4. p_left_margin     ×   左余白幅
  5. p_footer_width    ×   フッタ幅(余白除く)

[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_PrintGrandFooter (logo_url, p_pid, p_disp_isize_logo, p_left_margin, p_footer_width) {

    /* 変数 */
    var logo_img;              /* フッタロゴ  */
    var pid;                   /* ページID */
    var disp_isize_logo;       /* isizeリンク表示フラグ */
    var left_margin;           /* 左余白幅 */
    var footer_width;          /* フッタ幅(余白除く) */
    var recruit_logo_link_flg; /* リクルートロゴのリンク可否フラグ */
    var han_cd;                /* 版コード */
    var link_cd = new Array(); /* リンクCD */

    
    /* ブラウザ情報取得 */
    var Win = navigator.appVersion.indexOf('Win',0) != -1;
    var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
    var IE = navigator.appName.indexOf('Microsoft',0) != -1;
    var NN4 = Boolean(document.layers);
    



    /* リンクCD設定 */
    link_cd = {
        /* 北海道 */
        '01' : {
            party    : 'WT102',
            resort   : 'B8051',
            abroad   : 'B3008',
            ring     : 'WT103',
            dress    : 'WT104',
            goods    : 'WT105',
            nijikai  : '',
            house    : 'NT111',
            interior : 'NT112',
            money    : 'NT113'
        },
        /* 東北 */
        '02' : {
            party    : 'WT202',
            resort   : 'B8051',
            abroad   : 'B3008',
            ring     : 'WT203',
            dress    : 'WT204',
            goods    : 'WT205',
            nijikai  : '',
            house    : 'NT211',
            interior : 'NT212',
            money    : 'NT213'
        },
        /* 関東 */
        '04' : {
            party    : 'WT302',
            resort   : 'B8051',
            abroad   : 'B3008',
            ring     : 'WT303',
            dress    : 'WT304',
            goods    : 'WT305',
            nijikai  : 'WT306',
            house    : 'NT311',
            interior : 'NT312',
            money    : 'NT313'
        },
        /* 北陸･甲信越・静岡 */
        '03' : {
            party    : 'WT402',
            resort   : 'B8051',
            abroad   : 'B3008',
            ring     : 'WT403',
            dress    : 'WT404',
            goods    : 'WT405',
            nijikai  : '',
            house    : 'NT411',
            interior : 'NT412',
            money    : 'NT413'
        },
        /* 東海 */
        '05' : {
            party    : 'WT502',
            resort   : 'B8051',
            abroad   : 'B3008',
            ring     : 'WT503',
            dress    : 'WT504',
            goods    : 'WT505',
            nijikai  : 'WT506',
            house    : 'NT511',
            interior : 'NT512',
            money    : 'NT513'
        },
        /* 関西 */
        '06' : {
            party    : 'WT602',
            resort   : 'B8051',
            abroad   : 'B3008',
            ring     : 'WT603',
            dress    : 'WT604',
            goods    : 'WT605',
            nijikai  : 'WT606',
            house    : 'NT611',
            interior : 'NT612',
            money    : 'NT613'
        },
        /* 中国 */
        '07' : {
            party    : 'WT702',
            resort   : 'B8051',
            abroad   : 'B3008',
            ring     : 'WT703',
            dress    : 'WT704',
            goods    : 'WT705',
            nijikai  : '',
            house    : 'NT711',
            interior : 'NT712',
            money    : 'NT713'
        },
        /* 四国 */
        '10' : {
            party    : 'WT802',
            resort   : 'B8051',
            abroad   : 'B3008',
            ring     : 'WT803',
            dress    : 'WT804',
            goods    : 'WT805',
            nijikai  : '',
            house    : 'NT811',
            interior : 'NT812',
            money    : 'NT813'
        },
        /* 九州 */
        '08' : {
            party    : 'WT902',
            resort   : 'B8051',
            abroad   : 'B3008',
            ring     : 'WT903',
            dress    : 'WT904',
            goods    : 'WT905',
            nijikai  : '',
            house    : 'NT911',
            interior : 'NT912',
            money    : 'NT913'
        },
        /* ゼクシィnet */
        '00' : {
            party    : xynavi_zexy_cd,
            resort   : xynavi_zexy_cd,
            abroad   : xynavi_zexy_cd,
            ring     : xynavi_zexy_cd,
            dress    : xynavi_zexy_cd,
            goods    : xynavi_zexy_cd,
            nijikai  : '',
            house    : xynavi_zexy_cd,
            interior : xynavi_zexy_cd,
            money    : xynavi_zexy_cd
        }
    };
    
    /* 版コード取得 */
    han_cd = xynavi_getHanCD();
    
    /* パラメータチェック */
    /* フッタロゴ nullなら グローバル変数 xynavi_RecruitGIF を設定*/
    if (logo_url) {
        logo_img = xynavi_ImgServerName + logo_url;
    } else {
        logo_img = xynavi_ImgServerName + xynavi_RecruitGIF;
    }
    /* ページID(ビジョナリストログ用) nullなら 空文字列 */
    if (p_pid == null) {
        pid = "";
    } else {
        pid = p_pid;
    }
    /* isizeリンク表示フラグ nullなら、true(表示) */
    if (p_disp_isize_logo == null) {
        disp_isize_logo = true;
    } else {
        disp_isize_logo = p_disp_isize_logo;
    }
    /* 左余白幅 数値でなければ、0 */
    if (isNaN(p_left_margin) || p_left_margin == null) {
        left_margin = 0;
    } else {
        left_margin = p_left_margin;
    }
    /* フッタ幅(余白無し) 数値でなければ、910*/
    if (isNaN(p_footer_width) || p_footer_width == null) {
        footer_width_without_margin = 910;
    } else {
        footer_width_without_margin = p_footer_width;
    }
    /* フッタ幅 */
    footer_width = footer_width_without_margin + (left_margin*2);

    /* HTML出力 */
    var tmplStr; /* テンプレートHTML 可変の部分を"[変数名]"で記述、replaceメソッドで置き換え*/
    tmplStr  =
            '<div id="ngfooter">' +
            '<table border="0" cellpadding="0" cellspacing="0">' +
            '<tr>' +
            '<td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="15"></td>' +
            '</tr>' +
            '</table>' +
            '<table width="[footer_width]" border="0" cellpadding="0" cellspacing="0">' +
            '<tr>' +
            '<td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="[left_margin]" height="1"></td>' +
            '<td>' +
            '    <table width="[footer_width_without_margin]" border="0" cellpadding="0" cellspacing="0">' +
            '    <tr>' +
            '    <td class="bg_gray3">' +
            '        <table cellspacing="0" cellpadding="0" border="0">' +
            '        <tr>' +
            '        <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="15"></td>';
            
    /* ブラウザ環境によりテンプレートを変更 */
    if ((Win&&IE) || (Win&&NN4)){
        tmplStr += '        <td align="left" class="text_ft2">' +
                   '        <span class="text_lb_pink">&nbsp;結婚式準備：</span>' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[party]" >挙式・披露宴</a>' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[resort]" >（国内リゾート</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[abroad]" >海外挙式）</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[ring]" >婚約指輪・結婚指輪</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[dress]" >ドレス・ブーケ・エステ</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[goods]" >引出物・演出・写真・招待状・ハネムーン</a>&nbsp;';
                   
           /* han_cdが東名阪(04,05,06)の場合、二次会を表示 */
           if ((han_cd == '04') || (han_cd == '05') || (han_cd == '06')) {
               tmplStr += '        |&nbsp;<a href="[xynavi_LocationCGI_footer]&LINK_CD=[nijikai]" >二次会</a>&nbsp;';
           }
           
        tmplStr += '        <br>' +
                   '        <span class="text_lb_blue">&nbsp;新生活準備：</span>' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[interior]" >インテリア・家具</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[money]" >手続き・家計・保険</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[house]" >新居</a>&nbsp;' +
                   '        </td>';
    }else{
        tmplStr += '        <td align="left">' +
                   '        <span class="text_m_pink"><b>&nbsp;結婚式準備：</b></span>' +
                   '        <span class="text_ft2">' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[party]" >挙式・披露宴</a>' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[resort]" >（国内リゾート</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[abroad]" >海外挙式）</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[ring]" >婚約指輪・結婚指輪</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[dress]" >ドレス・ブーケ・エステ</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[goods]" >引出物・演出・写真・招待状・ハネムーン</a>&nbsp;';
                   
           /* han_cdが東名阪(04,05,06)の場合、二次会を表示 */
           if ((han_cd == '04') || (han_cd == '05') || (han_cd == '06')) {
               tmplStr += '        |&nbsp;<a href="[xynavi_LocationCGI_footer]&LINK_CD=[nijikai]" >二次会</a>&nbsp;';
           }
           
        tmplStr += '        </span>' +
                   '        <br>' +
                   '        <span class="text_m_blue"><b>&nbsp;新生活準備：</b></span>' +
                   '        <span class="text_ft2">' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[interior]" >インテリア・家具</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[money]" >手続き・家計・保険</a>&nbsp;|&nbsp;' +
                   '        <a href="[xynavi_LocationCGI_footer]&LINK_CD=[house]" >新居</a>&nbsp;' +
                   '        </span>' +
                   '        </td>';
    }
    
    tmplStr +=
            '        <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="15"></td>' +
            '        </tr>' +
            '        </table>' +
            '    </td>' +
            '    </tr>' +
            '    </table>' +
            '</td>' +
            '</tr>' +
            '</table>' +
            '    <table width="[footer_width]" border="0" cellpadding="0" cellspacing="0" class="bg_w">' +
            '    <tr>' +
            '    <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="[left_margin]" height="1"></td>' +
            '    <td>' +
            '        <table width="[footer_width_without_margin]" border="0" cellpadding="0" cellspacing="0" class="bg_w">' +
            '        <tr>' +
            '        <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="10"></td>' +
            '        </tr>' +
            '        <tr>' +
            '        <td class="bg_pink"><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="[footer_width_without_margin]" height="1"></td>' +
            '        </tr>' +
            '        <tr>' +
            '        <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="10"></td>' +
            '        </tr>' +
            '        </table>' +
            '        <table width="[footer_width_without_margin]" border="0" cellpadding="0" cellspacing="0" class="bg_w">' +
            '        <tr>' +
            '        <td align="left" class="text_ft2">' +
                        /* レイアウトが崩れるため、インデントのためのスペースを入れないこと。 */
                        '<a href="https://[xynavi_domain]/guide/faq/index.html"              target="_blank">サイトに関するお問合せ（FAQ)</a>&nbsp;|&nbsp;' +
                        '<a href="https://[xynavi_domain]/enquiry_shiryou.html"      target="_blank">請求した資料が届かない場合はこちら</a>&nbsp;|&nbsp;' +
                        '<a href="[xynavi_ImgServerName]/enquiry_navi.html"          target="_blank">ゼクシィなびに関するお問合せ</a>&nbsp;|&nbsp;' +
                        '<a href="[xynavi_ImgServerName]/guide/privacy.html"         target="_blank">プライバシーポリシー</a>&nbsp;|&nbsp;' +
                        '<a href="[xynavi_ImgServerName]/guide/agreement.html"       target="_blank">ご利用規約</a>&nbsp;|&nbsp;' +
                        '<a href="[xynavi_ImgServerName]/guide/information.html"     target="_blank">サイトマップ</a></td>' +
            '        </td>' +
            '        </tr>' +
            '        </table>' +
            '        <table width="[footer_width_without_margin]" border="0" cellpadding="0" cellspacing="0" class="bg_w">' +
            '        <tr>' +
            '        <td align="left">' +
            '            <table border="0" cellpadding="0" cellspacing="0" class="bg_w">' +
            '            <tr>' +
            '            <td align="left" class="text_ft2">' +
                             /* レイアウトが崩れるため、インデントのためのスペースを入れないこと。 */
                             '<a href="http://next.rikunabi.com/"        target="_blank">転職</a>/' +
                             '<a href="http://www.r-agent.co.jp/"        target="_blank">転職支援</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.rikunabi.com/"         target="_blank">就職</a>&nbsp;|&nbsp;' +
                             '<a href="http://haken.rikunabi.com/"       target="_blank">派遣</a>/' +
                             '<a href="http://www.r-staffing.co.jp/"     target="_blank">派遣登録</a>&nbsp;|&nbsp;' +
                             '<a href="http://entrenet.jp/"              target="_blank">独立開業</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.froma.com/"            target="_blank">アルバイト</a>&nbsp;|&nbsp;' +
                             '<a href="http://townwork.net/"             target="_blank">仕事</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.shikakutoshigoto.net/" target="_blank">資格</a>/' +
                             '<a href="http://www.keikotomanabu.net/"    target="_blank">おケイコ</a>&nbsp;|&nbsp;' +
                             '<a href="http://shingakunet.com/"          target="_blank">進学</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.jalan.net/"            target="_blank">国内旅行</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.ab-road.net/"          target="_blank">海外旅行</a>&nbsp;|&nbsp;' +
                             '<a href="http://akasugu.net/"              target="_blank">育児</a>/' +
                             '<a href="http://eyeco.jp/"                 target="_blank">通販</a>/' +
                             '<a href="http://aikento.jp/"               target="_blank">ペット</a>' +
                             '<br>' +
                             '<a href="http://suumo.jp/"                 target="_blank">不動産</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.jj-navi.com/"           target="_blank">住宅購入・売却</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.forrent.jp/"           target="_blank">賃貸住宅</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.housingnavi.jp/"       target="_blank">注文住宅</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.goodreform.jp/"        target="_blank">リフォーム</a>/' +
                             '<a href="http://www.homepro.co.jp/"        target="_blank">リフォーム商談</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.carsensor.net/"        target="_blank">中古車</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.hotpepper.jp/"         target="_blank">グルメ</a>/' +
                             '<a href="http://beauty.hotpepper.jp/"      target="_blank">美容</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.cocokarada.jp/"        target="_blank">病院検索</a>&nbsp;|&nbsp;' +
                             '<a href="http://townmarket.jp/"            target="_blank">チラシ</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.isize.com/top/kanren/" target="_blank">関連サイト</a>&nbsp;|&nbsp;' +
                             '<a href="http://www.recruit.jp/group/"     target="_blank">関連会社</a>';

    /* disp_isize_logoがtrueの場合、イサイズロゴを表示 */
    if (disp_isize_logo) {

        tmplStr +=           '&nbsp;|&nbsp;<a href="http://www.isize.com/"          target="_blank">ISIZE</a>';
    }

    tmplStr += '         </td>' +
               '         </tr>' +
               '         </table>' +
               '     </td>' +
               '     </tr>' +
               '     <tr>'  +
               '     <td align="right" class="text_ft2">';

    tmplStr += '     <a href="http://www.recruit.co.jp/" target="_blank"><img border="0" src="[logo_img]" alt="リクルート" width="163" height="25"></a>' +
            '     </td>' +
            '        </tr>' +
            '        </table>' +
            '    </td>' +
            '    <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="[left_margin]" height="1"></td>' +
            '    </tr>' +
            '    </table>' +

    /* ビジョナリストログ出力 */
              '<SCRIPT language="javascript">var trace_p="[pid]";</SCRIPT>' +
              '<SCRIPT src="/vos/vos.js"></SCRIPT>' +
              '</div>';

    /* 置換キーワード・値配列作成 */
    var aryReplaceInfo = [
        {keyword:'\\[xynavi_ImgServerName\\]'     ,value : xynavi_ImgServerName    },
        {keyword:'\\[xynavi_domain\\]'            ,value : xynavi_domain           },
        {keyword:'\\[left_margin\\]'              ,value : left_margin             },
        {keyword:'\\[logo_img\\]'                 ,value : logo_img                },
        {keyword:'\\[footer_width\\]'             ,value : footer_width            },
        {keyword:'\\[footer_width_without_margin\\]' ,value : footer_width_without_margin},
        {keyword:'\\[pid\\]'                      ,value : pid                     },
        {keyword:'\\[xynavi_LocationCGI_footer\\]',value : xynavi_LocationCGI_footer  },
        {keyword:'\\[party\\]'                    ,value : link_cd[han_cd]['party']   },
        {keyword:'\\[resort\\]'                   ,value : link_cd[han_cd]['resort']  },
        {keyword:'\\[abroad\\]'                   ,value : link_cd[han_cd]['abroad']  },
        {keyword:'\\[ring\\]'                     ,value : link_cd[han_cd]['ring']    },
        {keyword:'\\[dress\\]'                    ,value : link_cd[han_cd]['dress']   },
        {keyword:'\\[goods\\]'                    ,value : link_cd[han_cd]['goods']   },
        {keyword:'\\[nijikai\\]'                  ,value : link_cd[han_cd]['nijikai'] },
        {keyword:'\\[house\\]'                    ,value : link_cd[han_cd]['house']   },
        {keyword:'\\[interior\\]'                 ,value : link_cd[han_cd]['interior']},
        {keyword:'\\[money\\]'                    ,value : link_cd[han_cd]['money']   }
    ];

    /* キーワード→値  置換処理 */
    tmplStr = xynavi_replaceKeywords(tmplStr, aryReplaceInfo);
    
    document.write(tmplStr);
}

/******************************************************************************************
[関数名]    xynavi_PrintGrandFooter_s_ng
[処理概要]  ゼクシィ グランドフッタ 出力


[引数]
 No. 引数             必須  説明
  1. logo_url          ×   ロゴURL
  2. p_pid             ×   ページID
  3. p_left_margin     ×   左余白幅

[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_PrintGrandFooter_s_ng (logo_url, p_pid, p_left_margin) {

    /* 変数 */
    var logo_img;        /* フッタロゴ  */
    var pid;             /* ページID */
    var left_margin;     /* 左余白幅 */
    
    /* パラメータチェック */
    /* フッタロゴ nullなら グローバル変数 xynavi_RecruitGIF を設定*/
    var logo_width;      /* フッタロゴ出力時の幅サイズ */
    var logo_height;     /* フッタロゴ出力時の縦サイズ */

    if (logo_url == null || logo_url == '') {
        logo_img = xynavi_ImgServerName + xynavi_RecruitGIF;
        logo_width  = 163;
        logo_height = 25;
    } else {
        logo_img = xynavi_ImgServerName + logo_url;
        logo_width  = 162;
        logo_height = 15;
    }
    /* ページID(ビジョナリストログ用) nullなら 空文字列 */
    if (p_pid == null) {
        pid = "";
    } else {
        pid = p_pid;
    }
    /* 左余白幅 数値でなければ、0 */
    if (isNaN(p_left_margin) || p_left_margin == null) {
        left_margin = 0;
    } else {
        left_margin = p_left_margin;
    }
    /* フッタ幅設定(ヘッダ小版と一緒に使用された場合、幅を合わせる。) */
    var footer_width;
    if (xynavi_mid_col_width == "100%") {
        footer_width = xynavi_mid_col_width;
    } else {
        footer_width = xynavi_mid_col_width - (left_margin * 2);
    }
    
    /* HTML出力 */
    var tmplStr; /* テンプレートHTML 可変の部分を[変数名]で記述、replaceメソッドで置き換え*/
    tmplStr = '<div id="ngfooter">' + 
             '  <table width="[footer_width]" border="0" cellpadding="0" cellspacing="0">' + 
             '  <tr>' + 
             '  <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="[left_margin]" height="1"></td>' + 
             '  <td width="[xynavi_mid_col_width]" nowrap>' + 
             '      <table width="[xynavi_mid_col_width]" border="0" cellpadding="0" cellspacing="0" class="bg_w">' + 
             '        <tr>' + 
             '          <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="10"></td>' + 
             '        </tr>' + 
             '        <tr>' + 
             '          <td class="bg_pink"><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="100%" height="1"></td>' + 
             '        </tr>' + 
             '        <tr>' + 
             '          <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="1" height="20"></td>' + 
             '        </tr>' + 
             '      </table>' + 
             '      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bg_w">' + 
             '        <tr>' + 
             '          <td align="center"><a href="http://www.recruit.co.jp/" target="_blank"><img src="[logo_img]" border="0" alt="リクルート" width="[logo_width]" height="[logo_height]"></a></td>' + 
             '        </tr>' + 
             '      </table>' + 
             '  </td>' + 
             '  <td><img src="[xynavi_ImgServerName]/commonxy/img/spacer.gif" width="[left_margin]" height="1"></td>' + 
             '  </tr>' + 
             '  </table>' + 

    /* ビジョナリストログ出力 */
             '<SCRIPT language="javascript">var trace_p="[pid]";</SCRIPT>' + 
             '<SCRIPT src="/vos/vos.js"></SCRIPT>' + 
    
             '</div>';

    /* 置換キーワード・値配列作成 */
    var aryReplaceInfo = [
        {keyword:'\\[left_margin\\]'         ,value : left_margin          },
        {keyword:'\\[xynavi_ImgServerName\\]',value : xynavi_ImgServerName },
        {keyword:'\\[logo_img\\]'            ,value : logo_img             },
        {keyword:'\\[pid\\]'                 ,value : pid                  },
        {keyword:'\\[xynavi_mid_col_width\\]',value : xynavi_mid_col_width },
        {keyword:'\\[footer_width\\]'        ,value : footer_width         },
        {keyword:'\\[logo_width\\]'          ,value : logo_width           },
        {keyword:'\\[logo_height\\]'         ,value : logo_height          }
    ];
    
    /* キーワード→値  置換処理 */
    tmplStr = xynavi_replaceKeywords(tmplStr, aryReplaceInfo);
    
    document.write(tmplStr);
}
/******************************************************************************************
[関数名]    xynavi_PrintGrandFooter_s
[処理概要]  旧世代用フッタ小版出力関数


[引数]
 No. 引数             必須  説明
  1  logo_url          ○   ロゴURL
  2  p_id              ○   ビジョナリストログID
   
[戻値]
 No. 戻値             説明
     なし

[補足]
     旧世代用フッタ小版を使用するページとの互換性維持のため、前バージョンより移植
     次世代では、原則 xynavi_PrintGrandFooter_s_ngの方を使用すること。
******************************************************************************************/
function xynavi_PrintGrandFooter_s (logo_url,p_id) {

    /* フッタロゴ */
    var logo_img;
    if (logo_url) {
        logo_img = logo_url;
    }
    else {
        logo_img = xynavi_RecruitGIF;
    }

    document.write('<a href = "http://www.recruit.co.jp/" target="_blank">');
    xynavi_printImage(logo_img, 163, 25, "RECRUIT");
    document.write('</a>');

    /* ビジョナリストログ出力 */
    if (p_id) {
        document.writeln('<SCRIPT language="javascript">var trace_p="' + p_id + '";</SCRIPT>');
    }
    else {
        document.writeln('<SCRIPT language="javascript">var trace_p="";</SCRIPT>');
    }
    document.writeln('<SCRIPT src="/vos/vos.js"></SCRIPT>');
}
/* 以下private関数 --------------------------------------------------------------------*/

/******************************************************************************************
[関数名]    xynavi_preload
[処理概要]  画像先読み(汎用)


[引数]
 No. 引数             必須  説明
  1. preloadFiles      ○   先読み画像ファイル名配列

[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_preload (preloadFiles) {
    
    /* ダミーのdocumentオブジェクト */
    if (typeof document._xynavi_dum == 'undefined'){
      document._xynavi_dum = new Object();
    }
    
    /* ダミーオブジェクトに、画像読込プロパティを設定 */
    document._xynavi_dum.loadedImages = new Array(preloadFiles.length);
    
    for (cnt=0; cnt<preloadFiles.length; cnt++) {
        document._xynavi_dum.loadedImages[cnt] = new Image();
        document._xynavi_dum.loadedImages[cnt].src = preloadFiles[cnt];
    }
    
}
/******************************************************************************************
[関数名]    xynavi_preloadForHeader
[処理概要]  画像先読み(ヘッダ用)


[引数]
 No. 引数             必須  説明
  1. han_cd            ○   版コード

[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_preloadForHeader(han_cd){
    
    /* 変数 */
    var normal_suffix  = "";  /* 通常版画像ファイル接尾子 */
    var kyouiki_suffix = "02";/* 狭域版画像ファイル接尾子 */
    var han_suffix     = "";  /* 画像ファイル接尾子 */
    var index          = 0;
    
    /* 先読み画像配列 */
    var prImg = new Array(20);

    var img_url = xynavi_ImgServerName + xynavi_ImageDir + "/";
    
        
    /* エリアTOP */
    if (han_cd == xynavi_hanCDs["hokaido"]) {
        prImg[index++] = img_url + "hd_bt_hokaido_ov.gif";
        prImg[index++] = img_url + "hd_bt_hokaido.gif";
        han_suffix = kyouiki_suffix;
    } else if (han_cd == xynavi_hanCDs["tohoku"]) {
        prImg[index++] = img_url + "hd_bt_tohoku_ov.gif";
        prImg[index++] = img_url + "hd_bt_tohoku.gif";
        han_suffix = kyouiki_suffix;
    } else if (han_cd == xynavi_hanCDs["hokuriku"]) {
        prImg[index++] = img_url + "hd_bt_hokuriku_ov.gif";
        prImg[index++] = img_url + "hd_bt_hokuriku.gif";
        han_suffix = kyouiki_suffix;
    } else if (han_cd == xynavi_hanCDs["kanto"]) {
        prImg[index++] = img_url + "hd_bt_kan_ov.gif";
        prImg[index++] = img_url + "hd_bt_kan.gif";
        han_suffix = normal_suffix;
    } else if (han_cd == xynavi_hanCDs["tokai"]) {
        prImg[index++] = img_url + "hd_bt_tokai_ov.gif";
        prImg[index++] = img_url + "hd_bt_tokai.gif";
        han_suffix = normal_suffix;
    } else if (han_cd == xynavi_hanCDs["kansai"]) {
        prImg[index++] = img_url + "hd_bt_kansai_ov.gif"; 
        prImg[index++] = img_url + "hd_bt_kansai.gif"; 
        han_suffix = normal_suffix;
    } else if (han_cd == xynavi_hanCDs["chugoku"]) {
        prImg[index++] = img_url + "hd_bt_chugoku_ov.gif";
        prImg[index++] = img_url + "hd_bt_chugoku.gif";
        han_suffix = kyouiki_suffix;
    } else if (han_cd == xynavi_hanCDs["kyushu"]) {
        prImg[index++] = img_url + "hd_bt_kyushu_ov.gif";
        prImg[index++] = img_url + "hd_bt_kyushu.gif";
        han_suffix = kyouiki_suffix;
    } else if (han_cd == xynavi_hanCDs["sikoku"]) {
        prImg[index++] = img_url + "hd_bt_sikoku_ov.gif";
        prImg[index++] = img_url + "hd_bt_sikoku.gif";
        han_suffix = kyouiki_suffix;
    }

    /* 全国TOPへ 画像 */
    prImg[index++] = img_url + "hd_bt_zen_ov.gif";
    prImg[index++] = img_url + "hd_bt_zen.gif";

    /* サブTOP */
     prImg[index++] = img_url + "hd_bt_cer" + han_suffix + "_ov.gif";/* 挙式 */
    prImg[index++] = img_url + "hd_bt_cer" + han_suffix + ".gif";
    prImg[index++] = img_url + "hd_bt_rin" + han_suffix + "_ov.gif";/* リング */
    prImg[index++] = img_url + "hd_bt_rin" + han_suffix + ".gif";
    prImg[index++] = img_url + "hd_bt_dre" + han_suffix + "_ov.gif";/* ドレス */
    prImg[index++] = img_url + "hd_bt_dre" + han_suffix + ".gif";
    prImg[index++] = img_url + "hd_bt_gif" + han_suffix + "_ov.gif";/* ギフト */
    prImg[index++] = img_url + "hd_bt_gif" + han_suffix + ".gif";
    if (han_suffix == normal_suffix) { /* 通常版の時のみ、二次会タブの先読みをする */
        prImg[index++] = img_url + "hd_bt_par" + han_suffix + "_ov.gif";/* 二次会 */
        prImg[index++] = img_url + "hd_bt_par" + han_suffix + ".gif";
    }
    prImg[index++] = img_url + "hd_bt_hou" + han_suffix + "_ov.gif";/* 新居 */
    prImg[index++] = img_url + "hd_bt_hou" + han_suffix + ".gif";
    prImg[index++] = img_url + "hd_bt_fur" + han_suffix + "_ov.gif";/* 家具 */
    prImg[index++] = img_url + "hd_bt_fur" + han_suffix + ".gif";
    prImg[index++] = img_url + "hd_bt_eco" + han_suffix + "_ov.gif";/* 手続き */
    prImg[index++] = img_url + "hd_bt_eco" + han_suffix + ".gif";

    xynavi_preload(prImg);
}
/******************************************************************************************
[関数名]    xynavi_getParam
[処理概要]  GETパラメータ取得


[引数]
 No. 引数             必須  説明
  1. key               ○   取得パラメータ名

[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_getParam (key) {
    var tmp1; var tmp2; var xx1; var xx2; var xx3;

    tmp1 = document.URL.substring(document.URL.indexOf('?') +1) + '&';

    xx1 = xx2 = 0;
    var len = tmp1.length;

    while (xx1 < len) {
        xx2 = tmp1.indexOf("&", xx1);
        tmp2 = tmp1.substring(xx1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}

/******************************************************************************************
[関数名]    xynavi_getCookie
[処理概要]  Cookie取得


[引数]
 No. 引数             必須  説明
  1. key               ○   取得cookie名

[戻値]
 No. 戻値                      説明
     引数で渡されたcookieの値  なし

[補足]
     なし
******************************************************************************************/
function xynavi_getCookie (key) {
    var tmp1; var tmp2; var xx1; var xx2; var xx3;
    tmp1 = " " + document.cookie + ";";
    xx1 = xx2 = 0;
    var len = tmp1.length;

    while (xx1 < len) {
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}

/******************************************************************************************
[関数名]    xynavi_setCookie
[処理概要]  Cookieセット


[引数]
 No. 引数             必須  説明
  1. key               ○   設定cookie名
  2. val               ○   設定値
   
[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_setCookie (key, val) {
    var tmp = key + "=" + escape(val) + "; ";
    tmp += "path=/; ";
    tmp += "expires=Thursday, 31-Dec-2037 00:00:00;";
    document.cookie = tmp;
}

/******************************************************************************************
[関数名]    xynavi_setCookieForSubdomain
[処理概要]  サブドメイン指定Cookieセット


[引数]
 No. 引数             必須  説明
  1. key               ○   設定cookie名
  2. val               ○   設定値
  3. domain            ○   cookie適用ドメイン
   
[戻値]
 No. 戻値            説明
     なし

[補足]
     SNSで使用するドメインで読み込み可能なcookie設定のため新規作成
******************************************************************************************/
function xynavi_setCookieForSubdomain (key,val, domain) {
    var tmp = key + "=" + escape(val) + "; ";
    tmp += "domain=" + domain + "; ";
    tmp += "path=/; ";
    tmp += "expires=Thursday, 31-Dec-2037 00:00:00;";
    document.cookie = tmp;
}

/******************************************************************************************
[関数名]    xynavi_setLocationCGI
[処理概要]  location.cgi・画像リンク付加ドメイン生成


[引数]
 No. 引数             必須  説明
     なし
   
[戻値]
 No. 戻値            説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_setLocationCGI () {
    var dm = document.domain;
    if (dm.match(/^(www\.)?zexy\.net$/)) {
        /* 本番環境 */
        xynavi_ImgServerName   = "";
        xynavi_LocationCGI  = xynavi_ZexyServer + xynavi_LocationCGI;
        xynavi_ExecEnv =1;
    }
    else if (!dm.match(/\bzexy\.net\b/)) {
        /* 他サイト */
        xynavi_ImgServerName   = xynavi_ZexyServer;
        xynavi_LocationCGI     = xynavi_ZexyServer + xynavi_LocationCGI;
        xynavi_ExecEnv = 2;
    } else {
        /* 上記以外 テスト環境 */
        xynavi_ImgServerName = "";
        xynavi_LocationCGI   = xynavi_LocationCGI;
        xynavi_ExecEnv = 3;
    }
    
}

/******************************************************************************************
[関数名]    xynavi_getHanCD
[処理概要]  版コード判定


[引数]
 No. 引数             必須  説明
  1  js_han_cd         ○   版コード
   
[戻値]
 No. 戻値            説明
     版コード        cookie or getパラメータ or 引数.版コードの何れか

[補足]
     なし
******************************************************************************************/
function xynavi_getHanCD(js_han_cd){
    
    /* 定数宣言 */
    var ls_domain = ".zexy.net";

    /* -- 版CDの判定処理 --------------------------------------------------- */
    var han_cd;     /* 版CD */
    var cgi_han_cd; /* GETパラメータ.版CD */
    var ck_han_cd;  /* Cookie.版CD */

    /* GETパラメータ.版CD取得 */
    cgi_han_cd = xynavi_getParam("DHAN_CD");

    /* Cookie.版CD取得 */
    ck_han_cd = xynavi_getCookie("DHAN_CD");
    if (cgi_han_cd) {
        js_han_cd = cgi_han_cd;
    }

    /* Cookie.版CDが取得できた場合 */
    if (ck_han_cd) {
        /* 引数.エリアCDが指定されている場合 */
        if (js_han_cd) {
            /* 版CDは引数.エリアCDとする */
            han_cd = js_han_cd;
            /* Cookie.版CDと引数.エリアCDが異なる場合 */
            if (ck_han_cd != js_han_cd) {
                /* Cookie.版CDに引数.エリアCDをセット */
                xynavi_setCookie("DHAN_CD", js_han_cd);
                /* domain「.zexy.net」のCookie.版CDに引数.エリアCDをセット */
                xynavi_setCookieForSubdomain("DHAN_CD", js_han_cd, ls_domain);
            }
        }
        else {
            /* 版CDはCookie.版CDとする */
            han_cd = ck_han_cd;
        }
    }
    /* Cookie.版CDがない場合 */
    else {
        /* 引数.エリアCDが指定されている場合 */
        if (js_han_cd) {
            /* Cookie.版CDに引数.エリアCDをセット */
            xynavi_setCookie("DHAN_CD", js_han_cd);

            /* domain「.zexy.net」のCookie.版CDに引数.エリアCDをセット */
            xynavi_setCookieForSubdomain("DHAN_CD", js_han_cd, ls_domain);

            /* 版CDは引数.エリアCDとする */
            han_cd = js_han_cd;
        }
        /* 版CDが取得できない場合 */
        else {
            /* 版CDは'00'とする */
            han_cd = '00';
        }
    }

    /* 版CDの情報がない場合、版CDは'00'とする */
    var result = false;
    for ( var i in xynavi_hanCDs ) { 
        if (xynavi_hanCDs[i] == han_cd) {
             result = true;
            break;
        }        
    }
    if (!result) {
        han_cd == '00';
    }

    return han_cd;
}

/******************************************************************************************
[関数名]    xynavi_replaceKeywords
[処理概要]  キーワード置換関数


[引数]
 No. 引数             必須  説明
  1  tmplHTML          ○   置換元文字列
  2  aryReplaceInfo    ○   置換情報([キーワード,置き換える文字列]の配列)
   
[戻値]
 No. 戻値             説明
     置き換え後文字列 

[補足]
     なし
******************************************************************************************/
function xynavi_replaceKeywords(tmplHTML, aryReplaceInfo){
    for (var i=0; i<aryReplaceInfo.length; i++  ) {
        tmplHTML = tmplHTML.replace(new RegExp(aryReplaceInfo[i]['keyword'],'g'), aryReplaceInfo[i]['value']);
    }
    return tmplHTML;
}
/******************************************************************************************
[関数名]    xynavi_getCallHeaderCGITag
[処理概要]  グランドヘッダ表示CGI呼出scriptタグ取得


[引数]
 No. 引数             必須  説明
  1  js_han_cd         ○   版コード
  2  class_cd          ○   階層指定
  3  subtop_cd         ○   サブTOPコード
  4  left_margin       ○   左余白幅
  5  disp_breadcrumbs  ○   パンクズ表示フラグ
   
[戻値]
 No. 戻値             説明
     置き換え後文字列 

[補足]
     なし
******************************************************************************************/
function xynavi_getCallHeaderCGITag(js_han_cd,class_cd,subtop_cd,left_margin,disp_breadcrumbs) {
    if (subtop_cd == null) {
        subtop_cd = "";
    }
    
    /* サニタイジング処理 */
    js_han_cd        = xynavi_chg_sanit(js_han_cd);
    class_cd         = xynavi_chg_sanit(class_cd);
    subtop_cd        = xynavi_chg_sanit(subtop_cd);
    left_margin      = xynavi_chg_sanit(left_margin);
    disp_breadcrumbs = xynavi_chg_sanit(disp_breadcrumbs);

    /* グランドヘッダ表示CGI呼出scriptタグ */
    var tmplStr = '<script type="text/javascript" src="' + xynavi_ImgServerName + /* 外部環境時は、ドメイン名から */
                      '/cgi-bin/grandnavi/wd_grandnavi_header.cgi?' + 
                    'han_cd='           + js_han_cd        + '&' + 
                    'class_cd='         + class_cd         + '&' + 
                    'subtop='           + subtop_cd        + '&' + 
                    'left_margin='      + left_margin      + '&' + 
                    'exec_env_flg='     + xynavi_ExecEnv   + '&' + 
                    'disp_breadcrumbs=' + disp_breadcrumbs + '">'+ 
                  '</script>';
    return tmplStr;
    alert(tmplStr);
}
/******************************************************************************************
[関数名]    xynavi_chg_sanit
[処理概要]  禁則文字サニタイズ（「&"<>'()」を変換）


[引数]
 No. 引数             必須  説明
  1  str             ○   変換対象文字列
   
[戻値]
 No. 戻値             説明
     変換後文字列

[補足]
     なし
******************************************************************************************/
function xynavi_chg_sanit(str){
    if (str != null && typeof(str) == "string") {
        str = str.replace(/&(!?amp;)/g,"&amp;");
        str = str.replace(/\"/g, "&quot;");
        str = str.replace(/</g,  "&lt;");
        str = str.replace(/>/g,  "&gt;");
        str = str.replace(/'/g,  "&#39");
    }

    return str;
}
/******************************************************************************************
[関数名]    xynavi_img
[処理概要]  mouseover_out時画像入れ替え関数


[引数]
 No. 引数             必須  説明
  1  iName             ○   imgタグのname属性の値
  2  str               ○   入れ替える画像ファイル名
   
[戻値]
 No. 戻値             説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_img(iName,str){
    document.images[iName].src = str;
}
/******************************************************************************************
[関数名]    xynavi_printImage
[処理概要]  IMGタグ出力関数


[引数]
 No. 引数             必須  説明
  1  gif               ○   画像ファイル名
  2  width             ×   imgタグのwidth属性の値
  3  height            ×   imgタグのheight属性の値
  4  opt               ×   imgタグのopt属性の値
   
[戻値]
 No. 戻値             説明
     なし

[補足]
     なし
******************************************************************************************/
function xynavi_printImage (gif, width, height, alt, opt) {
    var image_src = '';
    if (gif.charAt(0) == '/' || gif.substring(0, 7) == 'http://') {
        image_src = gif;
    }
    else {
        image_src = xynavi_ImageDir + '/' + gif;
    }
    document.write('<img');
    document.write(' src="'    + image_src + '"');
    document.write(' width="'  + width  + '"');
    document.write(' height="' + height + '"');
    document.write(' border="0"');
    if (alt) { document.write(' alt="' + alt + '"'); }
    if (opt) {
        for (var i in opt) {
            document.write(' ' + i + '="' + opt[i] + '"');
        }
    }
    document.write('>');
}


