
//----- *************************************
//----- 
//----- フォント変更
//----- 
//----- *************************************

//*****************************
// 表示状態を変更します。
// @param title
//*****************************
function setFontStyleSheet(title) {
  var i, a, main;
  // 要素の終了まで検索
  for( i = 0 ; (a = document.getElementsByTagName("link")[i]) != null; i++) {
    // linkタグのrel属性にstyleが指定されており、titel属性が存在する場合
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      // 要素を表示状態に変更
      a.disabled = true;
      if(a.getAttribute("title") == title){
      	 a.disabled = false;
      }
    }
  }
}

//*****************************
// Dynamic font control.
//*****************************
function fontSizeCtrl(fSizeStr){

    if(document.getElementById('dynamic') !== null){
        var ifr = document.getElementById('dynamic');
        var ifrDoc = (ifr.contentDocument)? ifr.contentDocument.body : ifr.contentWindow.document.body;
        var fSize = '';

       if (fSizeStr === "Middle") {
          fSize = '12px';
       } else if (fSizeStr === "Large") {
          fSize = '14px';
       } else if (fSizeStr === "Default") {
          fSize = '10px';
       } else {
          fSize = '10px';
       }

       ifrDoc.style.fontSize = fSize;
    }

    setFontStyleSheet(fSizeStr);
    createCookie("style",fSizeStr);//add 20090819
    createCookie("dynamicFont",'size=' + fSizeStr);
}

function iFrameHeight(){

    if(document.getElementById('dynamic') === null){return false;}
    
    var h = 0; 
    var Opera = window.opera ? true : false; 
    if(Opera) { 
         h = document.getElementById('dynamic').contentDocument.getElementById('inHeight').offsetHeight + 60;
         document.getElementById('dynamic').setAttribute("height",h);
    } else if ( !document.all ) { 
	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	if(is_chrome) {
        	h = document.getElementById('dynamic').contentDocument.documentElement.scrollHeight;
        	document.getElementById('dynamic').style.height = h + 60 + 'px';
	} else {
        	h = document.getElementById('dynamic').contentDocument.height;
        	document.getElementById('dynamic').style.height = h + 60 + 'px';
	}

    } else if( document.all ) { 
         h = document.frames('dynamic').document.body.scrollHeight;
         document.all.dynamic.style.height = h + 20 + 'px';
    }
} 

//*****************************
// スタイルシートを取得します。
//*****************************
function getActiveStyleSheet() {
  var i, a;
    // linkタグのrel属性にstyleが指定されており、titel属性が存在する場合
  for( i = 0; (a = document.getElementsByTagName("link")[i]) != null; i++) {
    // linkタグのrel属性にstyleが指定されており、titel属性が存在する場合、かつ無効ではない場合
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled)
     //  スタイルシートを返却します。
     return a.getAttribute("title");
  }
  return null;
}

//*****************************
// スタイルシートを取得します。
//*****************************
function getPreferredStyleSheet() {
  var i, a;
  // linkタグのrel属性にstyleが指定されており、titel属性が存在する場合
  for( i = 0; (a = document.getElementsByTagName("link")[i]) != null; i++) {
    // linkタグのrel属性にstyleが指定されており、titel属性が存在する場合、かつ、代替スタイルシートの場合
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       )
    {
         //  スタイルシートを返却します。
       return a.getAttribute("title");
    }
  }
  return null;
}

//*****************************
// クッキーを作成します。
//*****************************
function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    // 日付の設定
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+"; path=/";
}

//*****************************
// クッキーの読み込みを行います。
//*****************************
function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

//*****************************
// ページの初期化を行います。
//*****************************
window.onload = function(e) {
  var cookie = readCookie("style");
  if(( cookie == "" ) || ( cookie == null )) {//add 20090819
    cookie = "Default";
    createCookie("style","Default");
  }
  var title = cookie ? cookie : getPreferredStyleSheet();
  setFontStyleSheet(title);
}

//*****************************
// ページ終了時の処理を行います。
//*****************************
window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
if(( cookie == "" ) || ( cookie == null )) {//add 20090819
  cookie = "Default";
  createCookie("style","Default");
}
var title = cookie ? cookie : getPreferredStyleSheet();
setFontStyleSheet(title);


////////////////////////////////////////////////////
//library.jsより
//*銘柄検索*一発一覧型シュミレーター*理論派シュミレーターのボタン切替えで使用
////////////////////////////////////////////////////

function searchOpt(prm1){

	for( i=1; i<=4 ; i++){

		if(document.all){
			obj = document.all('searchMenu0' + i);
			obj1 = document.all('e_select');
		}else if(document.getElementById){
			obj = document.getElementById('searchMenu0' + i);
			obj1 = document.getElementById('e_select');
		}

		if(i == prm1 ){
			obj.className ='menuon';
		}else{
			obj.className ='menu';
		}

	}

	if( prm1 == 1 ){
		obj1.value = "ew";
	}else if( prm1 == 2 ){
		obj1.value = "list";
	}else if( prm1 == 3 ){
		obj1.value = "riron";
	}else if( prm1 == 4 ){
		obj1.value = "nearpin";
	}

}

function openBrWindow(theURL,winName,features) {
  win=window.open(theURL,winName,features);
        win.focus();
}


//----- *************************************
//----- 
//----- メニュー
//----- 
//----- *************************************


// Homeのアドレス
var domainname = location.hostname;
var homeurl = '';

if(domainname === "www.gs.com"){
    homeurl = '/japan/ewarrant/';
} else if (domainname === "www.goldmansachs.com"){
    homeurl = '/japan/ewarrant/';
} else if (domainname === "www.ewarrant.co.jp"){
    homeurl = '/';
} else if (domainname === "www.ewarrant.com"){
    homeurl = '/';
} else if (domainname === "wwwqa.gs.com"){
    homeurl = '/japan/ewarrant/';
} else if (domainname === "qa-ewarrant.gs.com"){
    homeurl = '/';
} else if (domainname === "ewarrant.gs.com"){
    homeurl = '/';
} else if (domainname === "wwwqa.ewarrant.co.jp"){
    homeurl = '/';
} else if (domainname === "wwwqa.ewarrant.com"){
    homeurl = '/';
} else {
    homeurl = '/japan/ewarrant/';
}


// 配列No
var myMENUNO  = 0;
var myMENU    = 1;
var myURL     = 2;
var myWINDOW  = 3;
var myWINDOWWIDTH  = 4;
var myWINDOWHEIGHT  = 5;

// ウィンドウ　ON/OFF
var myON      = 0;
var myOFF     = 1;

// ON/OFFフラグ
var myMENU1   = 1;
var myMENU2   = 2;

// 初期設定
var myDEFAULT   = 0;

var hdr
 = [
[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], // メインメニュー以下に内包されるサブメニュー定義
[10,11,12,13,14,15,16,17,18,19],
[20,21,22,23,24,25,26,27,28,29],
[30,31,32,33,34,35,36,37,38,39],
[40,41,42,43,44,45,46,47,48,49],
[50,51,52,53,54,55,56,57,58,59],
[60,61,62,63,64,65,66,67,68,69],
[70,71,72,73,74,75,76,77,78,79]
];

var uppermenu
 = [
['ホーム',1],
['eワラント',1],
['ニアピンeワラント',1],
['トラッカーeワラント',1],
['ランキング',1],
['取引・相場動向',1],
['投資講座',1],
['重要な説明事項',1],
['',1],
['',1]
];

//親メニュー番号、サブメニュー番号、飛び先リンク 1=target="_blank"、別ウィンドウwidth、別ウィンドウheight
var item
 = [
// 親メニュー：ホーム
[0,'トップページ',homeurl + 'index.html',0,0,0],
[0,'',homeurl + 'guide/intro.html',0,0,0],
[0,'全銘柄一覧（PDF）',homeurl + 'guide/pdf/namelist.pdf',1,0,0],
[0,'入門銘柄セレクション',homeurl + 'guide/select.html',0,0,0],
[0,'お知らせ',homeurl + 'guide/whatsnew.html',0,0,0],
[0,'キャンペーン/セミナー',homeurl + 'guide/event.html',0,0,0],
[0,'取扱金融商品取引業者',homeurl + 'guide/brokers.html',0,0,0],
[0,'ゴールドマン・サックスについて','http://www2.goldmansachs.com/japan/our-firm/about-us/index.html',1,0,0],
[0,'','',0,0,0],
[0,'','',0,0,0],

// 親メニュー：eワラント
[1,'eワラントとは？',homeurl + 'ew/index.html',0,0,0],
[1,'',homeurl + 'ew/jp/index.html',0,0,0],
[1,'外国株式・株価指数',homeurl + 'ew/njp/index.html',0,0,0],
[1,'バスケット',homeurl + 'ew/bskt/index.html',0,0,0],
[1,'コモディティ',homeurl + 'ew/cmd/index.html',0,0,0],
[1,'為替',homeurl + 'ew/fx/index.html',0,0,0],
[1,'銘柄検索',homeurl + 'gscgi/ew/src/index.gscgi',0,0,0],
[1,'eワラントシミュレーター',homeurl + 'invest/simulat.html',1,0,0],
[1,'eワラントナビ(KBMJ)','http://www.121r.com/gs/gs.jsp?type=1',1,0,0],
[1,'','',0],

// 親メニュー：ニアピンeワラント
[2,'ニアピンeワラントとは？',homeurl + 'np/index.html',0,0,0],
[2,'',homeurl + 'np/jp/index.html',0,0,0],
[2,'',homeurl + 'np/fx/index.html',0,0,0],
[2,'銘柄検索',homeurl + 'np/src/index.html',0,0,0],
[2,'ニアピンシミュレーター',homeurl + 'nearpin/claim_riron.html',1,0,0],
[2,'','',0,0,0],
[2,'','',0,0,0],
[2,'','',0,0,0],
[2,'','',0,0,0],
[2,'','',0,0,0],

// 親メニュー：トラッカーeワラント
[3,'トラッカーeワラントとは？',homeurl + 'tr/index.html',0,0,0],
[3,'国内株式・株価指数',homeurl + 'tr/jp/index.html',0,0,0],
[3,'外国株式・株価指数',homeurl + 'tr/njp/index.html',0,0,0],
[3,'コモディティ',homeurl + 'tr/cmd/index.html',0,0,0],
[3,'銘柄検索',homeurl + 'tr/src/index.html',0,0,0],
[3,'','',0,0,0],
[3,'','',0,0,0],
[3,'','',0,0,0],
[3,'','',0,0,0],
[3,'','',0,0,0],

// 親メニュー：ランキング
[4,'取引金額(30分)',homeurl + 'ranking/rank-vlm-30.html',0,0,0],
[4,'取引金額(前日,1週間,1ヶ月)',homeurl + 'ranking/rank-vlm-his.html',0,0,0],
[4,'騰落率(前日比)',homeurl + 'ranking/rank-all.html',0,0,0],
[4,'カテゴリー別騰落率(前日比)',homeurl + 'ranking/rank-cat.html',0,0,0],
[4,'参照原資産価格騰落率(前日比)',homeurl + 'ranking/rank-und.html',0,0,0],
[4,'騰落率(前日,1週間)',homeurl + 'ranking/rank-his.html',0,0,0],
[4,'','',0,0,0],
[4,'','',0,0,0],
[4,'','',0,0,0],
[4,'','',0,0,0],

// 親メニュー：取引・相場動向
[5,'プット・コールレシオ',homeurl + 'info/pcratio.html',0,0,0],
[5,'Daily Watch',homeurl + 'info/new/22.html',1,780,600],
[5,'チャート（ドリームバイザー）','http://www2.drvs.ne.jp/gs/',1,0,0],
[5,'投資情報（FISCO）','http://stockinfo.fisco.co.jp/ewarrant/index.jsp',1,0,0],
[5,'','',0,0,0],
[5,'','',0,0,0],
[5,'','',0,0,0],
[5,'','',0,0,0],
[5,'','',0,0,0],
[5,'','',0,0,0],

// 親メニュー：投資講座
[6,'オンデマンドセミナー',homeurl + 'learn/od/index.html',0,0,0],
[6,'',homeurl + 'learn/animation/index.html',0,0,0],
[6,'取引方法・時間',homeurl + 'learn/rule.html',0,0,0],
[6,'基礎投資講座',homeurl + 'learn/basic/index.html',0,0,0],
[6,'オプション理論入門',homeurl + 'learn/option/index.html',0,0,0],
[6,'','',0,0,0],
[6,'','',0,0,0],
[6,'','',0,0,0],
[6,'','',0,0,0],
[6,'','',0,0,0],

// 親メニュー：リスクなど
[7,'手数料及びリスク説明',homeurl + 'doc/risk.html',0,0,0],
[7,'外国証券内容説明書（PDF）',homeurl + 'doc/pdf/fsdd.pdf',1,0,0],
[7,'ワラントプログラム（抜粋・PDF）',homeurl + 'doc/pdf/program.pdf',1,0,0],
[7,'プライバシー・ポリシー','http://www2.goldmansachs.com/japan/privacy-and-security/index.html',1,0,0],
[7,'利用規約','http://www2.goldmansachs.com/japan/terms-and-conditions-of-use/',1,0,0],
[7,'','',0,0,0],
[7,'','',0,0,0],
[7,'','',0,0,0],
[7,'','',0,0,0],
[7,'','',0,0,0]

];//最後の行は末尾のカンマに注意（カンマ要らない）


var togo;


//-- HTML文の生成
//   m:1stメニューの番号
//   s:2ndメニューの番号
function writemenu(m,s)
{
  var i,imax, j,jmax,htmlstr;

// メインメニュー項目数を求める
  imax = hdr.length;

  // マックス設定値以上の時
  if( m >= imax ) {
    m = myDEFAULT;//初期値に設定
  }

  htmlstr = '';

  htmlstr = '<div id="menu1st"><ul class="tmenu">\n';
// メニュー上部の描画
  for( i=0; i<imax; i++ ){

    // nullの場合、表示しない
    if(( uppermenu[i][0] == "" ) || ( uppermenu[i][0] == null )) {
      continue;
    }

    // 現在選択しているタブのclassの設定
    if( i == m ) {
      htmlstr = htmlstr + '<li class="current">';// 選択あり
    }else{
      htmlstr = htmlstr + '<li>';// 選択なし
    }

    //アドレスの生成
    switch( item[hdr[i][0]][myWINDOW] ) {
      case myON:
        htmlstr = htmlstr+'<a href="javascript:window.location=togo;" onclick="gotourl('+String(i)+',0)" ><b>';
        break;

      case myOFF:
        htmlstr = htmlstr+'<a href="javascript:void(0);" onclick="gotourl2('+String(i)+',0);OpenWin();" ><b>';
        break;

      default:
        htmlstr = htmlstr+'<a href="javascript:window.location=togo;" onclick="gotourl('+String(i)+',0)" ><b>';
        break;
    }

    htmlstr = htmlstr + uppermenu[i][0];
    htmlstr = htmlstr + '</b></a></li>\n';
  }

  htmlstr = htmlstr + '</ul></div>\n';

// サブメニューの項目数を求める
  jmax = hdr[m].length;

  htmlstr = htmlstr + '<div id="menu2nd"><ul>';
// メニュー下部の描画
  for( j=0; j<jmax; j++ ){

    // nullの場合、表示しない
    if(( item[hdr[m][j]][1] == "" ) || ( item[hdr[m][j]][1] == null )) {
      continue;
    }

    // 現在選択しているタブのclassの設定
    if( j != 0 ) {
      //メニュー行数
      switch( uppermenu[m][1] ) {
        case myMENU1:
          htmlstr = htmlstr + '<li class="menuline"></li>\n';// メニュー1行
          break;

        case myMENU2:
          htmlstr = htmlstr + '<li class="menuline2"></li>\n';// メニュー2行
          break;

        default:
          htmlstr = htmlstr + '<li class="menuline"></li>\n';// メニュー1行
          break;
      }
    }

    // 現在選択しているタブのclassの設定
    if( j == s ) {
      htmlstr = htmlstr + '<li class="menuon">';// 選択あり
    }else{
      htmlstr = htmlstr + '<li class="menu">';// 選択なし
    }

    //アドレスの生成
    switch( item[hdr[m][j]][myWINDOW] ) {
      case myON:
        htmlstr = htmlstr + '<a href="javascript:window.location=togo;" onclick="gotourl('+String(m)+','+String(j)+')" >';
        break;

      case myOFF:
        htmlstr = htmlstr + '<a href="javascript:void(0);" onclick="gotourl2('+String(m)+','+String(j)+');OpenWin();" >';
        break;

      default:
        htmlstr = htmlstr + '<a href="JavaScript:location=togo" onclick="gotourl('+String(m)+','+String(j)+')" >';
        break;
    }

    htmlstr = htmlstr + item[hdr[m][j]][1] + '</a></li>\n';
  }
  htmlstr = htmlstr + '</ul></div>\n';

  document.write(htmlstr);
//  alert(htmlstr);

}

// 読み替え先ＵＲＬを取得する
function gotourl(main,sub)
{
  togo = item[hdr[main][sub]][myURL];
  window.location=togo;
  return true;
}

// サブメニュー項目を新ウィンドウで開く
function gotourl2(main,sub)
{
  togo = item[hdr[main][sub]][myURL];
  togo_w = item[hdr[main][sub]][myWINDOWWIDTH];
  togo_h = item[hdr[main][sub]][myWINDOWHEIGHT];
  OpenWin();
  return false;
//  return true;
}


function OpenWin(){

  // 0,nullの場合、サイズ指定しない
  if(( togo_w == 0 ) || ( togo_h == 0 ) ||
     ( togo_w == null ) || ( togo_h == null )) {
    wintxt = "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,alwaysRaised=1";
  }else{
    wintxt = "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=" + togo_w + ",height=" + togo_h + ",alwaysRaised=1";
  }

  window.open(
  //開きたいページのURL
  togo,
  //新しいウィンドウの名前
  "win1",
  //新しいウィンドウのスタイル（いらない機能はnoにする。widthは横幅、heightは縦幅。）
  wintxt);

}

//----- *************************************
//----- ウィンドウオープン
//----- width=1000
//----- height=600
//----- *************************************
function Open_Another_Window(fname){
  window.open(
  //開きたいページのURL
  fname,
  //新しいウィンドウの名前
  "win0",
  //新しいウィンドウのスタイル（いらない機能はnoにする。widthは横幅、heightは縦幅。）
  "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600,alwaysRaised=1");
}

//----- *************************************
//----- ウィンドウオープン
//----- width=400
//----- height=620
//----- *************************************
function Open_sim(fname){
  window.open(
  //開きたいページのURL
  fname,
  //新しいウィンドウの名前
  "win0",
  //新しいウィンドウのスタイル（いらない機能はnoにする。widthは横幅、heightは縦幅。）
  "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=620,alwaysRaised=1");
}


//----- *************************************
//----- テキストの内容を消去
//----- *************************************
function erase_text(obj){
  if (obj.value == obj.defaultValue) obj.value = "";
}

//-->



// デフォルト
var myDefault  = 0;

//----- *************************************
//----- 
//----- header設定
//-----   headertext:index.htmlを基準とした階層
//----- *************************************

/*--- headerの定義　   ---*/
var headertext
 = [
['./ew/index.html','./np/index.html','./tr/index.html','./info/mailmag/index.html','./faq/index.html','./request/index.html','./sitemap.html','./images/btn_search02.gif'],
['../ew/index.html','../np/index.html','../tr/index.html','../info/mailmag/index.html','../faq/index.html','../request/index.html','../sitemap.html','../images/btn_search02.gif'],
['../../ew/index.html','../../np/index.html','../../tr/index.html','../../info/mailmag/index.html','../../faq/index.html','../../request/index.html','../../sitemap.html','../../images/btn_search02.gif'],
['../../../ew/index.html','../../../np/index.html','../../../tr/index.html','../../../info/mailmag/index.html','../../../faq/index.html','../../../request/index.html','../../../sitemap.html','../../../images/btn_search02.gif']
];

/*--------------------------------------------*/
//*****************************
// 指定されたheaderを書き込みます。
// @param id
//*****************************
function headertext_write(id){
  //0以下の場合、無効な数字の場合はデフォルトを表示、数字以外の文字
  if (( id < 0 ) || ( id >= headertext.length ) || (isNaN(id))){
    id = myDefault;
  }
  txt = "\
<!-- Start header logo -->\n\
<div id='header_logo'>\n\
<ul>\n\
<li class='logo01'><a href='" + headertext[id][0] +"'>eワラント</a></li>\n\
<li class='logo02'><a href='" + headertext[id][1] +"'>ニアピンeワラント</a></li>\n\
<li class='logo03'><a href='" + headertext[id][2] +"'>トラッカーeワラント</a></li>\n\
</ul>\n\
</div>\n\
<!-- End header logo -->\n\
<!-- Start header_submenu -->\n\
<div id='header_submenu' class='fsize_nochange'>\n\
<ul>\n\
<li><a href='" + headertext[id][3] +"'>メールマガジン</a>&nbsp;|&nbsp;</li>\n\
<li><a href='" + headertext[id][4] +"'>よくあるご質問/お問い合わせ</a>&nbsp;|&nbsp;</li>\n\
<li><a href='" + headertext[id][5] +"'>資料請求</a>&nbsp;|&nbsp;</li>\n\
<li><a href='" + headertext[id][6] +"'>サイトマップ</a></li>\n\
</ul>\n\
</div>\n\
<!-- End header header_submenu -->\n\
<!-- Start headerright -->\n\
<div id='headerright'>\n\
<!-- Start fontchange -->\n\
<div id='fontchange'>\n\
<ul>\n\
<li id='fstring'><b class='nontxt'>文字サイズの変更</b></li>\n\
<li id='fsmall'><a onclick=\"fontSizeCtrl('Default');iFrameHeight(); return false;\" onkeypress=\"fontSizeCtrl('Default'); return false;\"><b class='nontxt'>文字-小</b></a></li>\n\
<li id='fmiddle'><a onclick=\"fontSizeCtrl('Middle');iFrameHeight(); return false;\" onkeypress=\"fontSizeCtrl('Middle'); return false;\"><b class='nontxt'>文字-中</b></a></li>\n\
<li id='flarge'><a onclick=\"fontSizeCtrl('Large');iFrameHeight(); return false;\" onkeypress=\"fontSizeCtrl('Large'); return false;\"><b class='nontxt'>文字-大</b></a></li>\n\
</ul>\n\
</div><!-- End header fontchange -->\n\
<!-- on clearfloatbr -->\n\
<div class='clearfloatbr'></div>\n\
<!-- Start searchform -->\n\
<div id='searchform'>\n\
<form action='http://search-asp.fresheye.com/' id='search'>\n\
<ul>\n\
<li id='sfstr'><b class='nontxt'>eワラントのサイト内検索</b></li>\n\
<li><input type='text' name='kw' value='サイト内検索' onfocus='this.select()' onmousedown='erase_text(this)' />\n\
</li>\n\
<li>\n\
<input name='textfield' type='image' src='" + headertext[id][7] +"' alt='eワラントサイト内検索' />\n\
<input type='hidden' value='s' name='ord' />\n\
<input type='hidden' value='10519' name='id' />\n\
</li>\n\
</ul>\n\
</form>\n\
</div>\n\
<!-- End searchform -->\n\
</div>\n\
<!--  End headerright -->";

  document.write(txt);
}




//----- *************************************
//----- 
//----- header2の設定
//-----   headermenutext:index.htmlを基準とした階層
//----- *************************************
/*--- headerの定義　   ---*/
var headermenutext
 = [
['./doc/risk.html','./status/list.html','./gscgi/ew/src/index.gscgi','./simulate/Simulator_Explanation.htm'],
['../doc/risk.html','../status/list.html','../gscgi/ew/src/index.gscgi','../simulate/Simulator_Explanation.htm'],
['../../doc/risk.html','../../status/list.html','../../gscgi/ew/src/index.gscgi','../../simulate/Simulator_Explanation.htm'],
['../../../doc/risk.html','../../../status/list.html','../../../gscgi/ew/src/index.gscgi','../../../simulate/Simulator_Explanation.htm'],
];

/*--------------------------------------------*/
//*****************************
// 指定されたheaderを書き込みます。
// @param id
//*****************************
function headermenutext_write(id){
  //0以下の場合、無効な数字の場合はデフォルトを表示、数字以外の文字
  if (( id < 0 ) || ( id >= headermenutext.length ) || (isNaN(id))){
    id = myDefault;
  }
  txt = "\
<div id='notice'>\n\
<ul><li class='risk'><a href='" + headermenutext[id][0] +"'>手数料及びリスク説明：必ずお読みください</a></li>\n\
<li class='stop'><a href='" + headermenutext[id][1] +"' target='_blank'>取引停止銘柄情報</a></li></ul>\n\
</div>\n\
<!-- Start websearch -->\n\
<div id='websearch' class='clearfix'>\n\
<table summary='eワラント・ニアピンeワラント・トラッカーeワラントの検索窓' class='tableright'>\n\
<tr>\n\
<th colspan='2'><!-- Start ewarsearch -->\n\
<div id='ewarsearch'>\n\
<form method='post' action='" + headermenutext[id][2] +"' target='_top' name='ewarrantsearch' id='ewarrantsearch'>\n\
<table id='esearchtable' summary='商品分類、対象原資産カテゴリ、企業名・対象原資産指定、銘柄検索'>\n\
<tr>\n\
<td><h3>商品分類</h3></td>\n\
<td><h3>対象原資産カテゴリ</h3></td>\n\
<td><h3>企業名・対象原資産指定</h3></td>\n\
</tr>\n\
<tr>\n\
<td><select name='products' id='ewnpId' class='list-length' onchange='selectProduct(document.ewarrantsearch.products.options.selectedIndex);' style='width:125px;'>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
</select>\n\
</td>\n\
<td><select name='gyosyu' id='gyosyuId' onchange='loadWarrant(document.ewarrantsearch.gyosyu.options.selectedIndex);' style='width:135px;'>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
</select>\n\
</td>\n\
<td><select name='meigara' id='meigaraId' class='list-length' onchange='default_input();' style='width:320px;'>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
<option value=''>　　　　　　　　　　　　　　　　　</option>\n\
</select>\n\
</td>\n\
</tr>\n\
</table>\n\
</div>\n\
<!-- end websearch -->\n\
</th>\n\
</tr>\n\
<tr>\n\
<th><!-- Start searchmenu -->\n\
<div id='searchmenu'>\n\
<ul>\n\
<li class='menuon' id='searchMenu01' onclick='searchOpt(1)' onkeypress='searchOpt(1)'><a href='#'>銘柄検索</a></li>\n\
<li class='menu' id='searchMenu02' onclick='searchOpt(2)' onkeypress='searchOpt(2)'><a href='#'>一発一覧型シミュレーター</a></li>\n\
<li class='menu' id='searchMenu03' onclick='searchOpt(3)' onkeypress='searchOpt(3)'><a href='#'>理論派シミュレーター</a></li>\n\
<li class='menu' id='searchMenu04' onclick='searchOpt(4)' onkeypress='searchOpt(4)' style='display:none'><a href='#'>二アピンシミュレーター</a></li>\n\
<li class='help'><a href=\"javascript:Open_sim('" + headermenutext[id][3] +"');\"><b class='nontxt'>ヘルプ</b></a></li>\n\
</ul>\n\
</div>\n\
</th>\n\
<td class='tdright'>\n\
<div id='searchoptionbtn'><a href='javascript:sendValue();DoAction();'><b class='nontxt'>eワラント・ニアピンeワラント・トラッカーeワラントの検索実行ボタン</b>&nbsp;</a>\n\
<input name='ap' value='20' type='hidden' />\n\
<input name='genre' value='' type='hidden' />\n\
<input name='mei' value='' type='hidden' />\n\
<input name='meigara_opt' value='' type='hidden' />\n\
<input name='gyo' value='' type='hidden' />\n\
<input name='cgi_target' value='ew' type='hidden' />\n\
<input name='e_select' value='ew' id='e_select' type='hidden' />\n\
<input name='ex_day' value='1' type='hidden' />\n\
<input name='ex_price' value='1000' type='hidden' />\n\
<input name='rate' value='0.00' type='hidden' />\n\
<input name='div' value='0.00' type='hidden' />\n\
<input name='exchange' value='1' type='hidden' />\n\
</div>\n\
<!-- End header_menu searchmenu -->\n\
</form>\n\
</td>\n\
</tr>\n\
</table></div><!-- End header_menu search -->";

  document.write(txt);
}




//----- *************************************
//----- 
//----- sidebar設定
//-----   sidebartext:index.htmlを基準とした階層
//----- *************************************

/*--- sidebarの定義　   ---*/
var sidebartext
 = [
['./info/pcratio.html','./info/imgs/pc_ratio_small.gif','./info/imgs/pcratio_text_s.gif','./ranking/rank-vlm-30.html','./ranking/rank-vlm-30.html','./ranking/rank-all.html','./ranking/rank-his.html'],
['../info/pcratio.html','../info/imgs/pc_ratio_small.gif','../info/imgs/pcratio_text_s.gif','../ranking/rank-vlm-30.html','../ranking/rank-vlm-30.html','../ranking/rank-all.html','../ranking/rank-his.html'],
['../../info/pcratio.html','../../info/imgs/pc_ratio_small.gif','../../info/imgs/pcratio_text_s.gif','../../ranking/rank-vlm-30.html','../../ranking/rank-vlm-30.html','../../ranking/rank-all.html','../../ranking/rank-his.html'],
['../../../info/pcratio.html','../../../info/imgs/pc_ratio_small.gif','../../../info/imgs/pcratio_text_s.gif','../../../ranking/rank-vlm-30.html','../../../ranking/rank-vlm-30.html','../../../ranking/rank-all.html','../../../ranking/rank-his.html'],
];

/*--------------------------------------------*/
//*****************************
// 指定されたheaderを書き込みます。
// @param id
//*****************************
function sidebartext_write(id){
  //0以下の場合、無効な数字の場合はデフォルトを表示、数字以外の文字
  if (( id < 0 ) || ( id >= sidebartext.length ) || (isNaN(id))){
    id = myDefault;
  }
  txt = "\
<div id='callratio'>\n\
<!-- Start callratio -->\n\
<h2>eワラント プット・コールレシオ</h2>\n\
<div id='callratioimg'>\n\
<p><a href='" + sidebartext[id][0] +"'><img src='" + sidebartext[id][1] +"' height='150' width='260' alt='eワラント プット・コールレシオ、グラフ' /></a></p>\n\
<p class='mt1em'><img src='" + sidebartext[id][2] +"' height='9' width='260' alt='日経平均株価、eワラント プット・コールレシオ' /></p>\n\
</div>\n\
</div>\n\
<!-- end callratio -->\n\
<!-- on callratiotext -->\n\
<div id='callratiotext'><dl class='dis_kome'><dt>*</dt><dd>eワラントプット・コールレシオはあくまでも指標の一種であり、必ずしも将来の結果を保証するものではありません。最終的な投資の判断は、ご自身の責任で行ってください。</dd></dl></div>\n\
<div class='clearfloatbr'></div>\n\
<!-- on rankingtitle -->\n\
<div id='rankingtitle'>\n\
<h2>ランキング</h2>\n\
</div>\n\
<!-- Start ranking-->\n\
<div class='ranking'>\n\
<h3 class='ew'>eワラント直近30分の取引金額ランキング</h3>\n\
<script language='JavaScript'>rankingtable('30ewarrant','3');</script>\n\
<ul>\n\
<li class='left'>\n\
<script type='text/javascript'>func_ew_30min_timeFormat1()</script>\n\
&nbsp;時点</li>\n\
<li><a href='" + sidebartext[id][3] +"'>詳細</a></li>\n\
</ul>\n\
</div>\n\
<!-- End ranking-->\n\
<!-- Start ranking-->\n\
<div class='ranking'>\n\
<h3>ニアピンeワラント直近30分の取引金額ランキング</h3>\n\
<script language='JavaScript'>rankingtable('30nearpin','3');</script>\n\
<ul>\n\
<li class='left'>\n\
<script type='text/javascript'>func_np_30min_timeFormat1()</script>\n\
&nbsp;時点</li>\n\
<li><a href='" + sidebartext[id][4] +"'>詳細</a></li>\n\
</ul>\n\
</div>\n\
<!-- End ranking-->\n\
<!-- Start ranking-->\n\
<div class='ranking'>\n\
<h3>リアルタイム上昇率(前日比)ランキング<sup>*1</sup></h3>\n\
<script language='JavaScript'>rankingtable('top_rt','3');</script>\n\
<ul>\n\
<li><a href='" + sidebartext[id][5] +"'>詳細</a></li>\n\
</ul>\n\
</div>\n\
<!-- End ranking-->\n\
<!-- Start ranking-->\n\
<div class='ranking'>\n\
<h3>前日の上昇率ランキング<sup>*2</sup></h3>\n\
<script language='JavaScript'>rankingtable('top','3');</script>\n\
<ul>\n\
<li><a href='" + sidebartext[id][6] +"'>詳細</a></li>\n\
</ul>\n\
</div>\n\
<!-- End ranking-->\n\
<!-- Start rankingNotes-->\n\
<div class='rankingNotes'>上昇率ランキングは買取価格ベースであり、販売価格と買取価格の差（売買スプレッド）は考慮されていないので、実際のパフォーマンスとは異なる場合があります。\n\
<dl>\n\
<dt>*1</dt>\n\
<dd>前日終値（通常23:50時点の買取価格）と本日\n\
<script type='text/javascript'>func_touraku_top_rt_timeFormat1();</script>\n\
時点の買取価格を比較</dd>\n\
<dt>*2</dt>\n\
<dd>2日前の終値と前日の終値（ともに通常23:50時点の買取価格）を比較</dd>\n\
</dl>\n\
</div>\n\
<!-- End rankingNotes-->\n\
<div class='clearfloatbr'></div>";

  document.write(txt);
}




//----- *************************************
//----- 
//----- copyright設定
//----- 
//----- *************************************

var copytext = new Array();

/*--- copyrightの定義　   ---*/
  copytext[0] = "<p id='copyright' class='copyright'>&copy; Copyright 2010, The Goldman Sachs Group, Inc. All rights reserved.</p>";
/*--------------------------------------------*/
//*****************************
// 指定されたcopyrightを書き込みます。
// @param id
//*****************************
function copytext_write(id){
  if( copytext[id] == undefined ){
    // デフォルトの文章を設定
    txt=copytext[myDefault];
  }else{
    txt=copytext[id];
  }
  document.write(txt);
}


