<!-- JavaScript Start
// 年賀はがき の当選番号の調査 2004年

function AtariEntry(tou, no_0,no_1, no_2, no_3) {
   this.tou  = tou ; 
   this.no_0 = no_0 ;
   this.no_1 = no_1 ;
   this.no_2 = no_2 ;
   this.no_3 = no_3 ;
   this.find = AtariFind  ;
   return this ; 
}

function AtariFind(no_0, no_1, no_2, no_3) {
   if(no_3 == this.no_3 && no_2 == this.no_2 && no_1 == this.no_1 && no_0 == this.no_0) {
      return this.tou ;
   }
   else if(no_3 == this.no_3 && no_2 == this.no_2 && no_1 == this.no_1) {
     if(no_0 == null) {
         return 0 ;
     } 
     else if(this.no_0 == null) {
         return this.tou ;
     }
   }
   else if(no_3 == this.no_3 && no_2 == this.no_2) {
     if(no_1 == null) {
         return -1 ;
     } 
     else if(this.no_1 == null) {
         return this.tou ;
     }
   }
   else if(no_3 == this.no_3) {
     if(no_2 == null) {
         return -2 ;
     } 
     else if(this.no_2 == null) {
         return this.tou ;
     }
   }
   else if(no_3 == null) {
     return -3 ;
   } else {  
     return null ;
   }
}


function AtariSet() {
   this [00] = new AtariEntry(1,5,7,45,78) ;
   this [01] = new AtariEntry(2,9,5,73,58) ;
   this [02] = new AtariEntry(2,7,6,94,66) ;
   this [03] = new AtariEntry(2,3,9,79,40) ;
   this [04] = new AtariEntry(6,9,3,54,73) ;
   this [05] = new AtariEntry(6,5,8,81,04) ;
   this [06] = new AtariEntry(6,5,2,00,56) ;
   this [07] = new AtariEntry(6,7,0,08,71) ;
   this [08] = new AtariEntry(7,8,1,27,51) ;
   this [09] = new AtariEntry(7,5,6,11,01) ;   
   this [10] = new AtariEntry(3,null,null,96,60) ;
   this [11] = new AtariEntry(4,null,null,null,37) ;
   this [12] = new AtariEntry(4,null,null,null,64) ;
   this.seek = AtariSeek  ;
   return this ;
}

function AtariSeek(no_0, no_1, no_2, no_3) {
   for(var i = 0 ;i <= 12 ; i++) {
     ret = Atari[i].find(no_0, no_1, no_2, no_3) ;
     if(ret != null) {
       return  ret ;
     }
   }
   return null
}

function AtariCheck() {
  if(document.main.textBox0.value.length > 0) {
    var no_0 = document.main.textBox0.value ;
  } else {
    var no_0 = null ;    
  }
  if(document.main.textBox1.value.length > 0) {
    var no_1 = document.main.textBox1.value ;
  } else {
    var no_1 = null ;    
  }
  if(document.main.textBox2.value.length > 0) {
    var no_2 = document.main.textBox2.value ;
  } else {
    var no_2 = null ;    
  }
  if(document.main.textBox3.value.length > 0) {
    var no_3 = document.main.textBox3.value ;
  } else {
    var no_3 = null ;    
  }

  var chk  = Atari.seek(no_0, no_1, no_2, no_3) ;
  var disp = " " ;
  if (chk == null) {
     disp = "どうも外れの様です" ;
  }
  else if (chk < -2) {
     disp = "全然入力してないんじゃないの？" ;
  }
  else if (chk < 1) {
     disp = "可能性あり。他の桁も入力してみて。" ;
  }
  else if (chk == 1) {
     disp = "おめでとうございます　１等賞です！！！！！" ;
  }
  else if (chk == 2) {
     disp = "やりましたね　２等賞です！！！！！" ;
  }
  else if (chk == 3) {
     disp = "ブラボー！　３等賞です。" ;
  }
  else if (chk == 4) {
     disp = "すばらしい　４等賞です。" ;
  }
  else if (chk == 5) {
     disp = "なんとか　５等賞です。" ;
  }
  else if (chk == 6) {
     disp = "年賀オリジナル賞です。任天堂ＤＳ！" ;
  }
  else if (chk == 7) {
     disp = "Ｃ組だったら当たり。Ｃ組限定賞です" ;
  }
  else {
     disp = "可能性あり。他の桁も入力！" ;
  }
  document.main.textBox.value =  disp ;
}

function startJavaScript() {
  Atari = new AtariSet ;
}


// Java Script End -->