/////////////////////////////
// index.html
/////////////////////////////
function setModifiedDate() {
//  alert('call setModifiedDate');
  document.write('<FONT size=\"-1\">');
  document.write('Last updated ', document.lastModified);
  document.write('</FONT>');
}

/////////////////////////////
// t_frame2.html
/////////////////////////////
function selectDate() {
  var index = document.Form1.tubuyakiDate.selectedIndex;
  var filename = 't_' + document.Form1.tubuyakiDate.options[index].value + '.html';
//alert(filename);
//  top.frameMain.location.href = filename;
  top.frameMain.location.replace(filename);
}

function clearDate(lstSelect) {
  var max = lstSelect.options.length;
//alert('max=' + max);
  for (i = 0; i < max; i++) {
    lstSelect.remove(0);
  }
}

function createDate(lstSelect, arrayStr, arrayVal) {
    for (i = 0; i < arrayStr.length; i++) {
      var oAdd = document.createElement("OPTION");
      oAdd.text  = arrayStr[i];
      oAdd.value = arrayVal[i];
      lstSelect.add(oAdd);
    }
}

function createTubuyakiDate() {
  clearDate(document.Form1.tubuyakiDate);
  var index = document.Form1.tubuyakiBack.selectedIndex;
  var dateBack = document.Form1.tubuyakiBack.options[index].value;
  if (dateBack == '200405') {
    var strDate200405 = new Array("2004年 5月29日","2004年 5月×日");
    var valDate200405 = new Array(20040529,20040501);
    createDate(document.Form1.tubuyakiDate, strDate200405, valDate200405);
  }
  else if (dateBack == '200406') {
    var strDate200406 = new Array("2004年 6月29日","2004年 6月28日","2004年 6月24日",
                                  "2004年 6月22日","2004年 6月21日","2004年 6月18日",
                                  "2004年 6月16日","2004年 6月13日","2004年 6月10日",
                                  "2004年 6月 8日","2004年 6月 3日","2004年 6月 2日");
    var valDate200406 = new Array(20040629,20040628,20040624,
                                  20040622,20040621,20040618,
                                  20040616,20040613,20040610,
                                  20040608,20040603,20040602);
    createDate(document.Form1.tubuyakiDate, strDate200406, valDate200406);
  }
  else if (dateBack == '200407') {
    var strDate200407 = new Array("2004年 7月31日","2004年 7月29日","2004年 7月22日",
                                  "2004年 7月18日","2004年 7月13日","2004年 7月 9日",
                                  "2004年 7月 6日","2004年 7月 1日");
    var valDate200407 = new Array(20040731,20040729,20040722,
                                  20040718,20040713,20040709,
                                  20040706,20040701);
    createDate(document.Form1.tubuyakiDate, strDate200407, valDate200407);
  }
  else if (dateBack == '200408') {
    var strDate200408 = new Array("2004年 8月27日","2004年 8月18日","2004年 8月10日",
                                  "2004年 8月 6日","2004年 8月 3日");
    var valDate200408 = new Array(20040827,20040818,20040810,
                                  20040806,20040803);
    createDate(document.Form1.tubuyakiDate, strDate200408, valDate200408);
  }
  else if (dateBack == '200409') {
    var strDate200409 = new Array("2004年 9月28日","2004年 9月21日","2004年 9月 7日",
                                  "2004年 9月 2日");
    var valDate200409 = new Array(20040928,20040921,20040907,
                                  20040902);
    createDate(document.Form1.tubuyakiDate, strDate200409, valDate200409);
  }
  else if (dateBack == '200410') {
    var strDate200410 = new Array("2004年10月18日","2004年10月14日","2004年10月 9日",
                                  "2004年10月 2日");
    var valDate200410 = new Array(20041018,20041014,20041009,
                                  20041002);
    createDate(document.Form1.tubuyakiDate, strDate200410, valDate200410);
  }
  else if (dateBack == '200411') {
    var strDate200411 = new Array("2004年11月 4日");
    var valDate200411 = new Array(20041104,0);
    createDate(document.Form1.tubuyakiDate, strDate200411, valDate200411);
  }
  else if (dateBack == '200412'){
    var strDate200412 = new Array("2004年12月27日");
    var valDate200412 = new Array(20041227,0);
    createDate(document.Form1.tubuyakiDate, strDate200412, valDate200412);
  }
  else if (dateBack == '200501'){
    var strDate200501 = new Array("2005年 1月19日","2005年 1月 9日","2005年 1月 2日");
    var valDate200501 = new Array(20050119,20050109,20050102);
    createDate(document.Form1.tubuyakiDate, strDate200501, valDate200501);
  }
  else if (dateBack == '200502'){
    var strDate200502 = new Array("2005年 2月28日","2005年 2月8日");
    var valDate200502 = new Array(20050228,20050208);
    createDate(document.Form1.tubuyakiDate, strDate200502, valDate200502);
  }
  else if (dateBack == '200504'){
    var strDate200504 = new Array("2005年 4月29日","2005年 4月19日");
    var valDate200504 = new Array(20050429,20050419);
    createDate(document.Form1.tubuyakiDate, strDate200504, valDate200504);
  }
  else if (dateBack == '200602'){
    var strDate200602 = new Array("2006年 2月23日");
    var valDate200602 = new Array(20060223,0);
    createDate(document.Form1.tubuyakiDate, strDate200602, valDate200602);
  }
  else if (dateBack == '200603'){
    var strDate200603 = new Array("2006年 3月4日","2006年 3月10日","2006年 3月1日");
    var valDate200603 = new Array(20060304,20060310,20060301);
    createDate(document.Form1.tubuyakiDate, strDate200603, valDate200603);
  }
  else if (dateBack == '200604'){
    var strDate200604 = new Array("2006年 4月25日","2006年 4月17日");
    var valDate200604 = new Array(20060425,20060417);
    createDate(document.Form1.tubuyakiDate, strDate200604, valDate200604);
  }
  else if (dateBack == '200605'){
    var strDate200605 = new Array("2006年 5月31日","2006年 5月7日");
    var valDate200605 = new Array(20060531,20060507);
    createDate(document.Form1.tubuyakiDate, strDate200605, valDate200605);
  }
  else if (dateBack == '200606'){
    var strDate200606 = new Array("2006年 6月16日","2006年 6月11日");
    var valDate200606 = new Array(20060616,20060611);
    createDate(document.Form1.tubuyakiDate, strDate200606, valDate200606);
  }
  else if (dateBack == '200608'){
    var strDate200608 = new Array("2006年 8月2日");
    var valDate200608 = new Array(20060802,0);
    createDate(document.Form1.tubuyakiDate, strDate200608, valDate200608);
  }
  else if (dateBack == '200611'){
    var strDate200611 = new Array("2006年11月26日","2006年11月3日");
    var valDate200611 = new Array(20061126,20061103);
    createDate(document.Form1.tubuyakiDate, strDate200611, valDate200611);
  }
  else if (dateBack == '200612'){
    var strDate200612 = new Array("2006年12月14日");
    var valDate200612 = new Array(20061214,0);
    createDate(document.Form1.tubuyakiDate, strDate200612, valDate200612);
  }
  else if (dateBack == '200701'){
    var strDate200701 = new Array("2007年 1月2日");
    var valDate200701 = new Array(20070102,0);
    createDate(document.Form1.tubuyakiDate, strDate200701, valDate200701);
  }
  else if (dateBack == '200702'){
    var strDate200702 = new Array("2007年 2月28日", "2007年 2月21日", "2007年 2月16日", "2007年 2月6日");
    var valDate200702 = new Array(20070228,20070221,20070216,20070206);
    createDate(document.Form1.tubuyakiDate, strDate200702, valDate200702);
  }
  else if (dateBack == '200704'){
    var strDate200704 = new Array("2007年 4月11日", "2007年 4月8日");
    var valDate200704 = new Array(20070411,20070408);
    createDate(document.Form1.tubuyakiDate, strDate200704, valDate200704);
  }
  else{
    var strDate200706 = new Array("2007年 6月 4日");
    var valDate200706 = new Array(20070604,0);
    createDate(document.Form1.tubuyakiDate, strDate200706, valDate200706);
  }
  
  selectDate();
}

/////////////////////////////
// j_frame2.html
/////////////////////////////
function selectJob() {
  var index = document.Form1.activityDate.selectedIndex;
  var filename = 'j_' + document.Form1.activityDate.options[index].value + '.html';
  if (index != '0') {
    top.frameMain.location.replace(filename);
  }
  return;
}

function setJob() {
  top.frameMain.location.replace('j_001.html');
  return;
}

function setLicense() {
  top.frameMain.location.replace('j_002.html');
  return;
}

function setJobEnv() {
  top.frameMain.location.replace('j_003.html');
  return;
}

function setJobLink() {
  top.frameMain.location.replace('j_004.html');
  return;
}

/////////////////////////////
// p_frame2.html
/////////////////////////////
function setSmile() {
  top.frameMain.location.replace('p_001.html');
  return;
}

function setHealthy() {
  top.frameMain.location.replace('p_002.html');
  return;
}

function setLife() {
  top.frameMain.location.replace('p_003.html');
  return;
}

function selectOutDoor() {
  var index = document.Form1.selOutDoor.selectedIndex;
//  document.Form1.selInDoor.selectedIndex = 0;
  var filename = 'p_' + document.Form1.selOutDoor.options[index].value + '.html';
  top.frameMain.location.replace(filename);
}

function selectInDoor() {
  var index = document.Form1.selInDoor.selectedIndex;
//  document.Form1.selOutDoor.selectedIndex = 0;
  var filename = 'p_' + document.Form1.selInDoor.options[index].value + '.html';
  top.frameMain.location.replace(filename);
}

function setSelectShop() {
  top.frameMain.location.replace('p_02008.html');
  return;
}

/////////////////////////////
// y_frame2.html
/////////////////////////////
function setProfile() {
  top.frameMain.location.replace('y_001.html');
  return;
}

function setFriends() {
  top.frameMain.location.replace('y_002.html');
  return;
}

function setBeauty() {
  top.frameMain.location.replace('y_003.html');
  return;
}

function setEnergy() {
  top.frameMain.location.replace('y_004.html');
  return;
}

function checkBeauty() {
  var count = 0;
  var strCheck = new Array("check1","check2","check3","check4","check5","check6","check7","check8");
  for (i = 0; i < strCheck.length; i++) {
    if (document.Form1.elements[i].checked) {
      count++;
    }
  }
  
  var strMessage="";
  if (count <= 4) {
    strMessage = "美貯金かなり減っていますｘｘｘ　(~_~;)";
  }
  else if (count <= 6) {
    strMessage = "じょうずに美貯金使ってますね。Goodです。(^。^)";
  }
  else {
    strMessage = "美貯金節約じょうず。Excellent!!　＼(^o^)／";
  }
  alert(strMessage);
  
  return;
}

/////////////////////////////
// b_frame2.html
/////////////////////////////
function setBread() {
  top.frameMain.location.replace('b_001.html');
  return;
}

function setBakery() {
  top.frameMain.location.replace('b_002.html');
  return;
}

function setIngredients() {
  top.frameMain.location.replace('b_003.html');
  return;
}

/////////////////////////////
// c_frame2.html
/////////////////////////////
function setChild() {
  top.frameMain.location.replace('c_001.html');
  return;
}

function setNinpuTaiso() {
  top.frameMain.location.replace('c_ninputaiso.html');
  return;
}

function setMeetBaby() {
  top.frameMain.location.replace('c_002.html');
  return;
}


